feat(po): cancel POs + optional supersede link (#53) #56
No reviewers
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
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#56
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/po-cancel-supersede"
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?
Closes #53.
What
Managers and superusers can cancel a PO from any state, and optionally link a cancelled PO to the existing PO that supersedes it.
Behaviour (per the #53 answers)
canceland a mandatory reason. TerminalCANCELLEDstatus; submitter + Accounts notified; audit row logged.cancel_po→ MANAGER + SUPERUSER.CANCELLED, which is absent fromPOST_APPROVAL_STATUSESand every spend whitelist, so the value drops out of all trackers/graphs automatically.Changes
POStatus.CANCELLED;cancelledAt/cancellationReason; self-referentialsupersededById;ActionType.CANCELLED/SUPERSEDED(+ migration).lib/po-state-machine.tscanCancel;cancel_popermission;PO_CANCELLEDnotification.cancelPo/supersedePoserver actions.CANCELLEDentries across all status label/variant maps.Verification
pnpm type-checkclean;pnpm testgreen (185 unit).cancel-supersede.test.ts— 10 tests, all passing against a fresh migrated+seeded DB (cancel from any state, reason/role guards, already-cancelled, spend-exclusion, supersede + reciprocal, not-cancelled/unknown/self guards).🤖 Generated with Claude Code