feat(crewing): Phase 4a — crew records & profile + PPE (flagged) #69

Merged
shad0w merged 2 commits from feat/crewing-crew-records into feat/crewing-onboarding 2026-06-22 18:50:39 +00:00
Owner

Crewing — Phase 4a (Crew records & profile + PPE)

First slice of Phase 4 (4a records/profile/PPE → 4b leave/attendance → 4c sign-off/experience). Stacks on #68 (3c onboarding); base branch is feat/crewing-onboarding, so nothing reaches master yet. Behind NEXT_PUBLIC_CREWING_ENABLED.

What's in

  • Schema (crewing_crew_records migration): SeafarerDocument, NextOfKin (isEmergency), ExperienceRecord, PpeIssue (PpeItem enum) — all on CrewMember; CrewActionType += document/record/PPE/experience types. (BankDetail/EpfDetail exist from 3b.)
  • PII masking (lib/crew-pii.ts, §6/§8.8): bank account + Aadhaar full only for Accounts/SuperUser, masked (•••• 1234) otherwise; salary hidden from site staff. Applied server-side before crossing to the client.
  • Actions (crewing/crew/actions.ts): uploadDocument/deleteDocument, saveBankEpf, addNextOfKin/deleteNextOfKin, issuePpe/returnPpe, addExperience — guarded by upload_crew_records / issue_ppe; each writes a CrewAction.
  • Screens: /crewing/crew (directory — active EMPLOYEE crew, search + vessel filter; ex-hands excluded, R9) and /crewing/crew/[id] (tabbed profile: Documents · Bank & EPF · Next of kin · PPE · Experience · Pay status). Crew added to the flag-gated nav (MGR/MPO/Site/Accounts).

Tests & docs

  • Unit: crew-pii.test.ts (6). Integration: crew-records.test.ts (7) — documents, bank/EPF upsert, NoK, PPE issue/return, experience + permission gating.
  • type-check clean; full unit (240) + integration (175) green.
  • CLAUDE.md updated; wiki §12 status note bumped.

Deferred

  • Site-staff own-site scoping (§8.7) — needs a User↔Site link that isn't modelled; all crew show for now.
  • The records verify queue (§8.11) → Phase 5; the Pay-status tab shows the salary structure only until payroll wage reports (Phase 6).

Next in Phase 4: 4b leave & attendance (Epic G), then 4c sign-off & experience (Epic K).

🤖 Generated with Claude Code


Closes Epic E — Crew records & documents (#79) · Closes Epic F — PPE issue register (#80).

## Crewing — Phase 4a (Crew records & profile + PPE) First slice of **Phase 4** (4a records/profile/PPE → 4b leave/attendance → 4c sign-off/experience). Stacks on **#68** (3c onboarding); base branch is `feat/crewing-onboarding`, so nothing reaches `master` yet. Behind `NEXT_PUBLIC_CREWING_ENABLED`. ### What's in - **Schema** (`crewing_crew_records` migration): `SeafarerDocument`, `NextOfKin` (`isEmergency`), `ExperienceRecord`, `PpeIssue` (`PpeItem` enum) — all on `CrewMember`; `CrewActionType +=` document/record/PPE/experience types. (`BankDetail`/`EpfDetail` exist from 3b.) - **PII masking** (`lib/crew-pii.ts`, §6/§8.8): bank account + Aadhaar full only for **Accounts/SuperUser**, masked (`•••• 1234`) otherwise; salary hidden from **site staff**. Applied **server-side** before crossing to the client. - **Actions** (`crewing/crew/actions.ts`): `uploadDocument`/`deleteDocument`, `saveBankEpf`, `addNextOfKin`/`deleteNextOfKin`, `issuePpe`/`returnPpe`, `addExperience` — guarded by `upload_crew_records` / `issue_ppe`; each writes a `CrewAction`. - **Screens:** `/crewing/crew` (directory — active `EMPLOYEE` crew, search + vessel filter; ex-hands excluded, R9) and `/crewing/crew/[id]` (tabbed profile: Documents · Bank & EPF · Next of kin · PPE · Experience · Pay status). **Crew** added to the flag-gated nav (MGR/MPO/Site/Accounts). ### Tests & docs - Unit: `crew-pii.test.ts` (6). Integration: `crew-records.test.ts` (7) — documents, bank/EPF upsert, NoK, PPE issue/return, experience + permission gating. - `type-check` clean; full unit (240) + integration (175) green. - `CLAUDE.md` updated; wiki §12 status note bumped. ### Deferred - Site-staff **own-site scoping** (§8.7) — needs a User↔Site link that isn't modelled; all crew show for now. - The records **verify queue** (§8.11) → Phase 5; the **Pay-status** tab shows the salary structure only until payroll wage reports (Phase 6). Next in Phase 4: **4b leave & attendance** (Epic G), then **4c sign-off & experience** (Epic K). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Closes **Epic E — Crew records & documents** (#79) · Closes **Epic F — PPE issue register** (#80).
shad0w added 1 commit 2026-06-22 13:57:46 +00:00
feat(crewing): Phase 4a — crew records & profile + PPE (flagged)
All checks were successful
PR checks / checks (pull_request) Successful in 40s
PR checks / integration (pull_request) Successful in 28s
37b1debc9d
First slice of Phase 4 (stacked on 3c onboarding). The Crew directory and tabbed
crew profile with documents, bank/EPF (role-masked), next of kin, PPE and
experience, per Crewing-Implementation-Spec §8.7–8.8. Behind
NEXT_PUBLIC_CREWING_ENABLED; production unchanged.

What's in
- Schema (crewing_crew_records migration): SeafarerDocument, NextOfKin
  (isEmergency), ExperienceRecord, PpeIssue (PpeItem enum) — all on CrewMember;
  CrewActionType += DOCUMENT_UPLOADED/RECORD_UPDATED/PPE_ISSUED/PPE_RETURNED/
  EXPERIENCE_ADDED.
- PII masking (lib/crew-pii.ts, §6/§8.8): bank account + Aadhaar full only for
  Accounts/SuperUser, masked otherwise; salary hidden from site staff. Applied
  server-side before crossing to the client.
- Actions (crewing/crew/actions.ts): uploadDocument/deleteDocument, saveBankEpf,
  addNextOfKin/deleteNextOfKin, issuePpe/returnPpe, addExperience — guarded by
  upload_crew_records / issue_ppe, each writes a CrewAction.
- Screens: /crewing/crew (directory, search + vessel filter, ex-hands excluded)
  and /crewing/crew/[id] (tabbed profile: Documents · Bank & EPF · Next of kin ·
  PPE · Experience · Pay status). Crew added to the flag-gated nav (MGR/MPO/Site/
  Accounts).

Tests & docs
- Unit: crew-pii.test.ts (6). Integration: crew-records.test.ts (7) — documents,
  bank/EPF upsert, NoK, PPE issue/return, experience + permission gating.
  type-check clean; full unit (240) + integration (175) green.
- CLAUDE.md updated with the Phase 4a surface.

Deferred: site-staff own-site scoping (needs a User↔Site link); the records verify
queue (§8.11, Phase 5); Pay-status shows the salary structure only until payroll
(Phase 6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w added 1 commit 2026-06-22 18:50:21 +00:00
Merge branch 'feat/crewing-onboarding' into feat/crewing-crew-records
All checks were successful
PR checks / checks (pull_request) Successful in 38s
PR checks / integration (pull_request) Successful in 29s
23ec2b91ea
shad0w merged commit 378400391a into feat/crewing-onboarding 2026-06-22 18:50:39 +00:00
Sign in to join this conversation.
No description provided.