Modify SendUpcomingNotificationService to support notification types
Problem
Currently, the SendUpcomingNotificationService doesn't accept or use a notification type parameter, which means it can't differentiate between different notification periods (90, 60, 45, 30, 15, and 1 day). This limitation prevents us from sending period-specific notifications and tracking which specific notification periods have been sent for an order.
Proposal
Modify the SendUpcomingNotificationService to:
- Accept a
notification_typeparameter in theexecute_asyncmethod and initializer - Update the service to pass this parameter to the background job
- Modify the "already notified" check to verify against specific notification types using
EmailEventrecords
These changes will work in conjunction with the updated UpcomingNotificationCronJob that will iterate through different notification periods.
Result
- The service will be able to handle different notification periods
How will we measure success?
- The service correctly handles different notification types
- EmailEvent records are created with the correct notification type
- The system prevents duplicate notifications of the same type
Edited by Minahil Nichols