Skip to content

Delinquency events trigger setup on service level - #14

Open
PareekshithPalat wants to merge 2 commits into
fynmanoj:develop-v1.9.1from
PareekshithPalat:Delinquency_events_trigger_setup_on_service_level
Open

Delinquency events trigger setup on service level#14
PareekshithPalat wants to merge 2 commits into
fynmanoj:develop-v1.9.1from
PareekshithPalat:Delinquency_events_trigger_setup_on_service_level

Conversation

@PareekshithPalat

Copy link
Copy Markdown

Publish HookEvent for Loan Delinquency Range Changes

Summary

This PR enables delinquency events to trigger SMS gateway processing at the service layer by publishing a custom HookEvent whenever a loan's delinquency range changes.

This removes the dependency on database-trigger-based event generation for delinquency notifications and aligns the implementation with Fineract's existing Business Event and Hook framework.

Changes

DelinquencyWritePlatformServiceImpl.java

  • Registered a BusinessEventListener for LoanDelinquencyRangeChangeBusinessEvent.
  • Added a service-level listener to publish a HookEvent when a loan's delinquency range changes.
  • Published a custom HookEvent using:
    • Entity: LOAN
    • Action: DELINQUENCYCHANGE
  • Added logging and exception handling around HookEvent publication.

DelinquencyConfiguration.java

  • Updated bean configuration to inject the dependencies required for publishing HookEvents:
    • ApplicationContext
    • PlatformSecurityContext
    • ToApiJsonSerializer<Object>

Files Modified

  • fineract-provider/src/main/java/org/apache/fineract/portfolio/delinquency/service/DelinquencyWritePlatformServiceImpl.java
  • fineract-provider/src/main/java/org/apache/fineract/portfolio/delinquency/starter/DelinquencyConfiguration.java

Benefits

  • Eliminates reliance on database triggers for delinquency SMS processing.
  • Publishes notifications at the service layer using the existing Hook framework.
  • Reuses the existing MessageGatewayHookProcessor.
  • Keeps the implementation localized to the delinquency module.
  • Maintains backward compatibility with existing functionality.

Minor Update

Added dynamic Id allocation for Template_User . (which was not present in the previous PR).

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