Create a module that reads upcoming appointments from the database and sends email reminders to patients.
Function:
sendAppointmentReminders(daysAhead: number): Promise<ReminderResult>
// ReminderResult: { sent: number, failed: number, skipped: number, errors: string[] }
Requirements:
appointment_date is within the next daysAhead days AND reminder_sent_at IS NULLRESEND_API_KEY env var). If not set, log to console instead (dev fallback)Reminder: Your appointment on [date] at [time]reminder_sent_at = now() on the appointment rowWrite integration tests using a real test database (not mocks). Cover: normal send, missing email address, already-reminded guard.
No contributions yet.