Skip to content

A progressive loan cannot be contract-terminated, so ending one early means using a closure command that means something else #504

Description

@Aman-Mittal

What is missing

Fineract accepts contractTermination and undoContractTermination on a loan. It is a distinct closure path for progressive, interest-recalculating loans — not the same thing as close, writeoff or foreclosure, all three of which this app already offers. Neither command appears anywhere in src/app.

Confirmed against a running apache/fineract, using the #268 discriminator:

Probe Result
POST /loans/{id}?command=totallyNotACommand error.msg.query.parameter.value.unsupportedunrecognised (control)
POST /loans/{id}?command=contractTermination error.msg.loan.contract.termination.is.only.supported.for.progressive.loan.schedule.typerecognised
POST /loans/{id}?command=undoContractTermination error.msg.loan.is.not.contract.terminatedrecognised

The platform's own error messages give the two conditions the UI needs: termination applies only to progressive-schedule loans, and the undo applies only to a loan already terminated. So both should be offered conditionally rather than unconditionally, the way #268 handled undo-last-disbursal.

What the UI offers today

The Actions menu on a real progressive Active loan — 17 entries, none of them contract termination:

The Actions menu on a progressive Active loan

Add Loan Charge · Add Collateral · Assign Loan Officer · Undo Disbursal · Waive Interest · Prepay Loan · Foreclosure · Close · Close as Rescheduled · Write Off · Charge Off · Merchant Issued Refund · Payout Refund · Goodwill Credit · Waive Interest Payment · Re-age Loan · Re-amortise Loan

For contrast, a cumulative loan gets the first 14 — the three progressive-only entries are correctly withheld, which is the existing pattern this work should follow:

The same menu on a cumulative Active loan

Suggested scope

Two entries on the loan Actions menu, both gated on the loan's schedule type being progressive, and the undo additionally gated on the loan already being contract-terminated. The generated client already has the call shape — loansService.postLoansLoanId(loanId, request, 'contractTermination') — which is the same shape close and writeoff already use, so this is a new form, not a new pattern.

Request body follows PostLoansLoanIdRequest: a date plus dateFormat/locale, and an optional note.

Why it is worth doing

Without it, an institution ending a progressive contract early has to reach for close or foreclosure instead. Those are different events with different accounting consequences, so the loan's history ends up recording something that did not happen — and the distinction is exactly why the platform models termination separately.

Environment

main at 7c51d90b. Probes against apache/fineract running locally via deploy/docker-compose-e2e.yml; screenshots from loans seeded with the repository's own e2e/utils/seed-api.ts helpers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions