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
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user