From 0f8b03348c6aeb59802d31c6ec638b0872e6498d Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Fri, 1 May 2026 14:56:52 -0500 Subject: [PATCH 1/2] FINERACT-2455: Working Capital loan discount field enhancement --- .../test/helper/ErrorMessageHelper.java | 4 + .../WorkingCapitalLoanAccountStepDef.java | 38 +- .../WorkingCapitalDelinquency.feature | 80 +-- .../WorkingCapitalDelinquencyPause.feature | 48 +- .../WorkingCapitalLoanAccount.feature | 567 +++++++++++++----- .../WorkingCapitalLoanRepayment.feature | 68 +-- .../WorkingCapitalLoanApiResourceSwagger.java | 6 +- .../data/WorkingCapitalLoanData.java | 2 + .../mapper/WorkingCapitalLoanMapper.java | 2 + .../WorkingCapitalLoanDataValidator.java | 9 +- ...lLoanAmortizationScheduleWriteService.java | 2 + ...nAmortizationScheduleWriteServiceImpl.java | 23 +- .../WorkingCapitalLoanAssemblerImpl.java | 4 +- ...ngCapitalLoanWritePlatformServiceImpl.java | 27 +- ...rkingCapitalLoanProductRelatedDetails.java | 6 + .../module-changelog-master.xml | 1 + ...035_wc_loan_discount_proposed_approved.xml | 50 ++ ...WorkingCapitalLoanApplicationCRUDTest.java | 93 ++- ...rkingCapitalLoanApprovalRejectionTest.java | 19 +- .../WorkingCapitalLoanHelper.java | 28 + 20 files changed, 792 insertions(+), 285 deletions(-) create mode 100644 fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0035_wc_loan_discount_proposed_approved.xml diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java index 0b1b6f60900..9d1faec00d9 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java @@ -1090,6 +1090,10 @@ public static String discountAmountExceedFailure() { return "Failed data validation due to: amount.cannot.exceed.created.discount."; } + public static String discountAmountExceedApprovedFailure() { + return "Failed data validation due to: amount.cannot.exceed.approved.discount."; + } + public static String discountAlreadySetBeforeDisburseFailure() { return "Discount was already set before disbursement and cannot be added again"; } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java index 186df4f2c0e..d93f1b65343 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java @@ -818,7 +818,7 @@ public void disburseWCLoanWithDiscount(String actualDisbursementDate, String tra @When("Admin failed to disburse the working capital loan on {string} with {string} amount with {string} exceeded discount amount") public void disburseWorkingCapitalLoanWithExceededDiscountFailure(String actualDisbursementDate, String transactionAmount, String discountAmount) { - String errorMessage = ErrorMessageHelper.discountAmountExceedFailure(); + String errorMessage = ErrorMessageHelper.discountAmountExceedApprovedFailure(); disburseWorkingCapitalLoanFailure(actualDisbursementDate, transactionAmount, discountAmount, errorMessage); } @@ -997,6 +997,38 @@ public void workingCapitalLoanHasTransactions(final DataTable dataTable) throws assertTable(GetWorkingCapitalLoanTransactionIdResponse.class, dataTable, actualTransactions); } + @Then("Admin successfully update discount with {string} amount on Working Capital loan account") + public void adminSuccessfullyUpdateDiscountWithAmountOnWorkingCapitalLoanAccount(String discountAmount) { + PostWorkingCapitalLoansLoanIdResponse lastDisbursementResponse = testContext().get(TestContextKey.LOAN_DISBURSE_RESPONSE); + final PostWorkingCapitalLoansLoanIdRequest request = workingCapitalLoanRequestFactory.defaultWorkingCapitalLoanDiscountFeeRequest() // + .relatedResourceId(lastDisbursementResponse.getResourceId()).transactionAmount(new BigDecimal(discountAmount)); + executeStateTransition("DISCOUNTFEE", request, "DISCOUNT", false); + } + + @Then("Update discount with {string} amount on Working Capital loan account failed due to date diff from disbursement date") + public void updateDiscountWithAmountOnWorkingCapitalLoanAccountFailedDueToDateDiffFromDisbursementDate(String discountAmount) { + String errorMessage = ErrorMessageHelper.discountDiffDateFromDisburseFailure(); + addDiscountFeeFailedCheck(discountAmount, errorMessage); + } + + @Then("Add discount with {string} amount on Working Capital loan account failed due to already added discount before disbursement") + public void addDiscountWithAmountOnWorkingCapitalLoanAccountFailedDueToAlreadyAddedDiscountBeforeDisbursement(String discountAmount) { + String errorMessage = ErrorMessageHelper.discountAlreadySetBeforeDisburseFailure(); + addDiscountFeeFailedCheck(discountAmount, errorMessage); + } + + @Then("Update discount with {string} amount on Working Capital loan account failed due to override disallowed by product") + public void updateDiscountWithAmountOnWorkingCapitalLoanAccountFailedDueToOverrideDisallowedByProduct(String discountAmount) { + String errorMessage = ErrorMessageHelper.overrideDisallowedByProductFailure(); + addDiscountFeeFailedCheck(discountAmount, errorMessage); + } + + @Then("Update discount with {string} amount on Working Capital loan account failed due to exceed discount amount") + public void update_discount_with_amount_on_working_capital_loan_account_failed_due_to_exceed_discount_amount(String discountAmount) { + String errorMessage = ErrorMessageHelper.discountExceedCreatedDiscountFailure(); + addDiscountFeeFailedCheck(discountAmount, errorMessage); + } + // ==================================== // Private Helper Methods // ==================================== @@ -1146,6 +1178,10 @@ private List fetchValuesOfWorkingCapitalLoan(final List header, : new Utils.DoubleFormatter(response.getPeriodPaymentRate().doubleValue()).format()); case "discount" -> actualValues.add( response.getDiscount() == null ? "null" : new Utils.DoubleFormatter(response.getDiscount().doubleValue()).format()); + case "discountProposed" -> actualValues.add(response.getDiscountProposed() == null ? "null" + : new Utils.DoubleFormatter(response.getDiscountProposed().doubleValue()).format()); + case "discountApproved" -> actualValues.add(response.getDiscountApproved() == null ? "null" + : new Utils.DoubleFormatter(response.getDiscountApproved().doubleValue()).format()); case "totalPaidPrincipal" -> actualValues.add(response.getBalance() == null || response.getBalance().getTotalPaidPrincipal() == null ? null : new Utils.DoubleFormatter(response.getBalance().getTotalPaidPrincipal().doubleValue()).format()); diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature index 9c8c49303ab..67fb1c67aeb 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature @@ -9,8 +9,8 @@ Feature: Working Capital Delinquency | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | WCLP | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 0 | And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 9000.0 | 0.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 9000.0 | 0.0 | 100000.0 | 18.0 | 0.0 | Then Working Capital loan status will be "SUBMITTED_AND_PENDING_APPROVAL" When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has no data on a not yet disbursed loan @@ -26,8 +26,8 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working Capital loan status will be "APPROVED" And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has no data on a not yet disbursed loan @@ -41,8 +41,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -64,8 +64,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -92,8 +92,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -121,8 +121,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -155,8 +155,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 1000.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 1000.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -188,8 +188,8 @@ Feature: Working Capital Delinquency | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" @@ -234,8 +234,8 @@ Feature: Working Capital Delinquency | WCLP | 01 December 2020 | 01 December 2020 | 1800 | 1800 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2020-12-01 | 2020-12-01 | Submitted and pending approval | 1800.0 | 0.0 | 1800.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2020-12-01 | 2020-12-01 | Submitted and pending approval | 1800.0 | 0.0 | 1800.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 December 2020" with "1800" amount and expected disbursement date on "01 December 2020" Then Admin successfully disburse the Working Capital loan on "01 December 2020" with "1800" EUR transaction amount Then Working Capital loan status will be "ACTIVE" @@ -283,8 +283,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -309,8 +309,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -350,8 +350,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -391,8 +391,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -437,8 +437,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -479,8 +479,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -527,8 +527,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -569,8 +569,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -615,8 +615,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -658,8 +658,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -704,8 +704,8 @@ Feature: Working Capital Delinquency And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature index 55870d6eba2..231ea6249f3 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature @@ -11,8 +11,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -38,8 +38,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -70,8 +70,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -102,8 +102,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -134,8 +134,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -167,8 +167,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -210,8 +210,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -273,8 +273,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -351,8 +351,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -379,8 +379,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -421,8 +421,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount @@ -458,8 +458,8 @@ Feature: Working Capital Delinquency Pause And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature index 9bbd0171376..46bc9b0ba26 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature @@ -10,8 +10,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70251 Scenario: Create Working Capital Loan account - UC2: Create loan with mandatory fields only @@ -34,8 +34,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 500.0 | 1000.0 | 2.0 | 5.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 0.0 | 1000.0 | 2.0 | 5.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 0.0 | 1000.0 | 2.0 | 5.0 | @TestRailId:C70253 Scenario: Create Working Capital Loan account - UC4: With LP overridables disabled/disallowed, loan creation will result an error when trying override values (Negative) @@ -54,8 +54,8 @@ Feature: WorkingCapitalLoanAccount | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 2.0 | 60.0 | 1 | 1 | MONTHS | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 2.0 | 60.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 2.0 | 60.0 | @TestRailId:C74479 Scenario: Create Working Capital Loan account - UC4.2: With LP overridables disabled/disallowed, loan created with discount amount from loan product level @@ -66,8 +66,8 @@ Feature: WorkingCapitalLoanAccount | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | | 1 | 30 | DAYS | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | @TestRailId:C70254 Scenario: Create Working Capital Loan account - UC5: Create with principal amount greater than WCLP max (Negative) @@ -110,14 +110,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | 80.0 | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 80.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 80.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70259 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC2: Change principal amount (higher) @@ -128,14 +128,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | 500.0 | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70260 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC3: Change submittedOnDate @@ -146,14 +146,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 20 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 15 December 2025 | | | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2025-12-15 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2025-12-15 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70279 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC3.1: Change submittedOnDate after business date results an error (Negative) @@ -164,8 +164,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 20 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Changing submittedOnDate after business date results an error: | submittedOnDate | expectedDisbursementDate | | 05 January 2026 | | @@ -179,8 +179,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 20 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Changing submittedOnDate after business date results an error: | submittedOnDate | expectedDisbursementDate | | 05 January 2026 | 25 January 2026 | @@ -194,8 +194,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Changing submittedOnDate after expectedDisbursementDate results an error: | submittedOnDate | | 05 January 2026 | @@ -209,8 +209,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 20 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | 25 January 2026 | | | | | @@ -218,8 +218,8 @@ Feature: WorkingCapitalLoanAccount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 05 January 2026 | | | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-05 | 2026-01-25 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-05 | 2026-01-25 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70263 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC6: Change submittedOnDate and expectedDisbursementDate in one call @@ -230,14 +230,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 20 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-20 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 05 January 2026 | 25 January 2026 | | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-05 | 2026-01-25 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-05 | 2026-01-25 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70264 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC7: Change multiple parameters @@ -248,14 +248,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | 15 January 2026 | 500.0 | 500.0 | 2.0 | 5.0 | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-15 | Submitted and pending approval | 500.0 | 0.0 | 500.0 | 2.0 | 5.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-15 | Submitted and pending approval | 500.0 | 0.0 | 500.0 | 2.0 | 5.0 | @TestRailId:C70265 Scenario: Modify Working Capital Loan account in Submitted and pending approval state - UC8: Modify by externalId @@ -266,14 +266,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin modifies the working capital loan by externalId with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | 15 January 2026 | 500.0 | 500.0 | 2.0 | 5.0 | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-15 | Submitted and pending approval | 500.0 | 0.0 | 500.0 | 2.0 | 5.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-15 | Submitted and pending approval | 500.0 | 0.0 | 500.0 | 2.0 | 5.0 | @TestRailId:C70266 Scenario: Delete Working Capital Loan account in Submitted and pending approval state - UC1: Delete loan account by loanId @@ -284,8 +284,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin deletes the working capital loan account Then Working capital loan account deletion was successful @@ -298,8 +298,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin deletes the working capital loan account by externalId Then Working capital loan account deletion was successful @@ -315,8 +315,8 @@ Feature: WorkingCapitalLoanAccount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | 25 January 2026 | | | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-25 | Submitted and pending approval | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-25 | Submitted and pending approval | 100.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C70269 Scenario: Modify Working Capital Loan account - UC10: Change totalPayment only @@ -330,8 +330,8 @@ Feature: WorkingCapitalLoanAccount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | | 500.0 | | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 500.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 500.0 | 1.0 | 0.0 | @TestRailId:C70270 Scenario: Modify Working Capital Loan account - UC11: Change periodPaymentRate only @@ -345,8 +345,8 @@ Feature: WorkingCapitalLoanAccount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | | | 3.0 | | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 100.0 | 3.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 100.0 | 3.0 | 0.0 | @TestRailId:C70271 Scenario: Modify Working Capital Loan account - UC12: Change discount only @@ -360,8 +360,8 @@ Feature: WorkingCapitalLoanAccount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | | | | 10.0 | Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 100.0 | 1.0 | 10.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 100.0 | 1.0 | 10.0 | @TestRailId:C70272 Scenario: Modify Working Capital Loan account - UC13: Principal exceeds product max results in an error @@ -427,8 +427,8 @@ Feature: WorkingCapitalLoanAccount | | | 500.0 | | | | Then Working capital loan modification response contains changes for "principalAmount" And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 500.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C72337 Scenario: Approve Working Capital Loan account - UC1: Approve loan in SUBMITTED AND PENDING APPROVAL state with default values @@ -439,13 +439,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C72338 Scenario: Approve Working Capital Loan account - UC2: Approve with modified principal lower than created @@ -456,13 +456,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "80" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 80.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 80.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C72339 Scenario: Approve Working Capital Loan account - UC3: Approve with principal greater than created amount results an error (negative) @@ -473,8 +473,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Approval of working capital loan on "01 January 2026" with "150" amount and expected disbursement date on "01 January 2026" results an error with the following data: | httpErrorCode | errorMessage | | 400 | amount.cannot.exceed.proposed.principal | @@ -488,13 +488,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "15 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-15 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-15 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C72341 Scenario: Approve Working Capital Loan account - UC5: Approve with past approval date results an error (negative) @@ -505,8 +505,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Approval of working capital loan on "31 December 2025" with "100" amount and expected disbursement date on "01 January 2026" results an error with the following data: | httpErrorCode | errorMessage | | 400 | cannot.be.before.submittal.date | @@ -520,13 +520,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin rejects the working capital loan on "01 January 2026" Then Working capital loan rejection was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Rejected | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Rejected | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C72343 Scenario: Approve Working Capital Loan account - UC7: Undo approval returns loan from APPROVED to SUBMITTED AND PENDING APPROVAL @@ -537,13 +537,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | When Admin makes undo approval on the working capital loan Then Working capital loan undo approval was successful And Working capital loan account has the correct data: @@ -559,23 +559,23 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | When Admin makes undo approval on the working capital loan Then Working capital loan undo approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C72345 Scenario: Approve Working Capital Loan account - UC9: Approve on working capital loan in APPROVED state results an error (negative) @@ -586,13 +586,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | And Approval of working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" results an error with the following data: | httpErrorCode | errorMessage | | 400 | Transition LOAN_APPROVED is not allowed from status APPROVED | @@ -606,13 +606,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin rejects the working capital loan on "01 January 2026" Then Working capital loan rejection was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Rejected | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Rejected | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Approval of working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" results an error with the following data: | httpErrorCode | errorMessage | | 400 | Transition LOAN_APPROVED is not allowed from status REJECTED | @@ -626,13 +626,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan by externalId on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C72367 Scenario: Approve Working Capital Loan account - UC8: Undo approval on already-disbursed loan @@ -643,8 +643,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount @@ -735,8 +735,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount @@ -752,8 +752,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal| totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal| totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin fails to disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount because of not approved @TestRailId:C72372 @@ -765,8 +765,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" @@ -810,8 +810,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 10 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-10 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-10 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin sets the business date to "05 January 2026" Then Admin successfully approves the working capital loan on "05 January 2026" with "100" amount and expected disbursement date on "10 January 2026" Then Admin fails to disburse the Working Capital loan on "" with "" EUR transaction amount with invalid data outcomes with error message @@ -852,14 +852,14 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Admin successfully undo Working Capital disbursal And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | @TestRailId:C74516 Scenario: Verify that undo disbursal of WCL account reverts all balance fields - UC5.1 @@ -876,7 +876,7 @@ Feature: WorkingCapitalLoanAccount Then Working Capital loan status will be "APPROVED" And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | totalPaidPrincipal | realizedIncome | unrealizedIncome | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 0.0 | 0.0 | 0.0 | @TestRailId:C72376 Scenario: Undo disbursal of WCL account that is submitted or approved is failed - UC6 @@ -887,8 +887,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin fails to undo disbursal the Working Capital loan due to loan status "SUBMITTED_AND_PENDING_APPROVAL" Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Admin fails to undo disbursal the Working Capital loan due to loan status "APPROVED" @@ -902,8 +902,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Admin successfully disburse the Working Capital loan by externalId on "01 January 2026" with "100" EUR transaction amount Then Working Capital disbursal transaction business event is raised with "100" amount and reversed "false" @@ -916,7 +916,7 @@ Feature: WorkingCapitalLoanAccount Then Working Capital undo disbursal transaction business event is raised with "100" amount and reversed "true" And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | @TestRailId:C74517 Scenario: Verify that WCL disbursement with classification triggers correct events on disburse and undo - UC7.1 @@ -939,7 +939,272 @@ Feature: WorkingCapitalLoanAccount Then Working Capital loan status will be "APPROVED" And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | totalPaidPrincipal | realizedIncome | unrealizedIncome | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 0.0 | 0.0 | 0.0 | + + @TestRailId:C72393 + Scenario: Discount on WCL account added after disbursement as on the same as disburse date processed successfully - UC1 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | +# --- add discount after disbursement on the same disbursement date --- # + Then Admin successfully update discount with "12" amount on Working Capital loan account + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 112.0 | 100.0 | 100.0 | 1.0 | 12.0 | + + @TestRailId:C72394 + Scenario: Discount update on WCL account on diff from disbursement date outcomes with an error - UC2 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | +# --- add discount after disbursement on diff from same disbursement date should outcome with an error --- # + When Admin sets the business date to "08 January 2026" + Then Update discount with "10" amount on Working Capital loan account failed due to date diff from disbursement date + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | + + @TestRailId:C72395 + Scenario: Discount update on WCL account on the same as disburse date failed as already added discount before while create loan - UC3 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 15 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 15.0 | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "18" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 15.0 | 14.0 | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "15" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "13" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 113.0 | 100.0 | 100.0 | 1.0 | 13.0 | + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + @TestRailId:C72396 + Scenario: Discount update on WCL account on the same as disburse date failed as already added discount before while approve loan - UC4 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 14.0 | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 114.0 | 100.0 | 100.0 | 1.0 | 14.0 | + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + @TestRailId:C72397 + Scenario: Discount update od WCL loan account on the same as disburse date failed as already added discount before while disburse loan - UC5 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "13" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 113.0 | 100.0 | 100.0 | 1.0 | 13.0 | + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + @TestRailId:C74490 + Scenario: Discount is forbidden to be added after disbursement as discount is set on loan product level with WCLP overrides disallowed - UC6 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | +# --- add discount after disbursement is forbidden due to overrides disallowed --- # + And Update discount with "20" amount on Working Capital loan account failed due to override disallowed by product + + @TestRailId:C74491 + Scenario: Discount is forbidden to be added after disbursement as NO discount is set on loan product level with WCLP overrides disallowed - UC7 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "20" discount amount due to override disallowed by product + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "20" discount amount due to override disallowed by product + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | +# --- add discount after disbursement is forbidden due to overrides disallowed --- # + And Update discount with "20" amount on Working Capital loan account failed due to override disallowed by product + + @TestRailId:C74492 + Scenario: Discount is allowed to be added after disbursement as discount is set on loan product level with WCLP overrides allowed - UC8 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | +# --- add discount with exceed discount amount is forbidden as max discount is already defined --- # + Then Add discount with "60" amount on Working Capital loan account failed due to already added discount before disbursement + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | + + @TestRailId:C74493 + Scenario: Discount is forbidden to be added after Approve with modified discount amount allowed as discount is set on loan product level with WCLP overrides allowed - UC9 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "40" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 40.0 | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | 40.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + @TestRailId:C74494 + Scenario: Discount is forbidden to be added after Disburse with modified discount amount allowed as discount is set on loan product level with WCLP overrides allowed - UC10 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "45" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | 45.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement @TestRailId:C74471 Scenario Outline: Verify WC Loan creation with invalid breachId results in error - UC1 @@ -999,8 +1264,8 @@ Feature: WorkingCapitalLoanAccount And Admin modifies the working capital loan with 3 "WEEKS" breach override data Then Verify working capital loan account has been created with correct breach override data Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C76748 Scenario: Verify WC Loan account modify with breach value from WCLP is successful - UC7 @@ -1038,8 +1303,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Modify a working capital loan with breachId will result with and error message Examples: @@ -1128,13 +1393,13 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Admin modifies the working capital loan with 70 "DAYS" breach and 4 "WEEKS" near breach override data Then Verify working capital loan account has been created with correct breach and near breach override data Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C76752 Scenario: Verify WC Loan account modify with breach and near breach values successful - UC9 @@ -1146,13 +1411,13 @@ Feature: WorkingCapitalLoanAccount Then Verify working capital loan account has been created with correct breach and near breach data Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_BREACH_NEAR_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_BREACH_NEAR_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Admin modifies the working capital loan with 1 "YEARS" breach and 10 "MONTHS" near breach override data Then Verify working capital loan account has been created with correct breach and near breach override data Then Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_BREACH_NEAR_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_BREACH_NEAR_BREACH | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | @TestRailId:C76753 Scenario: Verify WC Loan account modify with nearBreach value from WCLP level is successful - UC10 @@ -1192,8 +1457,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Admin failed to modify WC loan account with breach "" frequency lower then near breach "" frequency When Admin deletes WC Breach With Values When Admin deletes WC Near Breach With Values @@ -1218,8 +1483,8 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | And Admin failed to modify WC loan account without breach, but with near breach @TestRailId:C76757 @@ -1231,7 +1496,7 @@ Feature: WorkingCapitalLoanAccount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Modify a working capital loan with near breachId will result with an error @@ -1239,3 +1504,29 @@ Feature: WorkingCapitalLoanAccount | near_breach_id | | 0 | | 9223372036854775807 | + + @TestRailId:C74518 + Scenario: Verify that undo disbursal of WCL account set discount to null - UC5.2 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Working capital loan creation was successful + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 14.0 | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "13" discount amount + Then Working Capital loan status will be "ACTIVE" + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 113.0 | 100.0 | 100.0 | 1.0 | 13.0 | + Then Admin successfully undo Working Capital disbursal + Then Working Capital loan status will be "APPROVED" + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | totalPaidPrincipal | realizedIncome | unrealizedIncome | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 0.0 | 0.0 | 0.0 | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature index d36c7a47722..0e4922b44e6 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature @@ -11,8 +11,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -42,8 +42,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -73,8 +73,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -97,8 +97,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -121,8 +121,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -145,8 +145,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -177,8 +177,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -224,8 +224,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -271,8 +271,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -323,8 +323,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -372,8 +372,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -427,8 +427,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -475,8 +475,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -527,8 +527,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -576,8 +576,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -628,8 +628,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful @@ -704,8 +704,8 @@ Feature: Working Capital Loan Repayment And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanApiResourceSwagger.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanApiResourceSwagger.java index 9b5d28c333c..d313dd8baa6 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanApiResourceSwagger.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanApiResourceSwagger.java @@ -191,8 +191,12 @@ private GetWorkingCapitalLoansLoanIdResponse() {} @Schema(example = "30") public Integer repaymentEvery; public StringEnumOptionData repaymentFrequencyType; - @Schema(example = "0.0") + @Schema(example = "0.0", description = "Discount set during loan disbursement") public BigDecimal discount; + @Schema(example = "0.0", description = "Proposed discount at loan submission time") + public BigDecimal discountProposed; + @Schema(example = "0.0", description = "Approved discount set during loan approval") + public BigDecimal discountApproved; @Schema(description = "Working capital breach)") public WorkingCapitalLoanProductApiResourceSwagger.GetWorkingCapitalLoanProductsResponse.GetWorkingCapitalLoanBreach breach; public WorkingCapitalLoanProductApiResourceSwagger.GetWorkingCapitalLoanNearBreach nearBreach; diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/data/WorkingCapitalLoanData.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/data/WorkingCapitalLoanData.java index fc7444eff9c..76965d13beb 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/data/WorkingCapitalLoanData.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/data/WorkingCapitalLoanData.java @@ -69,6 +69,8 @@ public class WorkingCapitalLoanData implements Serializable { private Integer repaymentEvery; private StringEnumOptionData repaymentFrequencyType; private BigDecimal discount; + private BigDecimal discountProposed; + private BigDecimal discountApproved; private DelinquencyBucketData delinquencyBucket; private WorkingCapitalBreachData breach; private WorkingCapitalNearBreachData nearBreach; diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/mapper/WorkingCapitalLoanMapper.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/mapper/WorkingCapitalLoanMapper.java index 3545f918cab..8a5f2e45f4f 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/mapper/WorkingCapitalLoanMapper.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/mapper/WorkingCapitalLoanMapper.java @@ -64,6 +64,8 @@ public interface WorkingCapitalLoanMapper { @Mapping(target = "repaymentEvery", source = "loanProductRelatedDetails.repaymentEvery") @Mapping(target = "repaymentFrequencyType", source = "loanProductRelatedDetails", qualifiedByName = "repaymentFrequencyTypeData") @Mapping(target = "discount", source = "loanProductRelatedDetails.discount") + @Mapping(target = "discountProposed", source = "loanProductRelatedDetails.discountProposed") + @Mapping(target = "discountApproved", source = "loanProductRelatedDetails.discountApproved") @Mapping(target = "breach", source = "loanProductRelatedDetails.breach") @Mapping(target = "nearBreach", source = "loanProductRelatedDetails.nearBreach") @Mapping(target = "delinquencyBucket", source = "loanProductRelatedDetails.delinquencyBucket") diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java index 7c1b93bd6d2..31a1261010b 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java @@ -194,7 +194,7 @@ public void validateApproval(final String json, final WorkingCapitalLoan loan) { .failWithCode("cannot.be.before.approval.date"); } - // discountAmount must be >= 0 and <= current (creation-time) discount + // discountAmount must be >= 0 and <= proposed discount (creation-time) discount if (this.fromApiJsonHelper.parameterHasValue(WorkingCapitalLoanConstants.discountAmountParamName, element)) { if (isDiscountOverrideAllowed(loan)) { baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) @@ -206,7 +206,7 @@ public void validateApproval(final String json, final WorkingCapitalLoan loan) { .zeroOrPositiveAmount(); final BigDecimal currentDiscount = loan.getLoanProductRelatedDetails() != null - ? loan.getLoanProductRelatedDetails().getDiscount() + ? loan.getLoanProductRelatedDetails().getDiscountProposed() : null; if (discountAmount != null && currentDiscount != null && discountAmount.compareTo(currentDiscount) > 0) { baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) @@ -334,12 +334,13 @@ public void validateDisbursement(final String json, final WorkingCapitalLoan loa baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName).value(discountAmount).ignoreIfNull() .zeroOrPositiveAmount(); + // discountAmount must be >= 0 and <= approved discount (approval-time) discount final BigDecimal currentDiscount = loan.getLoanProductRelatedDetails() != null - ? loan.getLoanProductRelatedDetails().getDiscount() + ? loan.getLoanProductRelatedDetails().getDiscountApproved() : null; if (discountAmount != null && currentDiscount != null && discountAmount.compareTo(currentDiscount) > 0) { baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) - .failWithCode("amount.cannot.exceed.created.discount"); + .failWithCode("amount.cannot.exceed.approved.discount"); } } diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteService.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteService.java index 645b71c6c92..72b1fe90241 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteService.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteService.java @@ -35,4 +35,6 @@ public interface WorkingCapitalLoanAmortizationScheduleWriteService { void regenerateAmortizationScheduleOnUndoDisbursal(WorkingCapitalLoan loan); RepaymentAmortizationData applyRepayment(WorkingCapitalLoan loan, LocalDate transactionDate, BigDecimal repaymentAmount); + + BigDecimal getWorkingCapitalLoanDiscountAmount(WorkingCapitalLoan loan); } diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteServiceImpl.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteServiceImpl.java index fba56f36acd..d546ea6b75f 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteServiceImpl.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAmortizationScheduleWriteServiceImpl.java @@ -76,9 +76,7 @@ public void generateAndSaveAmortizationScheduleOnDisbursement(final WorkingCapit Validate.notNull(disbursementDate, "disbursementDate must not be null"); final MathContext mc = MoneyHelper.getMathContext(); - final BigDecimal discount = loan.getLoanProductRelatedDetails() != null && loan.getLoanProductRelatedDetails().getDiscount() != null - ? loan.getLoanProductRelatedDetails().getDiscount() - : BigDecimal.ZERO; + final BigDecimal discount = getWorkingCapitalLoanDiscountAmount(loan); final BigDecimal totalPayment = loan.getBalance() != null && loan.getBalance().getTotalPayment() != null ? loan.getBalance().getTotalPayment() : BigDecimal.ZERO; @@ -107,13 +105,26 @@ public void regenerateAmortizationScheduleOnUndoDisbursal(final WorkingCapitalLo generateAndSaveForApprovedLoanState(loan); } + @Override + public BigDecimal getWorkingCapitalLoanDiscountAmount(WorkingCapitalLoan loan) { + BigDecimal discount = BigDecimal.ZERO; + if (loan.getLoanProductRelatedDetails() != null) { + if (loan.getLoanStatus().isSubmittedAndPendingApproval() && loan.getLoanProductRelatedDetails().getDiscountProposed() != null) { + discount = loan.getLoanProductRelatedDetails().getDiscountProposed(); + } else if (loan.getLoanStatus().isApproved() && loan.getLoanProductRelatedDetails().getDiscountApproved() != null) { + discount = loan.getLoanProductRelatedDetails().getDiscountApproved(); + } else if (loan.getLoanStatus().isActive() && loan.getLoanProductRelatedDetails().getDiscount() != null) { + discount = loan.getLoanProductRelatedDetails().getDiscount(); + } + } + return discount; + } + private void generateAndSaveForApprovedLoanState(final WorkingCapitalLoan loan) { Validate.notNull(loan, "loan must not be null"); final MathContext mc = MoneyHelper.getMathContext(); - final BigDecimal discount = loan.getLoanProductRelatedDetails() != null && loan.getLoanProductRelatedDetails().getDiscount() != null - ? loan.getLoanProductRelatedDetails().getDiscount() - : BigDecimal.ZERO; + final BigDecimal discount = getWorkingCapitalLoanDiscountAmount(loan); final BigDecimal totalPayment = loan.getBalance() != null && loan.getBalance().getTotalPayment() != null ? loan.getBalance().getTotalPayment() : BigDecimal.ZERO; diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java index 17d72ac9b3e..ec39db75118 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java @@ -177,7 +177,7 @@ private WorkingCapitalLoanProductRelatedDetails buildLoanProductRelatedDetails(f : productDetail.getRepaymentFrequencyType()); detail.setAmortizationType(productDetail.getAmortizationType()); detail.setNpvDayCount(productDetail.getNpvDayCount()); - detail.setDiscount(fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.discountParamName, element) + detail.setDiscountProposed(fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.discountParamName, element) ? fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanProductConstants.discountParamName, element, new HashSet<>()) : productDetail.getDiscount()); final Long breachId = fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.breachIdParamName, element) @@ -355,7 +355,7 @@ public Map updateFrom(final JsonCommand command, final WorkingCa element, new HashSet<>()); if (command.isChangeInBigDecimalParameterNamed(WorkingCapitalLoanProductConstants.discountParamName, detail.getDiscount())) { - detail.setDiscount(discount); + detail.setDiscountProposed(discount); changes.put(WorkingCapitalLoanProductConstants.discountParamName, discount); } } diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java index 0bd1d58d562..7a425c7311b 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java @@ -71,8 +71,6 @@ import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanTransactionAllocationRepository; import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanTransactionRepository; import org.apache.fineract.portfolio.workingcapitalloan.serialization.WorkingCapitalLoanDataValidator; -import org.apache.fineract.portfolio.workingcapitalloanproduct.domain.WorkingCapitalLoanProduct; -import org.apache.fineract.portfolio.workingcapitalloanproduct.domain.WorkingCapitalLoanProductRelatedDetail; import org.apache.fineract.useradministration.domain.AppUser; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -135,13 +133,12 @@ public CommandProcessingResult approveApplication(final Long loanId, final JsonC } // Discount amount (optional, can only be reduced per requirement) + BigDecimal discount = loan.getLoanProductRelatedDetails().getDiscountProposed(); if (command.parameterExists(WorkingCapitalLoanConstants.discountAmountParamName)) { - final BigDecimal discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, + discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, command.parsedJson(), new HashSet<>()); - if (discount != null) { - loan.getLoanProductRelatedDetails().setDiscount(discount); - } } + loan.getLoanProductRelatedDetails().setDiscountApproved(discount); // Keep first tranche expected amount aligned with approved principal (submit stores proposed principal only). if (!loan.getDisbursementDetails().isEmpty()) { @@ -188,9 +185,7 @@ public CommandProcessingResult undoApplicationApproval(final Long loanId, final // Note: if discount was customized at submission time, it resets to product default, // not the submission-time value, because we don't store a pre-approval snapshot. // The loan is back in SUBMITTED state and can be modified. - final WorkingCapitalLoanProduct product = loan.getLoanProduct(); - final WorkingCapitalLoanProductRelatedDetail productDetail = product.getRelatedDetail(); - loan.getLoanProductRelatedDetails().setDiscount(productDetail.getDiscount()); + loan.getLoanProductRelatedDetails().setDiscountApproved(null); this.loanRepository.saveAndFlush(loan); @@ -288,13 +283,16 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand loan.getDisbursementDetails().getFirst().setDisbursedBy(currentUser); } + BigDecimal discount = loan.getLoanProductRelatedDetails().getDiscountApproved(); if (command.parameterExists(WorkingCapitalLoanConstants.discountAmountParamName)) { - final BigDecimal discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, + discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, command.parsedJson(), new HashSet<>()); if (discount != null) { loan.getLoanProductRelatedDetails().setDiscount(discount); changes.put(WorkingCapitalLoanConstants.discountAmountParamName, discount); } + } else { + loan.getLoanProductRelatedDetails().setDiscount(discount); } final ExternalId txnExternalId = this.externalIdFactory.createFromCommand(command, @@ -309,14 +307,6 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand .forPrincipalAllocation(disbursementTransaction, transactionAmount); this.allocationRepository.saveAndFlush(allocation); - BigDecimal discount = command.parameterExists(WorkingCapitalLoanConstants.discountAmountParamName) - ? this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, command.parsedJson(), - new HashSet<>()) - : null; - if (discount == null && loan.getLoanProductRelatedDetails().getDiscount() != null) { - discount = loan.getLoanProductRelatedDetails().getDiscount(); - } - Long discountTransactionId = null; ExternalId discountTxnExternalId = null; @@ -382,6 +372,7 @@ public CommandProcessingResult undoDisbursal(final Long loanId, final JsonComman } } } + loan.getLoanProductRelatedDetails().setDiscount(null); amortizationScheduleWriteService.regenerateAmortizationScheduleOnUndoDisbursal(loan); this.loanRepository.saveAndFlush(loan); diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloanproduct/domain/WorkingCapitalLoanProductRelatedDetails.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloanproduct/domain/WorkingCapitalLoanProductRelatedDetails.java index d5e89c09e46..d8a693ffe60 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloanproduct/domain/WorkingCapitalLoanProductRelatedDetails.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloanproduct/domain/WorkingCapitalLoanProductRelatedDetails.java @@ -71,6 +71,12 @@ public class WorkingCapitalLoanProductRelatedDetails { @Column(name = "discount", scale = 6, precision = 19) private BigDecimal discount; + @Column(name = "discount_proposed", scale = 6, precision = 19) + private BigDecimal discountProposed; + + @Column(name = "discount_approved", scale = 6, precision = 19) + private BigDecimal discountApproved; + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "delinquency_bucket_classification_id") private DelinquencyBucket delinquencyBucket; diff --git a/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/module-changelog-master.xml b/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/module-changelog-master.xml index 5f7971fa2f1..43d6edf90be 100644 --- a/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/module-changelog-master.xml +++ b/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/module-changelog-master.xml @@ -56,4 +56,5 @@ + diff --git a/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0035_wc_loan_discount_proposed_approved.xml b/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0035_wc_loan_discount_proposed_approved.xml new file mode 100644 index 00000000000..790d983ee93 --- /dev/null +++ b/fineract-working-capital-loan/src/main/resources/db/changelog/tenant/module/workingcapitalloan/parts/0035_wc_loan_discount_proposed_approved.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java index 82ef2158370..0507e464104 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.ResponseSpecBuilder; @@ -49,6 +50,7 @@ import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler; import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanApplicationTestBuilder; +import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanDisbursementTestBuilder; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanHelper; import org.apache.fineract.integrationtests.common.workingcapitalloanbreach.WorkingCapitalBreachHelper; import org.apache.fineract.integrationtests.common.workingcapitalloannearbreach.WorkingCapitalNearBreachHelper; @@ -137,7 +139,7 @@ public void testSubmitWithoutOverridableParamsUsesProductDefaults() { assertEquals(productRepaymentEvery.intValue(), data.get("repaymentEvery").getAsInt(), "repaymentEvery should come from product"); assertRepaymentFrequencyTypeEquals(productRepaymentFrequencyType, data.get("repaymentFrequencyType")); - assertEqualBigDecimal(productDiscount, data.get("discount")); + assertEqualBigDecimal(productDiscount, data.get("discountProposed")); assertTrue(data.has("delinquencyBucket") && !data.get("delinquencyBucket").isJsonNull(), "delinquencyBucket should come from product"); assertEquals(delinquencyBucketId.longValue(), data.getAsJsonObject("delinquencyBucket").get("id").getAsLong(), @@ -852,11 +854,92 @@ public void testDeleteByExternalId() { productHelper.deleteWorkingCapitalLoanProductById(productId); } + @Test + public void testWorkingCapitalDiscountAttributes() { + final Long productId = createProductWithAllOverridables(); + final Long clientId = createClient(); + BigDecimal discountProposed = BigDecimal.valueOf(100); + final Long loanId = applicationHelper.submit(new WorkingCapitalLoanApplicationTestBuilder() // + .withClientId(clientId) // + .withProductId(productId) // + .withPrincipal(BigDecimal.valueOf(5000)) // + .withPeriodPaymentRate(BigDecimal.ONE) // + .withTotalPayment(BigDecimal.valueOf(5500)) // + .withDiscount(discountProposed) // + .buildSubmitJson()); + + JsonObject loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + final LocalDate operationDate = applicationHelper.extractDate(loanData.get("submittedOnDate")); + + discountProposed = BigDecimal.valueOf(99); + final String modifyJson = new WorkingCapitalLoanApplicationTestBuilder().withDiscount(discountProposed) // + .buildModifyJson(); + + final Long modifiedId = applicationHelper.modifyById(loanId, modifyJson); + assertEquals(loanId, modifiedId); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + + // Approve the WC Loan with specific discount + BigDecimal discountApproved = BigDecimal.valueOf(97); + applicationHelper.approveById(loanId, + WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(operationDate, null, discountApproved)); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); + + // Undo WC Loan Approval + applicationHelper.undoApprovalById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildUndoApproveJson()); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + // Null as reset of Approval amount + assertEquals(JsonNull.INSTANCE, loanData.get("discountApproved")); + + // ReApprove the WC Loan with specific discount + discountApproved = BigDecimal.valueOf(95); + applicationHelper.approveById(loanId, + WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(operationDate, null, discountApproved)); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); + + // Disburse the WC Loan without specific discount then It will use discountApproved + applicationHelper.disburseById(loanId, + WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(operationDate, BigDecimal.valueOf(5000))); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); + assertEqualBigDecimal(discountApproved, loanData.get("discount")); + + // Undo Disburse the WC Loan + applicationHelper.undoDisbursalById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildUndoDisburseJson("Undo disbursal note")); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); + assertEquals(JsonNull.INSTANCE, loanData.get("discount")); + + // ReDisburse the WC Loan with specific discount + BigDecimal discountDisbursement = BigDecimal.valueOf(80); + applicationHelper.disburseById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(operationDate, + BigDecimal.valueOf(5000), discountDisbursement, null, null, null, null, null, null, null)); + loanData = applicationHelper.retrieveLoan(loanId); + assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); + assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); + assertEqualBigDecimal(discountDisbursement, loanData.get("discount")); + + // Undo Disbursement for delete it + applicationHelper.undoDisbursalById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildUndoDisburseJson("Undo disbursal note")); + applicationHelper.undoApprovalById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildUndoApproveJson()); + applicationHelper.deleteById(loanId); + productHelper.deleteWorkingCapitalLoanProductById(productId); + } + private static void assertAllLoanFieldsInResponse(final JsonObject data, final long loanId, final long clientId, final long productId, final String accountNo, final String externalId, final Long fundId, final BigDecimal principal, - final BigDecimal periodPaymentRate, final BigDecimal totalPayment, final BigDecimal discount, final LocalDate submittedOnDate, - final LocalDate expectedDisbursementDate, final Integer repaymentEvery, final String repaymentFrequencyType, - final Integer delinquencyGraceDays, final String delinquencyStartType) { + final BigDecimal periodPaymentRate, final BigDecimal totalPayment, final BigDecimal discountProposed, + final LocalDate submittedOnDate, final LocalDate expectedDisbursementDate, final Integer repaymentEvery, + final String repaymentFrequencyType, final Integer delinquencyGraceDays, final String delinquencyStartType) { assertEquals(loanId, data.get("id").getAsLong()); assertTrue(data.has("client") && !data.get("client").isJsonNull()); assertEquals(clientId, data.getAsJsonObject("client").get("id").getAsLong()); @@ -871,7 +954,7 @@ private static void assertAllLoanFieldsInResponse(final JsonObject data, final l assertEqualBigDecimal(principal, data.getAsJsonObject("balance").get("principalOutstanding")); assertEqualBigDecimal(totalPayment, data.getAsJsonObject("balance").get("totalPayment")); assertEqualBigDecimal(periodPaymentRate, data.get("periodPaymentRate")); - assertEqualBigDecimal(discount, data.get("discount")); + assertEqualBigDecimal(discountProposed, data.get("discountProposed")); assertDateEquals(submittedOnDate, data.get("submittedOnDate")); assertTrue(data.has("disbursementDetails") && !data.get("disbursementDetails").isJsonNull(), "disbursementDetails should be present"); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApprovalRejectionTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApprovalRejectionTest.java index ed7f5b816ea..e0fe209c79f 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApprovalRejectionTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApprovalRejectionTest.java @@ -23,12 +23,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.gson.Gson; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import io.restassured.builder.RequestSpecBuilder; -import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.ContentType; import io.restassured.specification.RequestSpecification; -import io.restassured.specification.ResponseSpecification; import java.math.BigDecimal; import java.time.LocalDate; import java.time.ZoneId; @@ -37,8 +36,6 @@ import org.apache.fineract.client.feign.util.CallFailedRuntimeException; import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.Utils; -import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler; -import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanApplicationTestBuilder; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanHelper; import org.apache.fineract.integrationtests.common.workingcapitalloanproduct.WorkingCapitalLoanProductHelper; @@ -49,9 +46,6 @@ public class WorkingCapitalLoanApprovalRejectionTest { private static RequestSpecification requestSpec; - private static ResponseSpecification responseSpec; - private static Long delinquencyBucketId; - private static Long fundId; private final WorkingCapitalLoanHelper applicationHelper = new WorkingCapitalLoanHelper(); private final WorkingCapitalLoanProductHelper productHelper = new WorkingCapitalLoanProductHelper(); @@ -62,9 +56,6 @@ static void init() { requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build(); requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey()); requestSpec.header("Fineract-Platform-TenantId", "default"); - responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build(); - delinquencyBucketId = DelinquencyBucketsHelper.createDefaultBucket(); - fundId = (long) FundsResourceHandler.createFund(requestSpec, responseSpec); } // ===== AC: User should be able to approve the created loan account (via API) ===== @@ -112,7 +103,9 @@ public void testApproveWithPrincipalAndDiscountOverride() { final JsonObject data = retrieveLoan(loanId); assertEquals("loanStatusType.approved", data.getAsJsonObject("status").get("code").getAsString()); assertEqualBigDecimal(approvedAmount, data.get("approvedPrincipal")); - assertEqualBigDecimal(discountAmount, data.get("discount")); + assertEqualBigDecimal(BigDecimal.valueOf(100), data.get("discountProposed")); + assertEqualBigDecimal(discountAmount, data.get("discountApproved")); + assertEquals(JsonNull.INSTANCE, data.get("discount")); } @Test @@ -169,7 +162,9 @@ public void testUndoApprovalResetsToCreatedState() { final JsonObject approvedData = retrieveLoan(loanId); assertEqualBigDecimal(BigDecimal.valueOf(3000), approvedData.get("approvedPrincipal")); - assertEqualBigDecimal(BigDecimal.valueOf(50), approvedData.get("discount")); + assertEqualBigDecimal(BigDecimal.valueOf(100), approvedData.get("discountProposed")); + assertEqualBigDecimal(BigDecimal.valueOf(50), approvedData.get("discountApproved")); + assertEquals(JsonNull.INSTANCE, approvedData.get("discount")); // Undo approval applicationHelper.undoApprovalById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildUndoApproveJson()); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/workingcapitalloan/WorkingCapitalLoanHelper.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/workingcapitalloan/WorkingCapitalLoanHelper.java index d493d9fda03..54251770102 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/workingcapitalloan/WorkingCapitalLoanHelper.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/workingcapitalloan/WorkingCapitalLoanHelper.java @@ -18,9 +18,16 @@ */ package org.apache.fineract.integrationtests.common.workingcapitalloan; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.time.LocalDate; import java.util.Map; import org.apache.fineract.client.feign.ObjectMapperFactory; import org.apache.fineract.client.feign.services.WorkingCapitalLoanTransactionsApi; @@ -272,4 +279,25 @@ private static String toJson(Object value) { throw new IllegalArgumentException("Failed to serialize response", e); } } + + public JsonObject retrieveLoan(final Long loanId) { + final String response = retrieveById(loanId); + assertNotNull(response); + return new Gson().fromJson(response, JsonObject.class); + } + + public LocalDate getSubmittedOnDate(final Long loanId) { + final JsonObject data = retrieveLoan(loanId); + return extractDate(data.get("submittedOnDate")); + } + + public LocalDate extractDate(final JsonElement element) { + assertNotNull(element, "Expected date element"); + if (element.isJsonArray()) { + final JsonArray arr = element.getAsJsonArray(); + return LocalDate.of(arr.get(0).getAsInt(), arr.get(1).getAsInt(), arr.get(2).getAsInt()); + } + return LocalDate.parse(element.getAsString()); + } + } From 81a2bb608df210aa950e5e8869a0217459cd955c Mon Sep 17 00:00:00 2001 From: Rustam Zeinalov Date: Thu, 7 May 2026 13:01:25 +0200 Subject: [PATCH 2/2] FINERACT-2455: Added e2e tests for verifying Working Capital loan discount field enhancement --- .../test/helper/ErrorMessageHelper.java | 4 + .../WorkingCapitalLoanAccountStepDef.java | 28 +- .../WorkingCapitalBreachSchedule.feature | 4 +- .../WorkingCapitalDelinquency.feature | 72 +- .../WorkingCapitalDelinquencyPause.feature | 48 +- .../features/WorkingCapitalDiscount.feature | 780 ++++++++++++++++-- .../WorkingCapitalLoanAccount.feature | 66 +- .../WorkingCapitalLoanRepayment.feature | 70 +- ...WorkingCapitalNearBreachEvaluation.feature | 2 +- .../WorkingCapitalLoanDataValidator.java | 47 +- .../WorkingCapitalLoanAssemblerImpl.java | 2 +- ...ngCapitalLoanWritePlatformServiceImpl.java | 10 +- ...WorkingCapitalLoanApplicationCRUDTest.java | 9 +- ...linquencyRangeScheduleIntegrationTest.java | 3 +- .../WorkingCapitalLoanRepaymentTest.java | 36 +- 15 files changed, 926 insertions(+), 255 deletions(-) diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java index 9d1faec00d9..ed8110d41b1 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/helper/ErrorMessageHelper.java @@ -1110,6 +1110,10 @@ public static String discountExceedCreatedDiscountFailure() { return "Failed data validation due to: amount.cannot.exceed.created.discount."; } + public static String discountExceedProductDiscountFailure() { + return "Failed data validation due to: amount.cannot.exceed.product.discount."; + } + public static String nearBreachCannotEnableWithoutBreachFailure() { return "Failed data validation due to: cannot.enable.near.breach.without.breach."; } diff --git a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java index d93f1b65343..d077e05eb34 100644 --- a/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java +++ b/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java @@ -651,6 +651,23 @@ public void approvalOfWorkingCapitalLoanResultsAnError(final String approveDate, log.info("Verified working capital loan approval failed with expected error"); } + @When("Admin failed to approve the working capital loan on {string} with {string} amount and expected disbursement date on {string} with {string} exceeded product discount amount") + public void approveWorkingCapitalLoanWithExceededProductDiscountFailure(final String approveDate, final String approvedAmount, + final String expectedDisbursementDate, final String discountAmount) { + final PostWorkingCapitalLoansLoanIdRequest approveRequest = workingCapitalLoanRequestFactory + .defaultWorkingCapitalLoanApproveRequest()// + .approvedOnDate(approveDate)// + .approvedLoanAmount(new BigDecimal(approvedAmount))// + .discountAmount(new BigDecimal(discountAmount))// + .expectedDisbursementDate(expectedDisbursementDate);// + + final CallFailedRuntimeException exception = fail(() -> fineractClient.workingCapitalLoans() + .stateTransitionWorkingCapitalLoanById(getCreatedLoanId(), "approve", approveRequest)); + + assertThat(exception.getStatus()).as(ErrorMessageHelper.discountExceedProductDiscountFailure()).isEqualTo(400); + assertThat(exception.getDeveloperMessage()).contains(ErrorMessageHelper.discountExceedProductDiscountFailure()); + } + @When("Admin failed to approve the working capital loan on {string} with {string} amount and expected disbursement date on {string} with {string} exceeded discount amount") public void approveWorkingCapitalLoanWithExceededDiscountFailure(final String approveDate, final String approvedAmount, final String expectedDisbursementDate, final String discountAmount) { @@ -822,6 +839,13 @@ public void disburseWorkingCapitalLoanWithExceededDiscountFailure(String actualD disburseWorkingCapitalLoanFailure(actualDisbursementDate, transactionAmount, discountAmount, errorMessage); } + @When("Admin failed to disburse the working capital loan on {string} with {string} amount with {string} exceeded product discount amount") + public void disburseWorkingCapitalLoanWithExceededProductDiscountFailure(String actualDisbursementDate, String transactionAmount, + String discountAmount) { + String errorMessage = ErrorMessageHelper.discountExceedProductDiscountFailure(); + disburseWorkingCapitalLoanFailure(actualDisbursementDate, transactionAmount, discountAmount, errorMessage); + } + @When("Admin failed to disburse the working capital loan on {string} with {string} amount with {string} discount amount due to override disallowed by product") public void disburseWorkingCapitalLoanWithDiscountOverrideDisallowedFailure(final String actualDisbursementDate, final String transactionAmount, final String discountAmount) { @@ -1024,8 +1048,8 @@ public void updateDiscountWithAmountOnWorkingCapitalLoanAccountFailedDueToOverri } @Then("Update discount with {string} amount on Working Capital loan account failed due to exceed discount amount") - public void update_discount_with_amount_on_working_capital_loan_account_failed_due_to_exceed_discount_amount(String discountAmount) { - String errorMessage = ErrorMessageHelper.discountExceedCreatedDiscountFailure(); + public void updateDiscountWithAmountOnWorkingCapitalLoanAccountFailedDueToExceedDiscountAmount(String discountAmount) { + String errorMessage = ErrorMessageHelper.discountExceedProductDiscountFailure(); addDiscountFeeFailedCheck(discountAmount, errorMessage); } diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalBreachSchedule.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalBreachSchedule.feature index 408fbb76826..1a650d7b4bc 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalBreachSchedule.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalBreachSchedule.feature @@ -106,7 +106,7 @@ Feature: Working Capital Breach Schedule | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 1000 | And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" - When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount + When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount and "1000" discount amount And Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan breach schedule has the following data: | periodNumber | fromDate | toDate | numberOfDays | minPaymentAmount | outstandingAmount | nearBreach | breach | @@ -123,7 +123,7 @@ Feature: Working Capital Breach Schedule | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 1000 | And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" - When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount + When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount and "1000" discount amount And Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan breach schedule has the following data: | periodNumber | fromDate | toDate | numberOfDays | minPaymentAmount | outstandingAmount | nearBreach | breach | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature index 67fb1c67aeb..985972b92f1 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquency.feature @@ -27,7 +27,7 @@ Feature: Working Capital Delinquency And Working Capital loan status will be "APPROVED" And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has no data on a not yet disbursed loan @@ -42,13 +42,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -65,13 +65,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -93,13 +93,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -122,13 +122,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -151,13 +151,13 @@ Feature: Working Capital Delinquency And Admin creates a client with random data And Admin creates a working capital loan with the following data: | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | - | WCLP | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 1000 | - And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026" + | WCLP | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 1000 | + And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and "1000" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 1000.0 | - When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount + When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount and "1000" discount amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: @@ -196,7 +196,7 @@ Feature: Working Capital Delinquency Then Verify Working Capital loan disbursement was successful on "01 January 2026" with "100" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | # --- No delinquency tag history --- When Admin sets the business date to "02 January 2026" And Admin runs inline COB job for Working Capital Loan @@ -242,7 +242,7 @@ Feature: Working Capital Delinquency Then Verify Working Capital loan disbursement was successful on "01 December 2020" with "1800" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2020-12-01 | 2020-12-01 | Active | 1800.0 | 1800.0 | 1800.0 | 1.0 | 0.0 | + | WCLP | 2020-12-01 | 2020-12-01 | Active | 1800.0 | 1800.0 | 1800.0 | 1.0 | null | When Admin sets the business date to "02 December 2020" And Admin runs inline COB job for Working Capital Loan # --- No delinquency tag history --- @@ -284,13 +284,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId When Admin makes Internal Payment "270.0" on "2026-01-01" Then Working Capital loan delinquency range schedule has the following data: @@ -310,13 +310,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -351,13 +351,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -392,13 +392,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -438,13 +438,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -480,13 +480,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -528,13 +528,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -570,13 +570,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -616,13 +616,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -659,13 +659,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -705,13 +705,13 @@ Feature: Working Capital Delinquency Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature index 231ea6249f3..83d9a25cc6f 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDelinquencyPause.feature @@ -12,13 +12,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId And Admin initiate a Working Capital loan delinquency pause with startDate "01 January 2026" and endDate "15 January 2026" Then Working Capital loan delinquency action has the following data: @@ -39,13 +39,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -71,13 +71,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -103,13 +103,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -135,13 +135,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -168,13 +168,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -211,13 +211,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -274,13 +274,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -352,13 +352,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -380,13 +380,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -422,13 +422,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -459,13 +459,13 @@ Feature: Working Capital Delinquency Pause Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful on "01 January 2026" with "9000" EUR transaction amount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDiscount.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDiscount.feature index 17fdd32c20e..755cd377124 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDiscount.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalDiscount.feature @@ -80,14 +80,14 @@ Feature: Working Capital Discount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 15 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 15.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 15.0 | Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "18" exceeded discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 14.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 15.0 | 14.0 | Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "15" exceeded discount amount Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "13" discount amount Then Working Capital loan status will be "ACTIVE" @@ -120,21 +120,21 @@ Feature: Working Capital Discount | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | | | | 15.0 | And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 15.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 15.0 | Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "18" exceeded discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 14.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 15.0 | 14.0 | Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "15" exceeded discount amount Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "13" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 113.0 | 100.0 | 100.0 | 1.0 | 13.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 113.0 | 100.0 | 100.0 | 1.0 | 15.0 | 14.0 | 13.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | @@ -154,19 +154,19 @@ Feature: Working Capital Discount | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "14" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 14.0 | - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 14.0 | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "14" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 114.0 | 100.0 | 100.0 | 1.0 | 14.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 114.0 | 100.0 | 100.0 | 1.0 | null | 14.0 | 14.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | @@ -218,31 +218,29 @@ Feature: Working Capital Discount | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "20" discount amount due to override disallowed by product Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "15" discount amount due to override disallowed by product Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | - | 01 January 2026 | Discount Fee | 50.0 | 50.0 | 0.0 | 0.0 | false | # --- add discount after disbursement is forbidden due to overrides disallowed --- # And Add Discount fee with "20" amount on Working Capital loan account failed due to override disallowed by product And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | - | 01 January 2026 | Discount Fee | 50.0 | 50.0 | 0.0 | 0.0 | false | @TestRailId:C74492 Scenario: Discount is forbidden to be added after disbursement as NO discount is set on loan product level with WCLP overrides disallowed - UC8 @@ -286,19 +284,19 @@ Feature: Working Capital Discount | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "50" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | null | null | 50.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100 | 100 | 0 | 0 | false | @@ -316,11 +314,11 @@ Feature: Working Capital Discount And Admin creates a client with random data And Admin creates a working capital loan with the following data: | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | When Admin modifies the working capital loan with the following data: | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | | | | | | 55.0 | @@ -328,25 +326,25 @@ Feature: Working Capital Discount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 55.0 | - Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded discount amount - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 55.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded product discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "50" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 155.0 | 100.0 | 100.0 | 1.0 | 55.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 55.0 | null | 50.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | - | 01 January 2026 | Discount Fee | 55.0 | 55.0 | 0 | 0 | false | + | 01 January 2026 | Discount Fee | 50.0 | 50.0 | 0 | 0 | false | # --- add discount after disbursement is forbidden as discount is already added and updated on disbursement --- # Then Add Discount fee with "10" amount on Working Capital loan account failed due to already added discount before disbursement And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | - | 01 January 2026 | Discount Fee | 55.0 | 55.0 | 0 | 0 | false | + | 01 January 2026 | Discount Fee | 50.0 | 50.0 | 0 | 0 | false | @TestRailId:C78836 Scenario: Discount is forbidden to be added after Approve with modified discount amount allowed as discount is set on loan product level with WCLP overrides allowed - UC11 @@ -357,21 +355,21 @@ Feature: Working Capital Discount | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | - Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "40" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 40.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "40" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | 40.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | 40.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | @@ -392,21 +390,21 @@ Feature: Working Capital Discount | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | - Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | - Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded discount amount + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded product discount amount Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "45" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | 45.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | null | null | 45.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | @@ -427,19 +425,19 @@ Feature: Working Capital Discount | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | null | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100 | 100 | 0 | 0 | false | @@ -459,19 +457,19 @@ Feature: Working Capital Discount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 0.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 0.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | null | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | @@ -482,8 +480,8 @@ Feature: Working Capital Discount | 01 January 2026 | Discount Fee | 10.0 | 10.0 | 0.0 | 0.0 | false | And Admin successfully undo Working Capital disbursal by externalId And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 10.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | null | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | true | @@ -498,28 +496,648 @@ Feature: Working Capital Discount | WCLP | 01 January 2026 | 01 January 2026 | 100.0 | 100.0 | 1.0 | 22.0 | Then Working capital loan creation was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 22.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 22.0 | When Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 22.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 22.0 | null | Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "11" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 111.0 | 100.0 | 100.0 | 1.0 | 11.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 111.0 | 100.0 | 100.0 | 1.0 | 22.0 | null | 11.0 | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | false | | 01 January 2026 | Discount Fee | 11.0 | 11.0 | 0.0 | 0.0 | false | And Admin successfully undo Working Capital disbursal by externalId And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 11.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 22.0 | null | null | And Working Capital Loan has transactions: | transactionDate | type | transactionAmount | principalPortion | feeChargesPortion | penaltyChargesPortion | reversed | | 01 January 2026 | Disbursement | 100.0 | 100.0 | 0.0 | 0.0 | true | | 01 January 2026 | Discount Fee | 11.0 | 11.0 | 0.0 | 0.0 | true | + + @TestRailId:C78854 + Scenario: Discount on Working Capital Loan account added while create WCP, updated while approve loan and check after updo approval - UC1 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 18 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "19" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | null | null | + + @TestRailId:C78855 + Scenario: Discount on Working Capital Loan account added while create WCP, updated while approve/disburse loan and check after undo approval/disbursal - UC2 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 18 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "19" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "16" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 116.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | 16.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "19" exceeded discount amount + + @TestRailId:C78856 + Scenario: Discount on Working Capital Loan account added while create WCP, updated while modify/approve loan and check after updo approval - UC1.1 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 18 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + When Admin modifies the working capital loan with the following data: + | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | | | | | | 19.0 | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 19.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 19.0 | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 19.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "20" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 19.0 | null | null | + + @TestRailId:C78857 + Scenario: Discount on Working Capital Loan account added while modify WCP, updated while approve/disburse loan and check after undo approval/disbursal - UC2.2 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + When Admin modifies the working capital loan with the following data: + | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | | | | | | 18.0 | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "19" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "16" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 116.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | 16.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "19" exceeded discount amount + + @TestRailId:C78858 + Scenario: Discount on Working Capital Loan account added while approve WCP and check after updo approval - UC3 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "15" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 15.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "19" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 19.0 | null | + + @TestRailId:C78859 + Scenario: Discount on Working Capital Loan account added while approve, updated on disbursal and check after updo disbursal/approval with additional update while approve and check after undo disbursal - UC4 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "19" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "16" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 116.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | 16.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "19" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 19.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "20" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "19" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 119.0 | 100.0 | 100.0 | 1.0 | null | 19.0 | 19.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 19.0 | null | + + @TestRailId:C78860 + Scenario: Discount on Working Capital Loan account added while approve, updated on disbursal and check after updo disbursal/approval with additional update while modify and check after undo disbursal - UC4.1 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "17" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "19" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "16" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 116.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | 16.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 17.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + When Admin modifies the working capital loan with the following data: + | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | | | | | | 20.0 | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 20.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "20" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 20.0 | 20.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "21" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "18" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 118.0 | 100.0 | 100.0 | 1.0 | 20.0 | 20.0 | 18.0 | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 20.0 | 20.0 | null | + + @TestRailId:C78861 + Scenario: Discount on Working Capital Loan account added while update discount and check after undo disbursal/approval - UC5 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | +# --- update discount after disbursement on the same disbursement date --- # + Then Admin successfully update discount with "12" amount on Working Capital loan account + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 112.0 | 100.0 | 100.0 | 1.0 | null | null | 12.0 | + Then Admin successfully undo Working Capital disbursal +#TODO - what value shall be after undo disbursal - from update discount request(12) or the latest one for approval(null)? - NULL + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + + @TestRailId:C78862 + Scenario: Discount on Working Capital Loan account added while create loan, updated on disbursal and check after undo disbursal with additional disburse - UC6 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 18 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 18.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "18" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 18.0 | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 18.0 | null | + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 18.0 | 18.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "19" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "17" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 117.0 | 100.0 | 100.0 | 1.0 | 18.0 | 18.0 | 17.0 | + + @TestRailId:C78863 + Scenario: Discount on Working Capital Loan account with NO discount is set on loan product level with WCLP overrides disallowed after undo approval/disbursal - UC7 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "20" discount amount due to override disallowed by product + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "20" discount amount due to override disallowed by product + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + + @TestRailId:C78864 + Scenario: Discount on Working Capital Loan account added after disbursement with discount set on loan product level and WCLP overrides allowed after undo approval/disbursal - UC8 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | +# --- add discount with exceed discount amount is forbidden as loan discount is null but It exceeds product discount value --- # + Then Update discount with "60" amount on Working Capital loan account failed due to exceed discount amount +# --- add discount after disbursement on the same disbursement date --- # + Then Admin successfully update discount with "12" amount on Working Capital loan account + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 112.0 | 100.0 | 100.0 | 1.0 | null | null | 12.0 | + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + + @TestRailId:C78865 + Scenario: Discount on Working Capital Loan account added on create loan account with modified discount amount while discount set on loan product level and WCLP overrides allowed after undo disbursal/approve - UC9.1 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | 48.0 | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 48.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "40" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 48.0 | 40.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "40" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | 48.0 | 40.0 | 40.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 48.0 | 40.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 48.0 | null | null | + + When Admin modifies the working capital loan with the following data: + | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | | | | | | 49.0 | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 49.0 | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 49.0 | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 49.0 | null | null | + + @TestRailId:C78866 + Scenario: Discount on Working Capital Loan account added on modify loan account with modified discount amount with discount set on loan product level and WCLP overrides allowed after undo disbursal/approve - UC9.2 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + When Admin modifies the working capital loan with the following data: + | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | | | | | | 30.0 | + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 30.0 | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "20" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 30.0 | 20.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "20" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 120.0 | 100.0 | 100.0 | 1.0 | 30.0 | 20.0 | 20.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 30.0 | 20.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 30.0 | null | null | + + @TestRailId:C78867 + Scenario: Discount on Working Capital Loan account added on Approve with modified discount amount with discount set on loan product level and WCLP overrides allowed after undo disbursal/approve - UC9 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "40" discount amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "40" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | 40.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + + @TestRailId:C78868 + Scenario: Discount on Working Capital Loan account added on Disburse with modified discount amount while discount is set on loan product level with WCLP overrides allowed after undo disbursal/approval - UC10 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded product discount amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "45" discount amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | null | null | 45.0 | +# --- add discount after disbursement is forbidden as discount is already added --- # + Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + + @TestRailId:C78869 + Scenario: Discount on Working Capital Loan account added after disbursement while discount is set on loan product level with WCLP overrides disallowed after undo disbursal/approval - UC6 + When Admin sets the business date to "01 January 2026" + And Admin creates a client with random data + And Admin creates a working capital loan with the following data: + | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 01 January 2026 | 01 January 2026 | 100 | 100 | 1 | | + Then Working capital loan creation was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" + Then Working capital loan approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Working Capital loan status will be "ACTIVE" + Then Verify Working Capital loan disbursement was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | +# --- add discount after disbursement is forbidden due to overrides disallowed --- # + And Update discount with "20" amount on Working Capital loan account failed due to override disallowed by product + + Then Admin successfully undo Working Capital disbursal + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | null | + When Admin makes undo approval on the working capital loan + Then Working capital loan undo approval was successful + And Working capital loan account has the correct data: + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | null | null | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature index 46bc9b0ba26..afb21bec590 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanAccount.feature @@ -67,7 +67,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan creation was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | @TestRailId:C70254 Scenario: Create Working Capital Loan account - UC5: Create with principal amount greater than WCLP max (Negative) @@ -445,7 +445,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C72338 Scenario: Approve Working Capital Loan account - UC2: Approve with modified principal lower than created @@ -462,7 +462,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 80.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 80.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C72339 Scenario: Approve Working Capital Loan account - UC3: Approve with principal greater than created amount results an error (negative) @@ -494,7 +494,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-15 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-15 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C72341 Scenario: Approve Working Capital Loan account - UC5: Approve with past approval date results an error (negative) @@ -543,7 +543,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | When Admin makes undo approval on the working capital loan Then Working capital loan undo approval was successful And Working capital loan account has the correct data: @@ -565,7 +565,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | When Admin makes undo approval on the working capital loan Then Working capital loan undo approval was successful And Working capital loan account has the correct data: @@ -575,7 +575,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C72345 Scenario: Approve Working Capital Loan account - UC9: Approve on working capital loan in APPROVED state results an error (negative) @@ -592,7 +592,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | And Approval of working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" results an error with the following data: | httpErrorCode | errorMessage | | 400 | Transition LOAN_APPROVED is not allowed from status APPROVED | @@ -632,7 +632,7 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C72367 Scenario: Approve Working Capital Loan account - UC8: Undo approval on already-disbursed loan @@ -773,7 +773,7 @@ Feature: WorkingCapitalLoanAccount Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | @TestRailId:C74514 Scenario: Disburse WCL loan account with classification use case - UC2.1 @@ -859,7 +859,7 @@ Feature: WorkingCapitalLoanAccount Then Admin successfully undo Working Capital disbursal And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | null | @TestRailId:C74516 Scenario: Verify that undo disbursal of WCL account reverts all balance fields - UC5.1 @@ -911,7 +911,7 @@ Feature: WorkingCapitalLoanAccount Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | Then Admin successfully undo Working Capital disbursal by externalId Then Working Capital undo disbursal transaction business event is raised with "100" amount and reversed "true" And Working capital loan account has the correct data: @@ -933,7 +933,7 @@ Feature: WorkingCapitalLoanAccount Then Working Capital loan status will be "ACTIVE" And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | Then Admin successfully undo Working Capital disbursal Then Working Capital undo disbursal transaction business event is raised with "100" amount and reversed "true" Then Working Capital loan status will be "APPROVED" @@ -1040,7 +1040,7 @@ Feature: WorkingCapitalLoanAccount And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | | WCLP | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 14.0 | - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "14" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: @@ -1082,18 +1082,18 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan creation was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 150.0 | 100.0 | 100.0 | 1.0 | 50.0 | + | WCLP_DISCOUNT_DISALLOW_ATTRIBUTES_OVERRIDE | 2026-01-01 | 2026-01-01 | Active | 100.0 | 100.0 | 100.0 | 1.0 | null | # --- add discount after disbursement is forbidden due to overrides disallowed --- # And Update discount with "20" amount on Working Capital loan account failed due to override disallowed by product @@ -1134,13 +1134,13 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan creation was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "50" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: @@ -1162,20 +1162,20 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan creation was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | - Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and "40" discount amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 40.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "50" exceeded discount amount - Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount + Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "40" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | 40.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 140.0 | 100.0 | 100.0 | 1.0 | null | 40.0 | 40.0 | # --- add discount after disbursement is forbidden as discount is already added --- # Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement @@ -1189,20 +1189,20 @@ Feature: WorkingCapitalLoanAccount Then Working capital loan creation was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | 50.0 | - Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded discount amount + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Submitted and pending approval | 100.0 | 0.0 | 100.0 | 1.0 | null | + Then Admin failed to approve the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" with "60" exceeded product discount amount Then Admin successfully approves the working capital loan on "01 January 2026" with "100" amount and expected disbursement date on "01 January 2026" Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | 50.0 | 50.0 | - Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded discount amount + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Approved | 100.0 | 100.0 | 100.0 | 1.0 | null | null | + Then Admin failed to disburse the working capital loan on "01 January 2026" with "100" amount with "60" exceeded product discount amount Then Admin successfully disburse the Working Capital loan on "01 January 2026" with "100" EUR transaction amount and "45" discount amount Then Working Capital loan status will be "ACTIVE" Then Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: - | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | 45.0 | + | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountProposed | discountApproved | discount | + | WCLP_DISCOUNT | 2026-01-01 | 2026-01-01 | Active | 145.0 | 100.0 | 100.0 | 1.0 | null | null | 45.0 | # --- add discount after disbursement is forbidden as discount is already added --- # Then Add discount with "10" amount on Working Capital loan account failed due to already added discount before disbursement diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature index 0e4922b44e6..b0cba357d56 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalLoanRepayment.feature @@ -12,13 +12,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId And Customer makes repayment on "10 January 2026" with 270.0 transaction amount on Working Capital loan @@ -43,13 +43,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId And Customer makes repayment by loan external ID on "10 January 2026" with 270.0 transaction amount on Working Capital loan @@ -74,13 +74,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId Then Initiating a repayment on "01 January 2026" with 0.0 transaction amount on Working Capital loan results an error with the following data: @@ -98,13 +98,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId Then Initiating a repayment on "01 January 2026" with -100.0 transaction amount on Working Capital loan results an error with the following data: @@ -122,13 +122,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId Then Initiating a repayment on "15 January 2026" with 270.0 transaction amount on Working Capital loan results an error with the following data: @@ -146,13 +146,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId And Customer makes repayment on "01 January 2026" with 270.0 transaction amount on Working Capital loan Then Working Capital loan delinquency range schedule has the following data: @@ -178,13 +178,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -225,13 +225,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -272,13 +272,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -324,13 +324,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -373,13 +373,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -428,13 +428,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -476,13 +476,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -528,13 +528,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -577,13 +577,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -629,13 +629,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin runs inline COB job for Working Capital Loan by loanId Then Working Capital loan delinquency range schedule has the following data: | periodNumber | fromDate | toDate | expectedAmount | paidAmount | outstandingAmount | minPaymentCriteriaMet | delinquentAmount | delinquentDays | @@ -705,13 +705,13 @@ Feature: Working Capital Loan Repayment Then Working capital loan approval was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discountApproved | - | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Approved | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount Then Working Capital loan status will be "ACTIVE" And Verify Working Capital loan disbursement was successful And Working capital loan account has the correct data: | product.name | submittedOnDate | expectedDisbursementDate | status | principal | approvedPrincipal | totalPayment | periodPaymentRate | discount | - | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | 0.0 | + | WCLP | 2026-01-01 | 2026-01-01 | Active | 9000.0 | 9000.0 | 100000.0 | 18.0 | null | When Admin sets the business date to "10 January 2026" And Admin runs inline COB job for Working Capital Loan by loanId And Customer makes repayment on "10 January 2026" with 270.0 transaction amount on Working Capital loan with the following payment details: @@ -735,7 +735,7 @@ Feature: Working Capital Loan Repayment | LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | WCLP | 01 January 2019 | 01 January 2019 | 9000 | 100000 | 0.18 | 1000 | And Admin successfully approves the working capital loan on "01 January 2019" with "9000" amount and "1000" discount amount and expected disbursement date on "01 January 2019" - And Admin successfully disburse the Working Capital loan on "01 January 2019" with "9000" EUR transaction amount + And Admin successfully disburse the Working Capital loan on "01 January 2019" with "9000" EUR transaction amount and "1000" discount amount Then Working Capital loan amortization schedule has 201 periods, with the following data for periods: | paymentNo | paymentDate | count | paymentsLeft | expectedPaymentAmount | forecastPaymentAmount | actualPaymentAmount | discountFactor | npvValue | balance | expectedAmortizationAmount | netAmortizationAmount | actualAmortizationAmount | incomeModification | deferredBalance | | 0 | 01 January 2019 | 200 | 0 | -9000.00 | | | 1 | -9000.00 | 9000.00 | | | | | 1000.00 | diff --git a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalNearBreachEvaluation.feature b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalNearBreachEvaluation.feature index 5846ba194fa..576b6a2fb6d 100644 --- a/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalNearBreachEvaluation.feature +++ b/fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalNearBreachEvaluation.feature @@ -251,7 +251,7 @@ Feature: Working Capital Near Breach Evaluation | submittedOnDate | expectedDisbursementDate | principalAmount | totalPayment | periodPaymentRate | discount | | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 500 | And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and "500" discount amount and expected disbursement date on "01 January 2026" - When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount + When Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount and "500" discount amount And Admin runs inline COB job for Working Capital Loan by loanId When Admin sets the business date to "01 February 2026" And Admin runs inline COB job for Working Capital Loan by loanId diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java index 31a1261010b..6d3419f16b4 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/serialization/WorkingCapitalLoanDataValidator.java @@ -47,6 +47,7 @@ import org.apache.fineract.portfolio.workingcapitalloan.WorkingCapitalLoanConstants; import org.apache.fineract.portfolio.workingcapitalloan.domain.WorkingCapitalLoan; import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanTransactionRepository; +import org.apache.fineract.portfolio.workingcapitalloanproduct.domain.WorkingCapitalLoanProductRelatedDetail; import org.springframework.stereotype.Component; @Component @@ -98,7 +99,8 @@ public class WorkingCapitalLoanDataValidator { private static final int EXTERNAL_ID_MAX_LENGTH = 100; private static final int PAYMENT_DETAIL_STRING_MAX_LENGTH = 50; - public void validateDiscountTransaction(final WorkingCapitalLoan loan, final String json, BigDecimal amount, final String note) { + public void validateDiscountTransaction(final WorkingCapitalLoan loan, final String json, BigDecimal discountAmount, + final String note) { if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } @@ -115,10 +117,15 @@ public void validateDiscountTransaction(final WorkingCapitalLoan loan, final Str baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) .failWithCode("override.not.allowed.by.product"); } - - baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName).value(amount).notNull() + baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName).value(discountAmount).ignoreIfNull() .zeroOrPositiveAmount(); + final BigDecimal currentDiscount = loan.getLoanProductRelatedDetails() != null ? loan.getLoanProductRelatedDetails().getDiscount() + : null; + if (currentDiscount == null) { + validateDiscountAmountWithProductDiscount(discountAmount, loan.getLoanProduct().getRelatedDetail(), baseDataValidator); + } + final LocalDate actualDisbursementDate = loan.getDisbursementDetails() != null && !loan.getDisbursementDetails().isEmpty() ? loan.getDisbursementDetails().getFirst().getActualDisbursementDate() : null; @@ -204,19 +211,33 @@ public void validateApproval(final String json, final WorkingCapitalLoan loan) { .extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, element, new HashSet<>()); baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName).value(discountAmount).ignoreIfNull() .zeroOrPositiveAmount(); - final BigDecimal currentDiscount = loan.getLoanProductRelatedDetails() != null ? loan.getLoanProductRelatedDetails().getDiscountProposed() : null; - if (discountAmount != null && currentDiscount != null && discountAmount.compareTo(currentDiscount) > 0) { - baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) - .failWithCode("amount.cannot.exceed.created.discount"); + if (currentDiscount != null) { + if (discountAmount.compareTo(currentDiscount) > 0) { + baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) + .failWithCode("amount.cannot.exceed.created.discount"); + } + } else { + validateDiscountAmountWithProductDiscount(discountAmount, loan.getLoanProduct().getRelatedDetail(), baseDataValidator); } } throwExceptionIfValidationWarningsExist(dataValidationErrors); } + private void validateDiscountAmountWithProductDiscount(final BigDecimal discountAmount, + final WorkingCapitalLoanProductRelatedDetail productRelatedDetail, final DataValidatorBuilder baseDataValidator) { + if (discountAmount != null) { + final BigDecimal productDiscount = productRelatedDetail != null ? productRelatedDetail.getDiscount() : null; + if (productDiscount != null && discountAmount.compareTo(productDiscount) > 0) { + baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) + .failWithCode("amount.cannot.exceed.product.discount"); + } + } + } + public void validateRejection(final String json, final WorkingCapitalLoan loan) { if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); @@ -338,9 +359,15 @@ public void validateDisbursement(final String json, final WorkingCapitalLoan loa final BigDecimal currentDiscount = loan.getLoanProductRelatedDetails() != null ? loan.getLoanProductRelatedDetails().getDiscountApproved() : null; - if (discountAmount != null && currentDiscount != null && discountAmount.compareTo(currentDiscount) > 0) { - baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) - .failWithCode("amount.cannot.exceed.approved.discount"); + if (discountAmount != null) { + if (currentDiscount != null) { + if (discountAmount.compareTo(currentDiscount) > 0) { + baseDataValidator.reset().parameter(WorkingCapitalLoanConstants.discountAmountParamName) + .failWithCode("amount.cannot.exceed.approved.discount"); + } + } else { + validateDiscountAmountWithProductDiscount(discountAmount, loan.getLoanProduct().getRelatedDetail(), baseDataValidator); + } } } diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java index ec39db75118..b1b4ee8d83f 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAssemblerImpl.java @@ -179,7 +179,7 @@ private WorkingCapitalLoanProductRelatedDetails buildLoanProductRelatedDetails(f detail.setNpvDayCount(productDetail.getNpvDayCount()); detail.setDiscountProposed(fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.discountParamName, element) ? fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanProductConstants.discountParamName, element, new HashSet<>()) - : productDetail.getDiscount()); + : null); final Long breachId = fromApiJsonHelper.parameterExists(WorkingCapitalLoanProductConstants.breachIdParamName, element) ? fromApiJsonHelper.extractLongNamed(WorkingCapitalLoanProductConstants.breachIdParamName, element) : null; diff --git a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java index 7a425c7311b..621cfb64e02 100644 --- a/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java +++ b/fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java @@ -133,12 +133,11 @@ public CommandProcessingResult approveApplication(final Long loanId, final JsonC } // Discount amount (optional, can only be reduced per requirement) - BigDecimal discount = loan.getLoanProductRelatedDetails().getDiscountProposed(); if (command.parameterExists(WorkingCapitalLoanConstants.discountAmountParamName)) { - discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, + final BigDecimal discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, command.parsedJson(), new HashSet<>()); + loan.getLoanProductRelatedDetails().setDiscountApproved(discount); } - loan.getLoanProductRelatedDetails().setDiscountApproved(discount); // Keep first tranche expected amount aligned with approved principal (submit stores proposed principal only). if (!loan.getDisbursementDetails().isEmpty()) { @@ -283,7 +282,8 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand loan.getDisbursementDetails().getFirst().setDisbursedBy(currentUser); } - BigDecimal discount = loan.getLoanProductRelatedDetails().getDiscountApproved(); + // Discount amount (optional, can only be reduced per requirement) + BigDecimal discount = null; if (command.parameterExists(WorkingCapitalLoanConstants.discountAmountParamName)) { discount = this.fromApiJsonHelper.extractBigDecimalNamed(WorkingCapitalLoanConstants.discountAmountParamName, command.parsedJson(), new HashSet<>()); @@ -291,8 +291,6 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand loan.getLoanProductRelatedDetails().setDiscount(discount); changes.put(WorkingCapitalLoanConstants.discountAmountParamName, discount); } - } else { - loan.getLoanProductRelatedDetails().setDiscount(discount); } final ExternalId txnExternalId = this.externalIdFactory.createFromCommand(command, diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java index 0507e464104..2a8cd2e8af7 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanApplicationCRUDTest.java @@ -28,7 +28,6 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; -import com.google.gson.JsonNull; import com.google.gson.JsonObject; import io.restassured.builder.RequestSpecBuilder; import io.restassured.builder.ResponseSpecBuilder; @@ -139,7 +138,7 @@ public void testSubmitWithoutOverridableParamsUsesProductDefaults() { assertEquals(productRepaymentEvery.intValue(), data.get("repaymentEvery").getAsInt(), "repaymentEvery should come from product"); assertRepaymentFrequencyTypeEquals(productRepaymentFrequencyType, data.get("repaymentFrequencyType")); - assertEqualBigDecimal(productDiscount, data.get("discountProposed")); + assertTrue(data.has("discountProposed") && data.get("discountProposed").isJsonNull()); assertTrue(data.has("delinquencyBucket") && !data.get("delinquencyBucket").isJsonNull(), "delinquencyBucket should come from product"); assertEquals(delinquencyBucketId.longValue(), data.getAsJsonObject("delinquencyBucket").get("id").getAsLong(), @@ -894,7 +893,7 @@ public void testWorkingCapitalDiscountAttributes() { loanData = applicationHelper.retrieveLoan(loanId); assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); // Null as reset of Approval amount - assertEquals(JsonNull.INSTANCE, loanData.get("discountApproved")); + assertTrue(loanData.get("discountApproved").isJsonNull()); // ReApprove the WC Loan with specific discount discountApproved = BigDecimal.valueOf(95); @@ -910,14 +909,14 @@ public void testWorkingCapitalDiscountAttributes() { loanData = applicationHelper.retrieveLoan(loanId); assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); - assertEqualBigDecimal(discountApproved, loanData.get("discount")); + assertTrue(loanData.get("discount").isJsonNull()); // Undo Disburse the WC Loan applicationHelper.undoDisbursalById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildUndoDisburseJson("Undo disbursal note")); loanData = applicationHelper.retrieveLoan(loanId); assertEqualBigDecimal(discountProposed, loanData.get("discountProposed")); assertEqualBigDecimal(discountApproved, loanData.get("discountApproved")); - assertEquals(JsonNull.INSTANCE, loanData.get("discount")); + assertTrue(loanData.get("discount").isJsonNull()); // ReDisburse the WC Loan with specific discount BigDecimal discountDisbursement = BigDecimal.valueOf(80); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanDelinquencyRangeScheduleIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanDelinquencyRangeScheduleIntegrationTest.java index 557a1ed1388..d4cd244c50e 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanDelinquencyRangeScheduleIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanDelinquencyRangeScheduleIntegrationTest.java @@ -186,7 +186,8 @@ public void testRangeScheduleExpectedAmountIncludesDiscount() { WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(approvedDate, principal, discount)); // Disburse - applicationHelper.disburseById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(approvedDate, principal)); + applicationHelper.disburseById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(approvedDate, principal, + discount, null, null, null, null, null, null, null)); // Run WC COB to generate the range schedule ok(() -> FineractFeignClientHelper.getFineractFeignClient().inlineJob().executeInlineJob("WC_LOAN_COB", diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanRepaymentTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanRepaymentTest.java index d2beb865e40..65fcf29e8ca 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanRepaymentTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/WorkingCapitalLoanRepaymentTest.java @@ -30,7 +30,6 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; @@ -43,6 +42,7 @@ import org.apache.fineract.integrationtests.common.BusinessDateHelper; import org.apache.fineract.integrationtests.common.ClientHelper; import org.apache.fineract.integrationtests.common.FineractFeignClientHelper; +import org.apache.fineract.integrationtests.common.Utils; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanApplicationTestBuilder; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanDisbursementTestBuilder; import org.apache.fineract.integrationtests.common.workingcapitalloan.WorkingCapitalLoanHelper; @@ -106,12 +106,12 @@ public void testRepaymentUpdatesTransactionAllocationBalanceAndStatus() { final Long loanId = submitAndTrack(new WorkingCapitalLoanApplicationTestBuilder().withClientId(createdClientId) .withProductId(productId).withPrincipal(BigDecimal.valueOf(5000)).withPeriodPaymentRate(BigDecimal.ONE) .withTotalPayment(BigDecimal.valueOf(5500)).withDiscount(BigDecimal.valueOf(100)).buildSubmitJson()); - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); loanHelper.approveById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(approvedOnDate, BigDecimal.valueOf(5000), BigDecimal.valueOf(100))); - final LocalDate disbursementDate = LocalDate.now(ZoneId.systemDefault()); - loanHelper.disburseById(loanId, - WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(disbursementDate, BigDecimal.valueOf(5000))); + final LocalDate disbursementDate = Utils.getLocalDateOfTenant(); + loanHelper.disburseById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(disbursementDate, + BigDecimal.valueOf(5000), BigDecimal.valueOf(100), null, null, null, null, null, null, null)); final LocalDate repaymentDate = disbursementDate.plusDays(1); BusinessDateHelper.runAt(repaymentDate.format(DateTimeFormatter.ofPattern("dd MMMM yyyy")), () -> loanHelper.makeRepaymentByLoanId(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildRepaymentJson(repaymentDate, @@ -134,7 +134,7 @@ public void testRepaymentRaisesExternalBusinessEvent() { final Long loanId = submitAndTrack(new WorkingCapitalLoanApplicationTestBuilder().withClientId(createdClientId) .withProductId(productId).withPrincipal(BigDecimal.valueOf(5000)).withPeriodPaymentRate(BigDecimal.ONE) .withTotalPayment(BigDecimal.valueOf(5500)).buildSubmitJson()); - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); loanHelper.approveById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(approvedOnDate, BigDecimal.valueOf(5000), null)); loanHelper.disburseById(loanId, @@ -162,7 +162,7 @@ public void testRepaymentWithMissingTransactionDateFails() { @Test public void testRepaymentWithMissingTransactionAmountFails() { - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long loanId = createApprovedAndDisbursedLoan(createProduct(), BigDecimal.valueOf(5000), BigDecimal.valueOf(5000), approvedOnDate); final CallFailedRuntimeException[] exHolder = new CallFailedRuntimeException[1]; @@ -176,14 +176,14 @@ public void testRepaymentWithMissingTransactionAmountFails() { public void testRepaymentWithFutureDateFails() { final Long loanId = createApprovedAndDisbursedLoan(createProduct(), BigDecimal.valueOf(5000), BigDecimal.valueOf(5000)); final CallFailedRuntimeException ex = loanHelper.runRepaymentByLoanIdExpectingFailure(loanId, - WorkingCapitalLoanDisbursementTestBuilder.buildRepaymentJson(LocalDate.now(ZoneId.systemDefault()).plusDays(30), + WorkingCapitalLoanDisbursementTestBuilder.buildRepaymentJson(Utils.getLocalDateOfTenant().plusDays(30), BigDecimal.valueOf(100), null, null, null, null)); assertEquals(400, ex.getStatus()); } @Test public void testRepaymentWithInvalidClassificationIdFails() { - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long loanId = createApprovedAndDisbursedLoan(createProduct(), BigDecimal.valueOf(5000), BigDecimal.valueOf(5000), approvedOnDate); final CallFailedRuntimeException[] exHolder = new CallFailedRuntimeException[1]; @@ -198,7 +198,7 @@ public void testRepaymentWhenLoanNotDisbursedFails() { final Long productId = createProduct(); final Long loanId = submitAndTrack(new WorkingCapitalLoanApplicationTestBuilder().withClientId(createdClientId) .withProductId(productId).withPrincipal(BigDecimal.valueOf(5000)).withPeriodPaymentRate(BigDecimal.ONE).buildSubmitJson()); - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); loanHelper.approveById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(approvedOnDate, BigDecimal.valueOf(5000), null)); final CallFailedRuntimeException ex = loanHelper.runRepaymentByLoanIdExpectingFailure(loanId, @@ -209,7 +209,7 @@ public void testRepaymentWhenLoanNotDisbursedFails() { @Test public void testRepaymentWithDateBeforeDisbursementFails() { - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long productId = createProduct(); final Long loanId = submitAndTrack(new WorkingCapitalLoanApplicationTestBuilder().withClientId(createdClientId) .withProductId(productId).withPrincipal(BigDecimal.valueOf(5000)).withPeriodPaymentRate(BigDecimal.ONE).buildSubmitJson()); @@ -226,7 +226,7 @@ public void testRepaymentWithDateBeforeDisbursementFails() { @Test public void testRepaymentWithNegativeAmountFails() { - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long loanId = createApprovedAndDisbursedLoan(createProduct(), BigDecimal.valueOf(5000), BigDecimal.valueOf(5000), approvedOnDate); final CallFailedRuntimeException[] exHolder = new CallFailedRuntimeException[1]; @@ -243,7 +243,7 @@ public void testRepaymentByExternalId() { final Long loanId = submitAndTrack(new WorkingCapitalLoanApplicationTestBuilder().withClientId(createdClientId) .withProductId(productId).withPrincipal(BigDecimal.valueOf(5000)).withPeriodPaymentRate(BigDecimal.ONE) .withExternalId(loanExternalId).buildSubmitJson()); - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); loanHelper.approveById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(approvedOnDate, BigDecimal.valueOf(5000), null)); loanHelper.disburseById(loanId, @@ -261,7 +261,7 @@ public void testRepaymentByExternalId() { public void testRepaymentWithDuplicateTransactionExternalIdFails() { final Long productId = createProduct(); final String sharedExternalId = "wcl-repay-ext-" + UUID.randomUUID(); - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long loanId1 = createApprovedAndDisbursedLoan(productId, BigDecimal.valueOf(5000), BigDecimal.valueOf(5000), approvedOnDate); final Long loanId2 = createApprovedAndDisbursedLoan(productId, BigDecimal.valueOf(3000), BigDecimal.valueOf(3000), approvedOnDate); @@ -278,7 +278,7 @@ public void testRepaymentWithDuplicateTransactionExternalIdFails() { @Test public void testRepaymentExactPayoffSetsClosedObligationsMet() { - final LocalDate approvedOnDate = LocalDate.now(ZoneId.systemDefault()); + final LocalDate approvedOnDate = Utils.getLocalDateOfTenant(); final Long loanId = createApprovedAndDisbursedLoan(createProduct(), BigDecimal.valueOf(5000), BigDecimal.valueOf(5000), approvedOnDate); final LocalDate repaymentDate = approvedOnDate.plusDays(1); @@ -300,8 +300,8 @@ public void testRepaymentAmortizationMatchesProvidedReferenceSchedule() { .buildSubmitJson()); loanHelper.approveById(loanId, WorkingCapitalLoanApplicationTestBuilder.buildApproveJson(disbursementDate, BigDecimal.valueOf(9000), BigDecimal.valueOf(1000))); - loanHelper.disburseById(loanId, - WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(disbursementDate, BigDecimal.valueOf(9000))); + loanHelper.disburseById(loanId, WorkingCapitalLoanDisbursementTestBuilder.buildDisburseJson(disbursementDate, + BigDecimal.valueOf(9000), BigDecimal.valueOf(1000), null, null, null, null, null, null, null)); for (int day = 1; day <= 3; day++) { final int repaymentDay = day; @@ -338,7 +338,7 @@ public void testRepaymentAmortizationMatchesProvidedReferenceSchedule() { } private Long createApprovedAndDisbursedLoan(final Long productId, final BigDecimal principal, final BigDecimal disburseAmount) { - return createApprovedAndDisbursedLoan(productId, principal, disburseAmount, LocalDate.now(ZoneId.systemDefault())); + return createApprovedAndDisbursedLoan(productId, principal, disburseAmount, Utils.getLocalDateOfTenant()); } private Long createApprovedAndDisbursedLoan(final Long productId, final BigDecimal principal, final BigDecimal disburseAmount,