Skip to content

FINERACT-2455: Rework transaction reprocessing#6151

Open
Cocoa-Puffs wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455-transaction-processing-and-related-operations-enhancements
Open

FINERACT-2455: Rework transaction reprocessing#6151
Cocoa-Puffs wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455-transaction-processing-and-related-operations-enhancements

Conversation

@Cocoa-Puffs

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.
  • 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.

@Cocoa-Puffs
Cocoa-Puffs force-pushed the FINERACT-2455-transaction-processing-and-related-operations-enhancements branch 2 times, most recently from e1ec3f1 to 3106cf9 Compare July 20, 2026 14:35
public WorkingCapitalLoanTransactionAllocation apply(final WorkingCapitalLoanTransaction transaction,
final WorkingCapitalLoanTransactionAllocation existingAllocation, final WorkingCapitalLoanAllocationPlan plan,
final Map<Long, WorkingCapitalLoanCharge> chargesById) {
public Result apply(final WorkingCapitalLoanTransaction transaction, final WorkingCapitalLoanTransactionAllocation existingAllocation,

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.

Minor:
2nd parameter can be lifted.
Assumption:
transaction.getAllocation() should give the same.

@Cocoa-Puffs Cocoa-Puffs Jul 21, 2026

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.

Updated the code, the original issue that made the "existingAllocation" parameter mandatory, was that the applier only linked the transaction to the allocation, it didn't set the inverse. So a newly created transaction that just had it's allocation applied returned a stale "null" when txn.getAllocation() was called.

I updated the org.apache.fineract.portfolio.workingcapitalloan.domain.WorkingCapitalLoanTransactionAllocation#forPortions method to make the link both ways. This also simplified the logic a bit in the reprocessor.

int replayOrder();
}

private record PaymentEvent(LocalDate date, BigDecimal amount) implements ScheduleEvent {

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.

On progressive loans we were tie breaking based on creation date time.

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.

Changed it to more closely match LoanTransactionComparator behaviour

@Cocoa-Puffs
Cocoa-Puffs force-pushed the FINERACT-2455-transaction-processing-and-related-operations-enhancements branch from 3106cf9 to 29299d4 Compare July 21, 2026 14:40
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