Commit Graph

15 Commits

Author SHA1 Message Date
d484f62cbd Implement push notification reminder system with 9 notification types
Adds comprehensive push notification reminders using pg_cron + pg_net:
- Shift check-in reminder (15 min before, with countdown banner)
- Shift check-out reminder (hourly, persistent until checkout)
- Overtime idle reminder (15 min without task)
- Overtime checkout reminder (30 min after task completion)
- IT service request event reminder (1 hour before event)
- IT service request evidence reminder (daily)
- Paused task reminder (daily)
- Backlog reminder (15 min before shift end)
- Pass slip expiry reminder (15 min before 1-hour limit, with countdown banner)

Database: Extended scheduled_notifications table to support polymorphic references
(schedule_id, task_id, it_service_request_id, pass_slip_id) with unique constraint
and epoch column for deduplication. Implemented 8 enqueue functions + master dispatcher.
Uses pg_cron every minute to enqueue and pg_net to trigger process_scheduled_notifications
edge function, eliminating need for external cron job. Credentials stored in vault with
GUC fallback for flexibility.

Flutter: Added ShiftCountdownBanner and PassSlipCountdownBanner widgets that display
persistent countdown timers for active shifts and pass slips. Both auto-dismiss when
user completes the action. FCM handler triggers shift countdown on start_15 messages.
navigate_to field in data payload enables flexible routing to any screen.

Edge function: Updated process_scheduled_notifications to handle all 9 types with
appropriate titles, bodies, and routing. Includes pass_slip_id in idempotency tracking.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-20 18:26:48 +08:00
74197c525d Enhanced material design 3 implementation 2026-03-20 15:15:38 +08:00
81853c4367 Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
0bd2a94ece OTA Update attempt 2026-03-11 22:28:38 +08:00
d87b5e73d7 Team Color, image compression for attendance verification, improved wherebouts 2026-03-08 12:23:28 +08:00
88432551c8 IT Service Request 2026-03-08 07:54:20 +08:00
c6f536edeb Initial Commit: Duty Schedule and Attendance Logbook 2026-03-07 10:16:28 +08:00
73dc735cce M3 Overhaul 2026-03-06 20:03:32 +08:00
e91e7b43d2 A bit of notification turn on reminder 2026-03-01 05:45:23 +08:00
cc6fda0e79 Allow OS notifications 2026-02-23 22:19:23 +08:00
5488238051 Geofence test screen 2026-02-19 06:49:21 +08:00
372928d8e7 Added User Profile Screen 2026-02-18 21:42:48 +08:00
a80f09b9c0 Initial commit for teams module 2026-02-12 06:58:18 +08:00
01c6b3537c Major UI overhaul 2026-02-10 23:11:45 +08:00
1f16da8f88 Initial commit 2026-02-09 20:10:42 +08:00