Add chore expiry notification system with scheduling and tests
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m59s

- Implemented `trigger_chore_expiry.py` script to manually trigger chore expiry notifications for users via the admin API.
- Developed `chore_expiry_notification_scheduler.py` to handle the logic for sending notifications for chores expiring within the next 75 minutes.
- Created utility functions in `schedule_utils.py` to determine scheduling and deadlines for chores.
- Added comprehensive tests for the chore expiry notification system in `test_chore_expiry_notification_scheduler.py`, covering various scenarios including scheduled chores, confirmations, and user settings.
This commit is contained in:
2026-04-22 15:37:40 -04:00
parent 6982fa561f
commit 8907184fde
9 changed files with 1181 additions and 4 deletions

View File

@@ -20,14 +20,19 @@ self.addEventListener('push', function (event) {
}
const title = payload.title || 'Reward App'
// Expiry-warning notifications are informational only — no action buttons
const actions =
payload.type === 'chore_expiring_soon'
? []
: [
{ action: 'approve', title: 'Approve' },
{ action: 'deny', title: 'Deny' },
]
const options = {
body: payload.body || '',
icon: '/icons/icon-192x192.png',
data: payload,
actions: [
{ action: 'approve', title: 'Approve' },
{ action: 'deny', title: 'Deny' },
],
actions,
}
event.waitUntil(self.registration.showNotification(title, options))