feat(crewing): admin crew management — direct placement, CRUD, strength config #71

Merged
shad0w merged 2 commits from feat/crewing-admin into feat/crewing-leave-attendance 2026-06-22 18:52:23 +00:00
Owner

Crewing — Admin crew management (direct placement, CRUD, strength config)

Office/admin management surface for crewing, behind a new manage_crew permission (Manager + SuperUser + Admin). Stacks on #70 (4b leave/attendance); base feat/crewing-leave-attendance. Behind NEXT_PUBLIC_CREWING_ENABLED.

Addresses two requests: Manager places crew directly onto sites (no requisition) and Admin manages crew (CRUD) — plus the office UI for the Option A clash strength.

What's in

  • Permission: manage_crew (MGR/SU/ADMIN).
  • Direct placement (placeCrew): assign a crew member to a vessel/site without a requisition — creates an ACTIVE CrewAssignment, promotes a candidate to EMPLOYEE with a CRW- number, blocked if already actively assigned.
  • Admin crew CRUD: createCrewMember / updateCrewMember / deleteCrewMember (delete blocked when assignments/applications exist).
  • Crew strength config: upsert/delete VesselRankRequirement (the minStrength driving R6 leave-clash detection).
  • Screens under Administration (flag-gated, MGR/SU/ADMIN): /admin/crew (list + add/edit/delete + Place modal) and /admin/crew-strength (requirement table + form).

Tests & docs

  • Unit: manage_crew matrix check. Integration: crewing-admin.test.ts (9) — CRUD + delete guard, direct placement (+promotion, +active-assignment guard), strength upsert/delete, manage_crew gating.
  • type-check clean; full unit (241) + integration (192) green.
  • CLAUDE.md updated; wiki §12 records this surface.

🤖 Generated with Claude Code


Closes Epic L — Reference data & admin (#86).

## Crewing — Admin crew management (direct placement, CRUD, strength config) Office/admin management surface for crewing, behind a new **`manage_crew`** permission (Manager + SuperUser + Admin). Stacks on **#70** (4b leave/attendance); base `feat/crewing-leave-attendance`. Behind `NEXT_PUBLIC_CREWING_ENABLED`. Addresses two requests: **Manager places crew directly onto sites (no requisition)** and **Admin manages crew (CRUD)** — plus the office UI for the Option A clash strength. ### What's in - **Permission:** `manage_crew` (MGR/SU/ADMIN). - **Direct placement** (`placeCrew`): assign a crew member to a vessel/site **without a requisition** — creates an `ACTIVE` `CrewAssignment`, promotes a candidate to `EMPLOYEE` with a `CRW-` number, blocked if already actively assigned. - **Admin crew CRUD:** `createCrewMember` / `updateCrewMember` / `deleteCrewMember` (delete blocked when assignments/applications exist). - **Crew strength config:** upsert/delete `VesselRankRequirement` (the `minStrength` driving R6 leave-clash detection). - **Screens** under **Administration** (flag-gated, MGR/SU/ADMIN): `/admin/crew` (list + add/edit/delete + Place modal) and `/admin/crew-strength` (requirement table + form). ### Tests & docs - Unit: `manage_crew` matrix check. Integration: `crewing-admin.test.ts` (9) — CRUD + delete guard, direct placement (+promotion, +active-assignment guard), strength upsert/delete, `manage_crew` gating. - `type-check` clean; full unit (241) + integration (192) green. - `CLAUDE.md` updated; wiki §12 records this surface. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Closes **Epic L — Reference data & admin** (#86).
shad0w added 1 commit 2026-06-22 15:53:51 +00:00
feat(crewing): admin crew management — direct placement, CRUD, strength config
All checks were successful
PR checks / checks (pull_request) Successful in 39s
PR checks / integration (pull_request) Successful in 28s
bb5f4126b0
Office/admin crewing-management surface behind a new manage_crew permission
(Manager + SuperUser + Admin). Stacks on 4b. Behind NEXT_PUBLIC_CREWING_ENABLED.

What's in
- Permission: manage_crew added to the §6 matrix (MGR/SU/ADMIN).
- Direct placement (placeCrew): a Manager assigns a crew member to a vessel/site
  WITHOUT a requisition — creates an ACTIVE CrewAssignment, promotes a candidate to
  EMPLOYEE with a CRW- number (generateEmployeeId), blocked if already actively
  assigned.
- Admin crew CRUD: createCrewMember / updateCrewMember / deleteCrewMember (delete
  blocked when assignments/applications exist).
- Crew strength config: upsert/delete VesselRankRequirement (the minStrength that
  drives R6 leave-clash detection).
- Screens under Administration (flag-gated, MGR/SU/ADMIN): /admin/crew (list + add/
  edit/delete + Place modal) and /admin/crew-strength (requirement table + form).

Tests & docs
- Unit: permissions-crewing.test.ts gains a manage_crew check. Integration:
  crewing-admin.test.ts (9) — CRUD, delete guard, direct placement (+promotion,
  +active-assignment guard), strength upsert/delete, manage_crew gating.
  type-check clean; full unit (241) + integration (192) green.
- CLAUDE.md updated with the crewing-admin surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w added 1 commit 2026-06-22 18:51:58 +00:00
shad0w force-pushed feat/crewing-admin from 3403d717a1 to bb5f4126b0 2026-06-22 18:52:07 +00:00 Compare
shad0w added 1 commit 2026-06-22 18:52:15 +00:00
Merge branch 'feat/crewing-leave-attendance' into feat/crewing-admin
All checks were successful
PR checks / checks (pull_request) Successful in 39s
PR checks / integration (pull_request) Successful in 29s
bec8fba6f0
shad0w merged commit 589da5aa1a into feat/crewing-leave-attendance 2026-06-22 18:52:23 +00:00
Sign in to join this conversation.
No description provided.