Skip to content

Conversation

@nidhiii128
Copy link
Contributor

… 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!

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

@airajena
Copy link
Contributor

airajena commented Feb 8, 2026

please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest before every commits and don't forget to sign your commits.

@nidhiii128 nidhiii128 force-pushed the feature/client-lifecycle-events branch from 5fca300 to a9d532b Compare February 9, 2026 06:32
client.reOpened(currentUser, undoWithdrawalDate);
this.clientRepository.saveAndFlush(client);

businessEventNotifierService.notifyPostBusinessEvent(new ClientUndoWithdrawalBusinessEvent(client));
Copy link
Contributor

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

Copy link
Contributor Author

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.

@airajena
Copy link
Contributor

airajena commented Feb 9, 2026

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

@Aman-Mittal
Copy link
Contributor

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

@nidhiii128 nidhiii128 changed the title FINERACT-2475: Implement missing Business Events for Client lifecycle… FINERACT-2475: Implement Business Events for missing Client lifecycle transitions Feb 10, 2026
@nidhiii128 nidhiii128 force-pushed the feature/client-lifecycle-events branch from 150e037 to fef5bcb Compare February 10, 2026 15:43
@nidhiii128
Copy link
Contributor Author

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

@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!

@airajena
Copy link
Contributor

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

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

@adamsaghy adamsaghy closed this Feb 11, 2026
@adamsaghy adamsaghy reopened this Feb 11, 2026
@nidhiii128 nidhiii128 force-pushed the feature/client-lifecycle-events branch from fef5bcb to 78fdd30 Compare February 12, 2026 18:14
@nidhiii128 nidhiii128 closed this Feb 13, 2026
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.

4 participants