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:

  1. Accept a notification_type parameter in the execute_async method and initializer
  2. Update the service to pass this parameter to the background job
  3. Modify the "already notified" check to verify against specific notification types using EmailEvent records

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