feat(crewing): Phase 2 — requisitions + relief requests (flagged) #65

Merged
shad0w merged 2 commits from feat/crewing-requisitions into feat/crewing-foundations 2026-06-22 18:48:05 +00:00
Owner

Crewing — Phase 2 (Requisitions + relief)

Second slice of the Crewing module per the wiki Crewing-Implementation-Spec §12 (build order item 2). Stacks on #64 (foundations) — base branch is feat/crewing-foundations, not master, so nothing lands on master until the crewing module is fleshed out. Everything stays behind NEXT_PUBLIC_CREWING_ENABLED (off by default); production is unchanged.

Scope (reconciled — see wiki §12 status note)

Ships Epic A (Requisitions + relief) plus the shared autoRaiseRequisition backfill helper. The sign-off/experience portion of Epic K is deferred to Phase 4 (it transitions an assignment / writes an EXPERIENCE_RECORD, which need the onboarding/assignment schema from Phases 3–4). The auto-raised backfill it relies on is already built here.

What's in

  • Schema (crewing_requisitions migration): Requisition (OPEN→SHORTLISTING→PROPOSING→INTERVIEWING→SELECTED→FILLED, →CANCELLED), ReliefRequest, CrewAction (the POAction audit mirror) + enums.
  • State machine lib/requisition-state-machine.ts (mirrors po-state-machine.ts); selection Manager-only; orthogonal cancel from OPEN/SHORTLISTING by cancel_requisition holders (§6). Codes REQ-9000… via lib/requisition-number.ts.
  • Server actions: raise / cancel / transition / requestReliefCover / convertReliefToRequisition — guard flag+permission+state, write a CrewAction, notify. Shared autoRaiseRequisition() in lib/requisition-service.ts.
  • Notifier: notifyCrew() PO-independent path + CrewNotificationEvent.
  • Screens: /crewing/requisitions (list + Raise modal + relief convert) and /crewing/requisitions/[id] (detail). Requisitions added to the flag-gated Crewing sidebar (Manager + MPO, §7).

Tests & docs

  • Unit: requisition-state-machine.test.ts (11). Integration: requisitions.test.ts (15) — raise/cancel/transition, relief request + convert, auto-raise, permission gating.
  • type-check clean; full unit (225) + integration (146) suites green.
  • CLAUDE.md "Crewing" section updated; wiki §12/§5.3 updated to record the Epic A / Epic K split.

🤖 Generated with Claude Code


