Skip to content

FINERACT-2455: Working Capital Loan - Write-Off - #6223

Open
alberto-art3ch wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455/working-capital-loan-write-off
Open

FINERACT-2455: Working Capital Loan - Write-Off#6223
alberto-art3ch wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455/working-capital-loan-write-off

Conversation

@alberto-art3ch

Copy link
Copy Markdown
Contributor

Description

Adds Write-Off and Undo Write-Off for Working Capital Loans, matching cumulative/progressive loans.

Write-off is terminal: zeroes outstanding balances and closes the loan as CLOSED_WRITTEN_OFF; undo reopens it to ACTIVE and restores the balance. Incoming parameters follow progressive loans.

Accounting (accrual): Dr LOSSES_WRITTEN_OFF (total) · Cr LOAN_PORTFOLIO / FEES_RECEIVABLE / PENALTIES_RECEIVABLE per portion (no interest leg). Undo reverses via offsetting mirrors.

Includes: domain/state machine + dedicated write-off domain service, transaction/handlers/API/validator wiring, accounting WRITEOFF case, business events, DB migration 0063 (0062 reserved for the in-review Charge-Off PR), integration + E2E tests, and a fineract-doc chapter.

FINERACT-2455

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.
  • If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@alberto-art3ch
alberto-art3ch force-pushed the FINERACT-2455/working-capital-loan-write-off branch from 875df73 to 73e7c91 Compare August 4, 2026 02:33
@alberto-art3ch
alberto-art3ch marked this pull request as ready for review August 4, 2026 02:36
@alberto-art3ch
alberto-art3ch force-pushed the FINERACT-2455/working-capital-loan-write-off branch 3 times, most recently from 6152194 to 246c7ad Compare August 4, 2026 14:36

@galovics galovics left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration and permission wiring are solid, WorkingCapitalLoanWriteOffDomainService is clean. One real gap:

// TODO(D3): confirm the backdating rule. The ticket says "not supporting backdated transactions"; progressive
// loans allow a floor at the last user transaction date. Add the agreed date constraint here once confirmed.

The validator only checks "not null" and "not in the future" for the write-off date - the actual backdating restriction the ticket calls for is admittedly unresolved and unimplemented. As it stands, a write-off can be backdated to any past date (before other transactions, before disbursement, whatever), and the write-off domain service doesn't guard against it either (zeroes outstanding unconditionally). For a terminal, balance-zeroing operation this seems worth nailing down before merge rather than after - self-acknowledged TODOs on the actual validation rule the PR is supposed to implement are the kind of thing I'd want resolved, not shipped.

@alberto-art3ch
alberto-art3ch force-pushed the FINERACT-2455/working-capital-loan-write-off branch 4 times, most recently from 71fab18 to e6282ca Compare August 5, 2026 00:39
@alberto-art3ch
alberto-art3ch force-pushed the FINERACT-2455/working-capital-loan-write-off branch from e6282ca to d4e7c38 Compare August 5, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants