Skip to content

FINERACT-2279: Contract Termination feature#4669

Closed
alberto-art3ch wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2279/contract-termination-transaction
Closed

FINERACT-2279: Contract Termination feature#4669
alberto-art3ch wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2279/contract-termination-transaction

Conversation

@alberto-art3ch
Copy link
Copy Markdown
Contributor

Description

We will be able to initiate Contract Termination on the any active, progressive loan. We will be able to do Contract Termination on a active loan through API. A non-monetary transaction will be created as of the current date when the contract termination is done

These are some of the features with this new Loan substatus

  • New loan transaction type: CONTRACT_TERMINATION
  • Loan Transaction Template API returns all the outstanding balances till current date (same as prepay loan!

Principal Outstanding + Calculated Interest outstanding + outstanding charges as of current date will be the Contract termination amount

  • Charge-off is allowed on the Terminated loan accounts, but contract termination is not supported on charged-off loans!

  • Chargebacks are allowed on Terminated loan accounts

  • Loan status remains ACTIVE, but set sub-status to “CONTRACT_TERMINATED”

  • New external business event LoanContractTerminationPostBusinessEvent

FINERACT-2279

Checklist

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

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests
  • 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 coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/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
  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2279/contract-termination-transaction branch 3 times, most recently from 30b632d to 720fbbf Compare May 18, 2025 01:57
} else if (CommandParameterUtil.is(commandParam, "assigndelinquency")) {
commandRequest = builder.assignDelinquency(resolvedLoanId).build();
} else if (CommandParameterUtil.is(commandParam, LoanApiConstants.CONTRACT_TERMINATION_COMMAND)) {
commandRequest = builder.applyContractTermination(loanId).build();
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.

Perhaps it is better to use resolvedLoanId instead of loanId here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done! Code updated, Thanks @mariiaKraievska

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2279/contract-termination-transaction branch from 720fbbf to 363b025 Compare May 19, 2025 14:45
@alberto-art3ch alberto-art3ch force-pushed the FINERACT-2279/contract-termination-transaction branch from 363b025 to 38ad5a7 Compare May 19, 2025 20:16
public boolean isContractTermination() {
return LoanTransactionType.CONTRACT_TERMINATION.equals(getTypeOf()) && isNotReversed();
}

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.

I think isNonMonetaryTransaction() method should also be adjusted

return Calls.ok(FineractClientHelper.getFineractClient().loanTransactions.executeLoanTransaction(loanId, request, "repayment"));
}

public PostLoansLoanIdTransactionsResponse executeLoanTransaction(final Long loanId, final PostLoansLoanIdTransactionsRequest request,
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.

This method is not used anywhere. Is it really needed?

CAPITALIZED_INCOME(35, "loanTransactionType.capitalizedIncome"), //
CAPITALIZED_INCOME_AMORTIZATION(36, "loanTransactionType.capitalizedIncomeAmortization"), //
// Kind of Final Transactions
CONTRACT_TERMINATION(90, "loanTransactionType.contractTermination"), //
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.

It's a stupid question, but why 90? :)

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.

3 participants