Beispiel #1
0
 public static function generateStory(LoanApplicationRequest $request, LoanApplicationResponse $response) : string
 {
     $approvedStatus = $response->isApproved() ? 'approved' : 'not approved';
     $story = "--- The story of {$request->getCustomer()} ---" . PHP_EOL;
     $story .= "The bank customer {$request->getCustomer()} has applied for a loan of {$request->getAmount()}." . PHP_EOL;
     $story .= "The bank has {$approvedStatus} the request, and the form has been processed by a {$response->getAgent()}." . PHP_EOL . PHP_EOL;
     return $story;
 }
 /**
  * Approve the loan request and return it to the customer.
  *
  * @return LoanApplicationResponse
  */
 public function rejectLoanRequest() : LoanApplicationResponse
 {
     $loanResponse = new LoanApplicationResponse();
     $loanResponse->setApproved(false)->setAgent($this);
     return $loanResponse;
 }