pelagia-portal/App/app/(portal)/crewing
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
..
applications refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
appraisals feat(crewing): Phase 5b — appraisal (flagged) 2026-06-22 22:09:32 +05:30
attendance feat(crewing): Phase 4b — leave & attendance (flagged) 2026-06-22 21:07:15 +05:30
candidates feat(crewing): Phase 3a — candidates / talent pool (flagged) 2026-06-22 18:23:01 +05:30
crew refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
leave refactor(crewing): correct audit action types + atomic auto-raise backfills 2026-06-22 23:46:23 +05:30
requisitions feat(crewing): Phase 3b — recruitment pipeline (flagged) 2026-06-22 18:49:12 +05:30
verification feat(crewing): EPFO/UAN assisted verification (GstService pattern, flagged) 2026-06-22 22:43:24 +05:30