pelagia-portal/App/app/(portal)/crewing/crew
Hardik 0679883273 refactor(crewing): correct audit action types + atomic auto-raise backfills
Audit-trail & transaction consistency (spec §11 "one transition, one row"):

- Action types: returnSalary/returnSelection/declineInterviewWaiver no longer
  mislabel a backward decision as its forward action. New CrewActionType members
  SALARY_RETURNED / SELECTION_RETURNED / WAIVER_DECLINED; added RECORD_DELETED;
  dropped the unused GATE_FAILED (migration recreates the enum).
- Deletions are audited: deleteDocument / deleteNextOfKin now write a
  RECORD_DELETED CrewAction (PII removals are traceable).
- Atomicity: autoRaiseRequisition takes an optional tx so the leave-clash and
  sign-off backfills are created INSIDE the approval/sign-off transaction; the
  office notification (notifyAutoRaised) fires after commit. An approved leave or
  a sign-off can no longer commit without its backfill requisition.

Tests assert the corrected action types (crewing-gates, crew-records) and the
existing clash/sign-off suites still pass with the in-transaction backfill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 23:46:23 +05:30
..
[id] fix(crewing): mask Aadhaar/PAN document numbers server-side 2026-06-22 23:29:11 +05:30
actions.ts refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
crew-directory.tsx feat(crewing): Phase 4a — crew records & profile + PPE (flagged) 2026-06-22 19:27:21 +05:30
page.tsx feat(crewing): resolve self-contained deferred follow-ups (flagged) 2026-06-22 22:28:23 +05:30