Reminder Repository
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
1
Dependents
2
Entities
0
Integrations
Description
Data access layer for all reminder and notification preference persistence. Manages CRUD operations on the reminders table and the notification_settings table. Provides query methods to fetch due reminders for the cron job, check deduplication state, and retrieve user preference records.
reminder-repository
Responsibilities
- Insert, update, and delete reminder records in the reminders table
- Query due reminders by scheduled_at timestamp for cron consumption
- Read and write notification_settings records per user
- Support deduplication lookups by userId, scenarioType, and triggerEntityId
- Record reminder delivery status updates
Interfaces
createReminder(data)
getReminderById(id)
getDueReminders(beforeTimestamp)
updateReminderStatus(id, status)
deleteReminder(id)
getNotificationSettingsByUser(userId)
upsertNotificationSettings(userId, settings)
findExistingReminder(userId, scenarioType, triggerEntityId)
getPendingRemindersByUser(userId)
getDeliveredRemindersCount(userId, scenarioType, since)
Relationships
Related Data Entities (2)
Data entities managed by this component