Esempio n. 1
0
 /**
  * Create workflow for document signature
  *
  * @param DocumentSignature $signature
  * @param Document $document
  */
 private function createWorkflow(DocumentSignature $signature, Document $document)
 {
     $account = $signature->getClientAccount();
     $client = $account->getClient();
     $type = $signature->getType();
     // TODO: workflow changes
     if (DocumentSignature::TYPE_OPEN_OR_TRANSFER_ACCOUNT === $type) {
         $event = new WorkflowEvent($client, $account, Workflow::TYPE_PAPERWORK, null);
         $this->get('event_dispatcher')->dispatch(ClientEvents::CLIENT_WORKFLOW, $event);
     }
 }
 /**
  * Get document signature activity
  *
  * @param DocumentSignature $signature
  * @return string
  */
 public function getActivity(DocumentSignature $signature)
 {
     $type = $signature->getType();
     $source = $this->getSourceObject($signature);
     $account = $source->getClientAccount();
     $accountGroup = $account->getGroupName();
     switch ($type) {
         case DocumentSignature::TYPE_OPEN_OR_TRANSFER_ACCOUNT:
             if ($accountGroup === AccountGroup::GROUP_DEPOSIT_MONEY) {
                 $activity = 'Open an account';
             } elseif ($accountGroup === AccountGroup::GROUP_FINANCIAL_INSTITUTION) {
                 $activity = 'Transfer an account';
             } elseif ($accountGroup === AccountGroup::GROUP_OLD_EMPLOYER_RETIREMENT) {
                 $activity = 'Rollover a 401(k)';
             } else {
                 $activity = 'Undefined';
             }
             break;
         case DocumentSignature::TYPE_TRANSFER_INFORMATION:
             $activity = 'Transfer Account';
             break;
         case DocumentSignature::TYPE_AUTO_INVEST_CONTRIBUTION:
             $activity = 'Auto-invest instructions';
             break;
         case DocumentSignature::TYPE_AUTO_DISTRIBUTION:
             $activity = 'Auto-distribution instructions';
             break;
         case DocumentSignature::TYPE_ONE_TIME_CONTRIBUTION:
             $activity = 'One Time Contribution';
             break;
         case DocumentSignature::TYPE_ONE_TIME_DISTRIBUTION:
             $activity = 'One Time Distribution';
             break;
         case DocumentSignature::TYPE_CHANGE_BENEFICIARY:
             $activity = 'Change Beneficiary';
             break;
         default:
             $activity = 'Undefined';
             break;
     }
     return $activity;
 }