Plan statuses and review actions
Plan statuses
| Status | Stage | Meaning |
|---|---|---|
draft | Review | Plan created; lines not yet edited |
in_review | Review | At least one line reviewed |
review_complete | Review | All lines reviewed; ready to submit |
validating | Validate | Allocator running |
validated_ok | Preview | All approved lines fully allocated |
validated_partial | Preview | Some lines partially allocated |
validated_failed | Preview | No lines allocated |
finalizing | Finalize | STR creation in progress |
finalized | Finalize | Transfers created |
cancelled | — | Plan cancelled (terminal) |
Review statuses (per line)
| Status | Badge colour | Set when |
|---|---|---|
pending_review | Slate | Line not yet actioned |
approved | Green | Reviewed qty = suggested qty |
reduced | Yellow | Reviewed qty < suggested |
increased | Purple | Reviewed qty > suggested |
rejected | Red | Reviewed qty = 0 |
deferred | Amber | Auto- or manually deferred (redundant source) |
Allocation statuses (post-validation)
| Status | Meaning |
|---|---|
not_validated | Before submit |
fully_allocated | Approved qty fully covered from source |
partially_allocated | Some units short |
unfulfilled | Zero units allocated |
skipped | Line excluded from allocation |
Review reason codes
Required when reduced or increased vs suggested:
| Code | Use when |
|---|---|
clinical_priority | Clinical need overrides algorithm |
shelf_space | Destination cannot hold full suggested qty |
expiry_risk | Avoid moving near-expiry stock |
supplier_constraint | Supply chain limitation |
other | Any other documented reason (remark recommended) |
Counter tiles (Plan Review)
| Tile | Counts lines where review_status = |
|---|---|
| Approved | approved |
| Reduced | reduced |
| Increased | increased |
| Rejected | rejected |
| Deferred | deferred |
| Pending | pending_review |
Key actions
| Button | Permission | Effect |
|---|---|---|
| Submit for validation | auto_str.plan.submit | Runs validate_auto_str_plan |
| Finalize → create STRs | auto_str.plan.finalize | Creates stock_transfers |
| Re-open review | auto_str.plan.reopen | Status → in_review |
| Cancel plan | auto_str.plan.cancel | Status → cancelled |