-
Notifications
You must be signed in to change notification settings - Fork 2.3k
FINERACT-2475: Implement Business Events for missing Client lifecycle transitions #5467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-2475: Implement Business Events for missing Client lifecycle transitions #5467
Conversation
|
please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest before every commits and don't forget to sign your commits. |
5fca300 to
a9d532b
Compare
| client.reOpened(currentUser, undoWithdrawalDate); | ||
| this.clientRepository.saveAndFlush(client); | ||
|
|
||
| businessEventNotifierService.notifyPostBusinessEvent(new ClientUndoWithdrawalBusinessEvent(client)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add unit tests for these function for coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aman-Mittal I have added the unit tests for the Client lifecycle events in ClientWritePlatformServiceJpaRepositoryImplTest.java to ensure logic coverage as requested.
|
@Aman-Mittal we are still enforcing one commit per PR here at fineract right? if that's the case @nidhiii128 you need to squash all your commits. |
Yes i agree, its one commit PR, even if in this case if we are follow per person commit per pr it is still breaking the convention. |
150e037 to
fef5bcb
Compare
@airajena I have squashed all changes into a single signed commit and corrected the PR title. The formatting has also been fixed using Spotless. The PR should now satisfy all compliance checks and is ready for your final review. Thanks! |
Seems the raised PR was using an outdated 'develop' branch as base. Please rebase your current branch. |
fef5bcb to
78fdd30
Compare
… transitions
Description
Apache Fineract is moving toward a robust Event-Driven Architecture (EDA) as part of the modernization efforts (referencing FINERACT-2022). While the Client module already supported events for creation and activation, several critical lifecycle transitions remained "silent," making it difficult for external systems to synchronize or react to client state changes.ChangesThis PR completes the event coverage for the Client entity by implementing the following:
New Business Event Classes: Created 5 new classes in org.apache.fineract.infrastructure.event.business.domain.client, all extending the modern ClientBusinessEvent base class:
ClientCloseBusinessEvent
ClientWithdrawBusinessEvent
ClientReactivateBusinessEvent
ClientUndoRejectionBusinessEvent
ClientUndoWithdrawalBusinessEventService
Integration: Updated ClientWritePlatformServiceJpaRepositoryImpl to trigger these events using the businessEventNotifierService.
Transaction Safety: Events are triggered immediately following saveAndFlush() to ensure notifications are only sent after successful database persistence.
Impact
EDA Support: External integration layers (like notification services or audit logs) can now subscribe to the full suite of client lifecycle events.Performance: The changes introduce O(1) overhead and adhere to the lightweight event-handling framework of the project.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.