Closes Epic A — Requisitions (#75).

## Crewing — Phase 2 (Requisitions + relief) Second slice of the Crewing module per the wiki **Crewing-Implementation-Spec** §12 (build order item 2). Stacks on **#64** (foundations) — base branch is `feat/crewing-foundations`, **not** `master`, so nothing lands on master until the crewing module is fleshed out. Everything stays behind `NEXT_PUBLIC_CREWING_ENABLED` (off by default); production is unchanged. ### Scope (reconciled — see wiki §12 status note) Ships **Epic A (Requisitions + relief)** plus the shared `autoRaiseRequisition` backfill helper. The **sign-off/experience portion of Epic K is deferred to Phase 4** (it transitions an assignment / writes an `EXPERIENCE_RECORD`, which need the onboarding/assignment schema from Phases 3–4). The auto-raised backfill it relies on is already built here. ### What's in - **Schema** (`crewing_requisitions` migration): `Requisition` (`OPEN→SHORTLISTING→PROPOSING→INTERVIEWING→SELECTED→FILLED`, `→CANCELLED`), `ReliefRequest`, `CrewAction` (the `POAction` audit mirror) + enums. - **State machine** `lib/requisition-state-machine.ts` (mirrors `po-state-machine.ts`); selection Manager-only; orthogonal cancel from OPEN/SHORTLISTING by `cancel_requisition` holders (§6). Codes `REQ-9000…` via `lib/requisition-number.ts`. - **Server actions**: raise / cancel / transition / requestReliefCover / convertReliefToRequisition — guard flag+permission+state, write a `CrewAction`, notify. Shared `autoRaiseRequisition()` in `lib/requisition-service.ts`. - **Notifier**: `notifyCrew()` PO-independent path + `CrewNotificationEvent`. - **Screens**: `/crewing/requisitions` (list + Raise modal + relief convert) and `/crewing/requisitions/[id]` (detail). Requisitions added to the flag-gated Crewing sidebar (Manager + MPO, §7). ### Tests & docs - Unit: `requisition-state-machine.test.ts` (11). Integration: `requisitions.test.ts` (15) — raise/cancel/transition, relief request + convert, auto-raise, permission gating. - `type-check` clean; full unit (225) + integration (146) suites green. - `CLAUDE.md` "Crewing" section updated; wiki §12/§5.3 updated to record the Epic A / Epic K split. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Closes **Epic A — Requisitions** (#75).
shad0w added 1 commit 2026-06-22 10:37:14 +00:00
Second slice of the Crewing module per wiki Crewing-Implementation-Spec §12
(build order item 2). Everything stays behind NEXT_PUBLIC_CREWING_ENABLED;
production is unchanged. Schema is added incrementally — this lands the
requisition lifecycle layer.

What's in
- Schema: Requisition (OPEN→SHORTLISTING→PROPOSING→INTERVIEWING→SELECTED→FILLED,
  →CANCELLED), ReliefRequest, CrewAction (the POAction mirror) + their enums.
  Migration crewing_requisitions.
- State machine: lib/requisition-state-machine.ts mirrors po-state-machine
  (selection Manager-only; orthogonal cancel from OPEN/SHORTLISTING by
  cancel_requisition holders, §6). Codes REQ-9000… via lib/requisition-number.ts.
- Actions: raise/cancel/transition + requestReliefCover/convertReliefToRequisition,
  each guarding flag+permission+state, writing a CrewAction and notifying. Shared
  autoRaiseRequisition() (lib/requisition-service.ts) is the backfill entry point
  for sign-off / leave-clash (later phases).
- Notifier: notifyCrew() PO-independent path + CrewNotificationEvent.
- Screens: /crewing/requisitions (list + Raise modal + relief convert) and
  /crewing/requisitions/[id] (detail). Requisitions added to the flag-gated
  Crewing sidebar (Manager + MPO, §7).

Tests & docs
- Unit: requisition-state-machine.test.ts (11).
- Integration: requisitions.test.ts (15) — raise/cancel/transition, relief
  request + convert, auto-raise, permission gating.
- CLAUDE.md "Crewing" section updated with the Phase 2 surface.

Deferred: sign-off/experience (Epic K, §12 item 2) depends on the crew/assignment
models from Phase 3/4; autoRaiseRequisition() is ready for it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w force-pushed feat/crewing-requisitions from 3d30155b6c to 92a637b746 2026-06-22 10:59:44 +00:00 Compare
shad0w force-pushed feat/crewing-requisitions from 92a637b746 to 0b2ed9ac07 2026-06-22 12:53:04 +00:00 Compare
shad0w added 1 commit 2026-06-22 18:46:32 +00:00
Merge branch 'feat/crewing-foundations' into feat/crewing-requisitions
All checks were successful
PR checks / checks (pull_request) Successful in 38s
PR checks / integration (pull_request) Successful in 26s
2a99333be4
shad0w force-pushed feat/crewing-requisitions from 2a99333be4 to 0b2ed9ac07 2026-06-22 18:46:43 +00:00 Compare
shad0w added 1 commit 2026-06-22 18:47:00 +00:00
Merge branch 'feat/crewing-foundations' into feat/crewing-requisitions
All checks were successful
PR checks / checks (pull_request) Successful in 36s
PR checks / integration (pull_request) Successful in 29s
feac86e3a3
shad0w merged commit 2348fdabe5 into feat/crewing-foundations 2026-06-22 18:48:05 +00:00
Sign in to join this conversation.
No description provided.