feat(crewing): Phase 4b — leave & attendance (flagged) #70
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#70
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/crewing-leave-attendance"
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 4b (Leave & attendance)
Second slice of Phase 4 (4a records → 4b leave/attendance → 4c sign-off). Stacks on #69 (4a crew records); base
feat/crewing-crew-records, so nothing reachesmasteryet. BehindNEXT_PUBLIC_CREWING_ENABLED.What's in
LeaveRequest(LeaveType/LeaveStatus) +Attendance(AttendanceStatus, unique per assignment+date) onCrewAssignment;VesselRankRequirement{vesselId,rankId,minStrength}; newCrewActionTypes.apply_leave); the Manager decides (decide_leave) → assignmentON_LEAVE; MPO has no leave role. Also in the central/approvalsqueue (§8.13 "Leave" kind, inline Approve/Decline). NotificationLEAVE_FOR_APPROVAL.lib/leave-clash.tsflags a clash when approving a leave would drop active same-rank cover over the window below the configuredVesselRankRequirement.minStrength(default 1 when unconfigured) → auto-raises aLEAVErequisition via the Phase-2autoRaiseRequisition.record_attendance), Manager views only (view_attendance), MPO neither.saveAttendancebulk-upserts dirty cells./crewing/leave+/crewing/attendance; Leave + Attendance added to the flag-gated nav (Manager + Site staff).Tests & docs
leave-attendance.test.ts(8) — apply/decide, clash auto-raise (default + configured strength) and no-raise-when-cover-remains, MPO/Manager attendance lockout, permission gating.type-checkclean; full unit (240) + integration (183) green.CLAUDE.mdupdated; wiki §12 status note bumped.Follow-up (next PR)
The office UI to manage
VesselRankRequirement, Manager direct crew placement (no requisition), and Admin crew CRUD land in a stackedcrewing-adminPR behind a newmanage_crewpermission.🤖 Generated with Claude Code
Closes Epic G — Leave & attendance (#81).
Replace the implicit "strength = 1" clash rule with a configurable per-vessel, per-rank requirement (director decision). Adds VesselRankRequirement {vesselId, rankId, minStrength} (migration crewing_vessel_rank_requirement) and reworks lib/leave-clash.ts → leaveCausesClash: a leave approval clashes when the remaining active same-rank cover over the window would fall below minStrength (default 1 when unconfigured), auto-raising a LEAVE requisition. The requirement is managed by the office (manage_crew, admin UI in the follow-up). - Integration: leave-attendance.test.ts gains a configured-strength case (minStrength 2, one remaining → clash). Full unit (240) + integration (183) green. - CLAUDE.md updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>b31cfc6ab8to040a66488d