-- Migration: Definitive enqueue_all_notifications() dispatcher
--
-- WHY THIS EXISTS:
--   20260322_finalize_notification_functions.sql has an underscore at character
--   position 9 of its filename, which sorts AFTER all 20260322NNNNNN_* files
--   (underscore ASCII 95 > digits ASCII 48-57). This means _finalize_ always
--   runs LAST in the 20260322 group, overriding enqueue_all_notifications()
--   with a version that omits:
--     - enqueue_announcement_banner_notifications()  (added in 20260322210000)
--     - enqueue_pass_slip_expired_notifications()    (added in 20260322150000)
--
--   This migration (20260323000000) sorts AFTER all 20260322* files and
--   redefines enqueue_all_notifications() as the single authoritative definition
--   that includes all 10 notification types.

CREATE OR REPLACE FUNCTION public.enqueue_all_notifications()
RETURNS void LANGUAGE plpgsql AS $$
BEGIN
  PERFORM public.enqueue_due_shift_notifications();
  PERFORM public.enqueue_overtime_idle_notifications();
  PERFORM public.enqueue_overtime_checkout_notifications();
  PERFORM public.enqueue_isr_event_notifications();
  PERFORM public.enqueue_isr_evidence_notifications();
  PERFORM public.enqueue_paused_task_notifications();
  PERFORM public.enqueue_backlog_notifications();
  PERFORM public.enqueue_pass_slip_expiry_notifications();
  PERFORM public.enqueue_pass_slip_expired_notifications();
  PERFORM public.enqueue_announcement_banner_notifications();
END;
$$;
