System Workflows
Notifications
The notification pipeline — quiet hours, deferred sends at 07:00, three retries with backoff, event-key dedup and the hourly reminder job.
Notifications are a queue with manners: nothing loud between 22:00 and 07:00 recipient-local, deferred messages released at 07:00, trip-day events older than two hours dropped, one message per event per channel per recipient, and three retries with exponential backoff when a channel fails. The recipient side is UF-SHR-15.
Delivery phase: P1 (channels and templates), P3 (quiet hours).
Trigger and actors
- Trigger: any domain event that maps to a notification template.
- Actors: the notification service; the quiet-hours scheduler; the retry queue; the hourly reminder job.
Diagram
Timers and rules
| Step | Timer (verbatim) | Rule trace |
|---|---|---|
| Quiet hours | "SMS and push shall not be sent between 22:00 and 07:00 recipient local time unless urgent"; deferred messages go at 07:00; trip-day events older than 2 hours are dropped | FR-NTF-03, BR-NTF-03, D-289, D-290 |
| Retries | "Failures retry 3 times with exponential backoff" | FR-NTF-05 |
| Dedup | "One event shall produce at most one message per channel per recipient" (unique event key) | FR-NTF-06 |
| Reminders | "a reminder 24 hours before departure by push and email, plus SMS if enabled… when the hourly job runs" | FR-NTF-07, D-27 |
| Change notices | "Vehicle, driver or time changes are notified within 1 hour" | FR-NTF-07, D-186 |
| Language | Templates versioned, language and layout per recipient with RTL | FR-NTF-02, FR-NTF-04 |
| Security messages | Account security messages cannot be disabled | FR-NTF-01 |
| Delivery records | Delivery states queued, sent, delivered, failed, dropped with attempt and next-attempt timestamps | FR-NTF-05, ERD notifications |
Stories
- As a recipient, I want silence between 22:00 and 07:00 unless it is urgent, so that the platform respects my night. (FR-NTF-03, D-289)
- As an operations controller, I want trip-day staleness to drop old notifications, so that a catch-up burst never confuses the morning. (D-290)
- As a traveler, I want one reminder per channel, not five, so that the trip day is calm. (FR-NTF-06)
- As an admin, I want versioned templates, so that a wording fix does not fork history. (FR-NTF-04)