/**
  * Move pdf file
  *
  * @param null $contract_id
  * @return bool
  */
 public function movePdFToFolder($contract_id = null)
 {
     if (is_null($contract_id)) {
         $contracts = $this->contract->getProcessCompleted();
         foreach ($contracts as $contract) {
             $file = $contract->file;
             $moveTo = sprintf('%s/%s', $contract->id, $contract->file);
             if ($this->contract->moveS3File($file, $moveTo)) {
                 $this->info(sprintf('Contract %s : completed.', $contract_id));
                 continue;
             }
             $this->info(sprintf('Contract %s : failed.', $contract_id));
         }
         return true;
     }
     $contract = $this->contract->find($contract_id);
     $file = $contract->file;
     $moveTo = sprintf('%s/%s', $contract->id, $contract->file);
     if ($this->contract->moveS3File($file, $moveTo)) {
         $this->info(sprintf('Contract %s : completed.', $contract_id));
         return true;
     }
     $this->info(sprintf('Contract %s : failed.', $contract_id));
     return true;
 }
 /**
  * Generate word file from console command
  *
  * @param $contract_id
  * @return bool
  */
 protected function generateWordFile($contract_id)
 {
     if (is_null($contract_id)) {
         $contracts = $this->contract->getProcessCompleted();
         if (!is_null($contracts)) {
             foreach ($contracts as $contract) {
                 $this->generateWordFile($contract->id);
             }
             return true;
         }
         $this->info('Contract not found');
         return false;
     }
     if ($this->contract->updateWordFile($contract_id)) {
         $this->info(sprintf('Contract %s : completed.', $contract_id));
         return true;
     } else {
         $this->info(sprintf('Contract %s : failed.', $contract_id));
         return false;
     }
 }