Story 5: Automated Payment Reminders
Overview​
| Field | Value |
|---|---|
| Story ID | NGE-14-5 |
| Story Points | 8 |
| Sprint | Sprint 13 |
| Language | Go |
Reminder Schedule​
| Trigger | Message Type |
|---|---|
| 7 days before due | Friendly reminder |
| 3 days before due | Urgent reminder |
| Due date | Final reminder |
| 1 day overdue | Overdue notice |
| 7 days overdue | Escalation |
Technical Implementation​
// reminder_worker.go
func (w *ReminderWorker) Start() {
c := cron.New()
c.AddFunc("0 9 * * *", w.sendDueReminders) // 9 AM daily
c.AddFunc("0 18 * * *", w.sendOverdueReminders) // 6 PM daily
c.Start()
}
func (w *ReminderWorker) sendDueReminders() {
// Get invoices due in 7 days
invoices := w.getUpcomingDue(7)
for _, inv := range invoices {
message := fmt.Sprintf(
"Fee of Rs.%.2f for %s is due on %s. Pay: %s",
inv.Balance, inv.StudentName, inv.DueDate, inv.PayLink,
)
w.sms.Send(inv.ParentPhone, message)
w.logReminder(inv.ID, "SMS", "DUE_REMINDER")
}
}
Channels​
- SMS - Primary (all parents)
- Email - Secondary (if available)
- WhatsApp - Optional (via API)
- Push - App notification