Skip to content

FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting#5837

Open
somasorosdpc wants to merge 2 commits into
apache:developfrom
openMF:FINERACT-2455/working-capital-transaction-goodwill-credit-accounting
Open

FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting#5837
somasorosdpc wants to merge 2 commits into
apache:developfrom
openMF:FINERACT-2455/working-capital-transaction-goodwill-credit-accounting

Conversation

@somasorosdpc
Copy link
Copy Markdown
Contributor

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

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.

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

@somasorosdpc somasorosdpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from 858cc25 to 11a1624 Compare May 13, 2026 08:51
@somasorosdpc somasorosdpc marked this pull request as ready for review May 13, 2026 09:03
@somasorosdpc somasorosdpc marked this pull request as draft May 13, 2026 09:04
@somasorosdpc somasorosdpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from 11a1624 to 6b93417 Compare May 13, 2026 10:28
@somasorosdpc somasorosdpc marked this pull request as ready for review May 15, 2026 11:11
@somasorosdpc somasorosdpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from 96efaf7 to e68ed22 Compare May 15, 2026 12:13

private List<GetWorkingCapitalLoanTransactionIdResponse> findMatchingTransactions(Long loanId, String transactionType,
private TransactionType resolveTransactionType(String transactionType) {
return Arrays.stream(TransactionType.values()).filter(t -> t.name().equalsIgnoreCase(transactionType.replace(" ", "_"))).findFirst()
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 we do not need an array and stream here, it could be simplified toTransactionType.valueOf(transactionType.toUpperCase().replace(' ', '_'))

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.

done

@peter-kovacs-dpc peter-kovacs-dpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from e68ed22 to 0b9f17f Compare May 18, 2026 08:04
@somasorosdpc somasorosdpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from 0b9f17f to 5b0c2f5 Compare May 18, 2026 08:13

@Override
public void postJournalEntriesForRepayment(final WorkingCapitalLoan loan, final WorkingCapitalLoanTransaction txn,
public void postJournalEntriesForRepaymentLikeTransaction(final WorkingCapitalLoan loan, final WorkingCapitalLoanTransaction txn,
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.

Would it make sense to rename this method to "postJournalEntries"?

} else {
postRegularRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion, feesPortion,
penaltiesPortion, overpaymentPortion);
if (LoanTransactionType.REPAYMENT.equals(txn.getTypeOf())) {
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.

Would it make sense use switch here instead and list all supported transaction type?
Would it make sense to throw error if unsupported transaction type is found?

feesPortion, penaltiesPortion, overpaymentPortion);
}
}
if (LoanTransactionType.GOODWILL_CREDIT.equals(txn.getTypeOf()) && !isChargedOff) {
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.

Would it make sense to handle these use cases, similarly as above repayment does?

  • Having condition whether need to create journal entries for non charged-off loan?
  • Having condition whether need to create journal entries for charged-off loan? -> unsupported yet...

@somasorosdpc somasorosdpc force-pushed the FINERACT-2455/working-capital-transaction-goodwill-credit-accounting branch from 5b0c2f5 to 3d7c9ee Compare May 18, 2026 16:51
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.

5 participants