pelagia-portal/App/tests/integration
Hardik c14a22588e
All checks were successful
PR checks / checks (pull_request) Successful in 40s
PR checks / integration (pull_request) Successful in 30s
feat(crewing): Phase 5b — appraisal (flagged)
Final slice of Phase 5. The appraisal lifecycle raise → verify → approve across
three role-gated surfaces, per Crewing-Implementation-Spec §5.4/§8.14. Stacks on
5a verification. Behind NEXT_PUBLIC_CREWING_ENABLED. Completes Phase 5.

What's in
- Schema: Appraisal (on CrewAssignment) + AppraisalStatus
  (DRAFT/SUBMITTED/MPO_VERIFIED/MANAGER_APPROVED/REJECTED); CrewActionType +=
  APPRAISAL_SUBMITTED/VERIFIED/APPROVED/REJECTED. Migration crewing_appraisal.
- State machine lib/appraisal-state-machine.ts: verify (SUBMITTED→MPO_VERIFIED,
  MPO/Manager), approve (MPO_VERIFIED→MANAGER_APPROVED, Manager); orthogonal reject.
- Actions (crewing/appraisals/actions.ts): raiseAppraisal (raise_appraisal — PM/
  site staff), verifyAppraisal (verify_appraisal — MPO), approveAppraisal
  (approve_appraisal — Manager); reject paths require remarks; notifications
  APPRAISAL_FOR_VERIFICATION / APPRAISAL_FOR_APPROVAL.
- Three surfaces (§8.14): PM raises + tracks status on the crew-profile Appraisals
  tab; MPO verifies in the Verification queue (Appraisals section); Manager approves
  in the central /approvals queue (Appraisal kind).

Tests & docs
- Unit: appraisal-state-machine.test.ts (4). Integration: appraisal.test.ts (4) —
  raise→verify→approve happy path, MPO reject, permission gating (MPO can't raise,
  site staff can't verify, MPO can't approve). type-check clean; full unit (245) +
  integration (205) green (verified with RESEND_API_KEY unset).
- CLAUDE.md updated — completes Phase 5 (I + H).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 22:09:32 +05:30
..
admin-ranks.test.ts feat(crewing): foundations — SITE_STAFF role, ranks reference data + admin (flagged) 2026-06-22 13:26:04 +05:30
applications.test.ts feat(crewing): Phase 3b — recruitment pipeline (flagged) 2026-06-22 18:49:12 +05:30
appraisal.test.ts feat(crewing): Phase 5b — appraisal (flagged) 2026-06-22 22:09:32 +05:30
approval-actions.test.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
approved-this-month.test.ts fix(dashboard): count all POs approved this month, not just current MGR_APPROVED 2026-06-19 12:07:53 +05:30
cancel-supersede.test.ts feat(po): cancel POs (manager/superuser) + optional supersede link (#53) 2026-06-21 12:20:54 +05:30
candidates.test.ts feat(crewing): Phase 3a — candidates / talent pool (flagged) 2026-06-22 18:23:01 +05:30
company-branding.test.ts feat(po): per-company logo, stamp & brand bar on exported POs 2026-06-21 01:17:23 +05:30
company-crud.test.ts test(companies): cover createCompany/updateCompany actions 2026-06-21 02:05:32 +05:30
confirm-receipt.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
create-po.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
crew-records.test.ts feat(crewing): Phase 4a — crew records & profile + PPE (flagged) 2026-06-22 19:27:21 +05:30
crewing-admin.test.ts feat(crewing): admin crew management — direct placement, CRUD, strength config 2026-06-22 21:23:31 +05:30
discard-po.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
helpers.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
import-api.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
leave-attendance.test.ts feat(crewing): clash detection by required strength (Option A) 2026-06-22 21:14:21 +05:30
manager-po-creation.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
onboarding.test.ts feat(crewing): Phase 3c — onboarding (flagged) 2026-06-22 19:12:53 +05:30
payment-actions.test.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
products-search.test.ts test(integration): repair stale integration suite (wip: 97/108) 2026-06-21 02:34:07 +05:30
requisitions.test.ts feat(crewing): Phase 2 — requisitions + relief requests (flagged) 2026-06-22 18:22:59 +05:30
signoff.test.ts feat(crewing): Phase 4c — sign-off & experience (flagged) 2026-06-22 21:34:29 +05:30
vendor-approval.test.ts test(integration): green the last 3 behavioural-drift tests (108/108) 2026-06-21 02:39:41 +05:30
verification.test.ts feat(crewing): Phase 5a — verification queue (flagged) 2026-06-22 21:59:31 +05:30