Skip to content

Conversation

@sidshas03
Copy link
Contributor

Description

This PR fixes the duplicate interest posting issue reported in FINERACT-1659, where the Post Interest job could post interest multiple times for the same savings account within the same posting period.

What changed

  • Added a safeguard in SavingsSchedularInterestPoster to skip accounts where interest has already been posted for the current period, by comparing interestPostedTillDate with the current business date.
  • Updated the transaction isolation level to SERIALIZABLE to prevent duplicate postings caused by race conditions during parallel scheduler runs.

Tests

Added two integration tests to validate the behavior:

  • testPostInterestPreventsDuplicateOnSameDay
    Ensures running the job twice on the same day results in only one interest posting.
  • testPostInterestSkipsCurrentPeriodButAllowsNewPeriod
    Ensures the job skips reposting within the current period, while still allowing postings in a new period.

Expected outcome

  • Running the Post Interest job multiple times within the same posting period will not create duplicate transactions, and the savings account balance remains unchanged after subsequent runs.

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.

1 participant