Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function setupContext()
- {
- $investor = $this->getContext()
- ->customer()
- ->investor($id = 1, \common\core\models\Investor::WORKFLOW_CASH, $withdrawalPolicy = 'balance');
- $investor
- ->shopLoan($id = 1, $value = 6000.00, $hasRegistry = true)
- ->investorLoan($id = 1, $value = 2000)
- ->investorLoan($id = 2, $value = 3000, true);
- $investor
- ->shopLoan($id = 2, $value = 3000.00, $hasRegistry = false)
- ->investorLoan($id = 3, $value = 1000)
- ->investorLoan($id = 4, $value = 2000, false, $dueDate = $investor->getDayContext()->date);
- $investor
- ->shopLoan($id = 3, $value = 3000.00, $hasRegistry = false)
- ->investorLoan($id = 5, $value = 3000, $is_amortizable = true);
- }
- public function createActions()
- {
- $this
- // given
- ->depositInvestorLoan($id = 1, $body = 2000.0, $interest = 20)
- ->depositInvestorLoan($id = 2, $body = 3000, $interest = 30)
- ->depositInvestorLoan($id = 3, $body = 1000, $interest = 30)
- ->depositInvestorLoan($id = 4, $body = 2000, $interest = 15)
- ->depositInvestorLoan($id = 5, $body = 3000, $interest = 10)
- ->registerCustomerLoanRepayments($id = 1, $totalLoanBeforeRepayments = 12000, $adminRepayments = 300, $clientRepayment = 300)
- ->registerCustomerIncomeForInvestorPlatform($totalIncome = 2000.00, $perShopLoanIncomes = [1 => 200.00])
- // when
- ->performOnlyInvestorPlatformRepayments()
- // then
- ->assertInvestorLoanDepositInterest($id = 1, $interest = 0.0)
- ->assertInvestorLoanDeposit($id = 1, $body = 1950)
- ->assertInvestorLoanDepositInterest($id = 2, 0.0)
- ->assertInvestorLoanDeposit($id = 2, $body = 2856.75)
- ->assertInvestorLoanDepositInterest($id = 3, 0.0)
- ->assertInvestorLoanDeposit($id = 3, $body = 975)
- ->assertInvestorLoanDepositInterest($id = 4, 0.0)
- ->assertInvestorLoanDeposit($id = 4, $body = 0)//->assertInvestorLoanWithdrawalRequests($id=1, $body=4, $interest=2.34)
- ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement