feat(crewing): Phase 1 foundations — SITE_STAFF role, ranks reference data + admin (flagged) #64
No reviewers
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#64
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/crewing-foundations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Crewing — Phase 1 (Foundations)
First slice of the Crewing module per the wiki Crewing-Implementation-Spec (§12 build order). Everything is dark behind
NEXT_PUBLIC_CREWING_ENABLED(off by default), so production is unchanged. Schema is added incrementally per phase — this PR lands only the reference-data layer.What's in
SITE_STAFFadded to theRoleenum (PM/APM/Site In-charge logins; MPO staysMANNING).Rank(self-referential org hierarchy, likeAccount) +RankDocRequirement;RankCategory&SeafarerDocTypeenums. Migrationcrewing_foundations.PO_ROLE_PERMISSIONS+CREWING_ROLE_PERMISSIONSmerged). MPO has no attendance/leave; approvals/selection are Manager-only;manage_ranks= Manager + Admin.CREWING_ENABLED(opt-in"true").rank-data.ts+rank-doc-data.tsseeded via sharedseed-ranks.tsin dev and prod seeds (19 ranks, 118 doc requirements)./admin/ranks— rank-hierarchy card (with thegrantsLoginflag shown) + per-rank required-documents card, full CRUD.Tests & docs
permissions-crewing.test.ts— verifies the §6 matrix cells + the flag default.admin-ranks.test.ts— ranks CRUD, parent linking, cycle/children guards, doc-requirement upsert/remove, permission gating (8 tests).CLAUDE.md"Crewing (feature-flagged)" section + env var.Verification
db:migrateapplies cleanly ·db:seed→ 19 ranks / 118 requirements ·type-checkclean · unit suite green (incl. 10 new) ·admin-ranksintegration 8/8 ·/admin/ranksrenders for a Manager with the flag on, no console errors.🤖 Generated with Claude Code
Part of Epic L — Reference data & admin (#86).