redz1029 e0dd3f6368 feat(db): day sheet RPCs, auto-submit cron, digest queue
Add submit_day_sheet, disapprove_day_sheet, justify_day_sheet,
approve_day_sheets (all SECURITY DEFINER, grant to authenticated)
and auto_submit_day_sheets (revoked from all client roles).

auto_submit_day_sheets:
  1. Reopens approved yesterday sheets for programmers whose timer
     was still running at end of day (amended event).
  2. Auto-promotes stale draft sheets to pending (auto_submitted event).
  3. Inserts day_sheet_digest notifications + scheduled_notifications
     (epoch=YYYYMMDD, ON CONFLICT DO NOTHING) for every admin.

Extends chk_at_least_one_ref on scheduled_notifications to allow
notify_type = 'day_sheet_digest' rows with no FK reference.

Registers pg_cron job 'programmer_day_sheet_autosubmit' at 16:05 UTC
(00:05 Asia/Manila) in a DO $$ EXCEPTION block.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 13:31:26 +08:00
2026-05-03 15:00:35 +08:00
2026-04-27 06:20:39 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
2026-04-27 06:20:39 +08:00
2026-04-09 19:01:53 +08:00
2026-02-09 20:10:42 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
2026-04-27 06:20:39 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
2026-02-09 20:10:42 +08:00
2026-04-09 19:01:53 +08:00
2026-04-09 19:01:53 +08:00
S
Description
No description provided
Readme 275 MiB
Languages
Dart 80.1%
JavaScript 5.8%
PLpgSQL 5.5%
Shell 3.4%
HTML 3%
Other 1.9%