Repository navigation
feat(loans): support contract termination - #633
Conversation
Add Terminate Contract and Undo Contract Termination to progressive loan actions, gated by the backend's schedule, status, charge-off and sub-status rules. Route both through the shared form as loan-level commands with an optional note while hiding the business-date field Fineract controls itself. Add unit coverage for eligibility, sub-status detection, routes and request payloads. Refs apache#504
E2E — mocked backend🎭 E2E Tests✅ All green — 380 passed · 0 failed · 1 skipped, across 34 spec files in 6m 30s. By spec file
All 381 tests — click to expand
Slowest 10 — what the shard counts should be tuned against
📼 Download the HTML report, videos and traces — see the Generated by run 36401681530 from |
E2E — real Fineract🎭 E2E Tests✅ All green — 91 passed · 0 failed · 0 skipped, across 29 spec files in 5m 52s. By spec file
All 91 tests — click to expand
Slowest 10 — what the shard counts should be tuned against
📼 Download the HTML report, videos and traces — see the Generated by run 36401681530 from |
|
@wellkilo Please add some screenshots and video |
Add a mocked browser journey that terminates a progressive loan contract, verifies the sub-status swaps the action to undo, then reverses it. The run captures screenshots and WebM evidence for the pull request. Refs apache#504
|
@Aman-Mittal Thanks for the review. I added screenshot and video evidence captured from the mocked Playwright regression that covers the complete terminate-and-undo flow. Eligible actionConfirmation flowUndo after terminationFull recording |



What and why
Implements both contract-termination commands from #504.
The loan Actions menu now offers:
900/contractTermination).Both route through the shared transaction form, which now treats them as loan-level commands (
POST /loans/{id}?command=...) rather than transaction sub-resource calls. Fineract owns the business date for both commands, so the form hides the client date field and sends only the optional note.This avoids recording a contract termination as
closeorforeclosure, which have different schedule and accounting semantics.Verification
npm test -- --watch=false— 253 test files, 1583 tests passednpm run build— passed; the pre-existingheader.component.tsstylesheet budget warning remainsnpm run lint— passednpm run i18n:check— passednpm run check:icons— passednpm run check:a11y-names— passednpm run format:check— passednpm run api:surface— passedd2e6dfc5is signed and GitHub reports it as VerifiedDocker is not installed on this machine, so no live Fineract E2E run was performed. Eligibility and request shape follow Fineract's
LoanContractTerminationServiceImplvalidation and the generatedPOST /loans/{id}binding.Screenshots
Not applicable: this adds two conditional loan Actions entries and a confirmation flow; no binary artifact is committed.
AI assistance (optional)
AGENTS.md, local lint/build/unit verification, Fineract backend source reviewChecklist
src/app/api/.src/app/core/adapters/instead of direct browser globals or imperative third-party APIs.d2e6dfc5is Verified on GitHub.