Receive Inactivity Reminder After Extended Period Without Activity Log
The Notification Scenario Engine includes an inactivity detection rule. A Supabase scheduled Edge Function runs periodically (e.g., daily at 08:00) and queries the activity_logs table to identify peer mentors whose most recent activity log is older than the configured threshold (defaulting to 14 days). For each identified peer mentor whose notification preference for inactivity reminders is enabled, the engine enqueues a warm, non-alarming push notification encouraging them to log recent activities. The message is phrased positively to avoid creating anxiety while prompting action. The push is suppressed if the peer mentor is currently on an availability pause.
User Story
Acceptance Criteria
- Given a peer mentor has not logged any activity for longer than the inactivity threshold, when the scheduled Edge Function runs, then a push notification is enqueued for that peer mentor
- Given a peer mentor is on an availability pause, when the inactivity check runs, then no inactivity reminder is sent to avoid unnecessary notifications
- Given a peer mentor logs an activity after receiving an inactivity reminder, when the next scheduled run occurs, then no reminder is sent since the inactivity condition is no longer met
- Given a peer mentor has disabled the 'Inactivity Reminders' notification category, when the scheduled check runs, then no notification is dispatched to that user
- Given the notification is delivered, when the peer mentor taps it, then they are deep-linked to the activity type selection screen to begin a new registration
Business Value
Underreporting of peer support activities is identified as a critical problem across all three organizations. The primary cause is forgetting to log activities rather than intentional omission. Automated inactivity reminders address this directly by prompting peer mentors at the right moment without requiring any coordinator intervention. Accurate activity data is the foundation of Bufdir grant reporting, and incomplete data risks funding shortfalls.
This story delivers a passive quality-control mechanism that improves data completeness organization-wide.
Components
- Notification Scenario Engine service
- Push Notification Service service
- Push Notification Gateway infrastructure
- Notification Repository data