adamsaghy commented on code in PR #6147:
URL: https://github.com/apache/fineract/pull/6147#discussion_r3638428132
##########
fineract-e2e-tests-runner/src/test/resources/features/WorkingCapitalBreachStartDateType.feature:
##########
@@ -0,0 +1,179 @@
+@WorkingCapital
+@WorkingCapitalBreachStartDateTypeFeature
+Feature: Working Capital Breach Start Date Type
+
+ @TestRailId:C89771
+ Scenario: Verify breach start date type - UC1: LOAN_CREATION anchor with
same-day disbursement matches the DISBURSEMENT baseline
+ 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 Product with custom breach config
and overrides enabled:
+ | breachFrequency | breachFrequencyType | breachAmountCalculationType |
breachAmount | breachGraceDays | breachStartType |
+ | 3 | DAYS | FLAT |
100 | 0 | LOAN_CREATION |
+ And Admin creates a working capital loan using created product with the
following data:
+ | submittedOnDate | expectedDisbursementDate | principalAmount |
totalPaymentVolume | periodPaymentRate | discount |
+ | 01 January 2026 | 01 January 2026 | 9000 | 100000
| 18 | 0 |
+ 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
+ And Admin runs inline COB job for Working Capital Loan by loanId
+ Then Working capital loan details has the following field values:
+ | breachStartType.code | LOAN_CREATION |
+ And Working Capital loan breach schedule has the following data:
+ | periodNumber | fromDate | toDate | numberOfDays |
minPaymentAmount | outstandingAmount | nearBreach | breach |
+ | 1 | 2026-01-01 | 2026-01-03 | 3 | 100
| 100 | null | null |
+
+ @TestRailId:C89772
+ Scenario: Verify breach start date type - UC2: LOAN_CREATION anchor with
late disbursement backfills and breaches pre-disbursement periods
+ 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 Product with custom breach config
and overrides enabled:
+ | breachFrequency | breachFrequencyType | breachAmountCalculationType |
breachAmount | breachGraceDays | breachStartType |
+ | 3 | DAYS | FLAT |
100 | 0 | LOAN_CREATION |
+ And Admin creates a working capital loan using created product with the
following data:
+ | submittedOnDate | expectedDisbursementDate | principalAmount |
totalPaymentVolume | periodPaymentRate | discount |
+ | 01 January 2026 | 10 January 2026 | 9000 | 100000
| 18 | 0 |
+ And Admin successfully approves the working capital loan on "01 January
2026" with "9000" amount and expected disbursement date on "10 January 2026"
+ When Admin sets the business date to "10 January 2026"
+ And Admin successfully disburse the Working Capital loan on "10 January
2026" with "9000" EUR transaction amount
+ And Admin runs inline COB job for Working Capital Loan by loanId
+ # Anchor = submittedOnDate 01 Jan (not disbursement 10 Jan); the periods
that elapsed before disbursement
+ # are generated retroactively and breached by the catch-up sweep in a
single COB run.
+ Then Working Capital loan breach schedule has the following data:
+ | periodNumber | fromDate | toDate | numberOfDays |
minPaymentAmount | outstandingAmount | nearBreach | breach |
+ | 1 | 2026-01-01 | 2026-01-03 | 3 | 100
| 100 | null | true |
+ | 2 | 2026-01-04 | 2026-01-06 | 3 | 100
| 100 | null | true |
+ | 3 | 2026-01-07 | 2026-01-09 | 3 | 100
| 100 | null | true |
+ | 4 | 2026-01-10 | 2026-01-12 | 3 | 100
| 100 | null | null |
+ And Working capital loan account has the correct data:
+ | breachStartDate |
+ | 2026-01-01 |
+ And Working capital loan details has the following field values:
+ | breachStartType.code | LOAN_CREATION |
+
+ @TestRailId:C89773
+ Scenario: Verify breach start date type - UC6: submitted but never disbursed
LOAN_CREATION loan gets no breach schedule and never breaches
+ 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 Product with custom breach config
and overrides enabled:
+ | breachFrequency | breachFrequencyType | breachAmountCalculationType |
breachAmount | breachGraceDays | breachStartType |
+ | 3 | DAYS | FLAT |
100 | 0 | LOAN_CREATION |
+ And Admin creates a working capital loan using created product with the
following data:
+ | submittedOnDate | expectedDisbursementDate | principalAmount |
totalPaymentVolume | periodPaymentRate | discount |
+ | 01 January 2026 | 01 January 2026 | 9000 | 100000
| 18 | 0 |
+ And Admin successfully approves the working capital loan on "01 January
2026" with "9000" amount and expected disbursement date on "01 January 2026"
+ # Three full breach periods have elapsed since the LOAN_CREATION anchor,
but COB skips undisbursed loans:
+ # the breach clock only materializes once the loan is disbursed (PS-3201
F3 corollary - PO to acknowledge)
+ When Admin sets the business date to "10 January 2026"
+ And Admin runs inline COB job for Working Capital Loan by loanId
+ Then Working Capital loan breach schedule has no data
+
+ @TestRailId:C89774
+ Scenario: Verify breach start date type - UC7: pause inside the
pre-disbursement breach window is accepted when the schedule covers those dates
+ # EXPECTED-BEHAVIOR test for defect: pause validation still anchors on
disbursementDate +
+ # breachGraceDays, so on a LOAN_CREATION loan a pause inside
[submit+grace, disbursement+grace) is wrongly
+ # rejected with 400 startDate.is.before.than.date even though breach
periods exist there.
+ # This scenario asserts the CORRECT behaviour (pause accepted) and FAILS
until issue is fixed.
Review Comment:
I guess we can remove these comments, no? They seems not valid anymore
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]