tasq/lib/providers
Marc Rejohn Castillano 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
..
admin_user_provider.dart Initial Commit: Duty Schedule and Attendance Logbook 2026-03-07 10:16:28 +08:00
attendance_provider.dart Enhanced material design 3 implementation 2026-03-20 15:15:38 +08:00
auth_provider.dart A much more detailed notification 2026-02-27 07:05:08 +08:00
chat_provider.dart Initial Commit: Duty Schedule and Attendance Logbook 2026-03-07 10:16:28 +08:00
debug_settings_provider.dart Attendance validation involving Location Detection + Facial Recoginition with Liveness Detection 2026-03-07 23:46:43 +08:00
it_service_request_provider.dart IT Service Request 2026-03-08 07:54:20 +08:00
leave_provider.dart Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
location_provider.dart Geofence test screen 2026-02-19 06:49:21 +08:00
notification_navigation_provider.dart Implement push notification reminder system with 9 notification types 2026-03-20 18:26:48 +08:00
notifications_provider.dart Pass Slip and Leave approval/rejection push notifications 2026-03-15 22:36:33 +08:00
pass_slip_provider.dart Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
profile_provider.dart Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
ramadan_provider.dart Initial Commit: Duty Schedule and Attendance Logbook 2026-03-07 10:16:28 +08:00
realtime_controller.dart Fix flickering issues due to reconnecting loop 2026-03-02 22:09:29 +08:00
reports_provider.dart Reports 2026-03-03 07:38:40 +08:00
rotation_config_provider.dart Added configurable shift types and holiday settings 2026-03-18 16:51:34 +08:00
services_provider.dart Per channel skeleton 2026-03-01 20:10:38 +08:00
shift_countdown_provider.dart Implement push notification reminder system with 9 notification types 2026-03-20 18:26:48 +08:00
stream_recovery.dart Fix flickering issues due to reconnecting loop 2026-03-02 22:09:29 +08:00
supabase_provider.dart Initial commit 2026-02-09 20:10:42 +08:00
tasks_provider.dart Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
teams_provider.dart Per channel skeleton 2026-03-01 20:10:38 +08:00
tickets_provider.dart Added programmer role and fixed snackbar not showing 2026-03-16 07:23:20 +08:00
typing_provider.dart Implemented per stream subscription recovery with polling fallback 2026-03-01 17:24:04 +08:00
user_offices_provider.dart Per channel skeleton 2026-03-01 20:10:38 +08:00
verification_session_provider.dart Attendance log now record both check in and out photos and allow IT Staffs, Dispatchers and Admins to view for verification 2026-03-08 18:45:31 +08:00
whereabouts_provider.dart Background location tracking 2026-03-09 22:33:35 +08:00
workforce_provider.dart Enhanced material design 3 implementation 2026-03-20 15:15:38 +08:00