fix: enforce lifecycle gate on staff shift self-withdrawal #291
No reviewers
Labels
No labels
agent:hermes
bug
chore
dependency
feature
status:blocked
status:in-progress
status:needs-info
status:needs-review
status:ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
owlburtoe/Shiftd!291
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/shift-withdrawal-lifecycle-gate"
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?
Summary
open,open_self_signup,open_supplemental,open_call, andpublishedwith an active supplemental window. Scheduler/admin unassigns are unaffected.isStaffWithdrawable()helper added to backendschedule-lifecycle.ts; lifecycle check added to theunassignhandler before the engine is invoked.scheduleStatus+canWithdrawthreaded throughEnrichedShift→MySignedUpEntryviauseMySchedule/useShiftSignupCalendar/buildShiftSignupCalendarView.SignedUpShiftAccordionItemrenders a "signup window has closed" message instead of the Withdraw button whencanWithdrawis false.isPublishedfilter) withcanWithdraw: true.Test plan
pnpm test:backend:db— 8 new cases covering all lifecycle states, published+supplemental active/expired, scheduler bypasspnpm vitest run src/lib/shiftSignup/— 3 new cases covering visibility andcanWithdrawcomputationopen_self_signup, sign up for a shift, verify Withdraw button showsadmin_adjustment, revisit Shift Signup → verify button replaced by "signup window has closed" messagea0d04d22296581848a55