Focus for this part
This placeholder captures the order lifecycle and how admin actions map to safe transitions.
Placeholder implementation notes
- Restrict invalid status jumps.
- Persist who performed each admin action.
- Surface clear reason fields for rejected orders.
// Placeholder transition guard
const canTransition = (from: string, to: string) => {
const allowed: Record<string, string[]> = {
pending: ['in_progress', 'rejected'],
in_progress: ['delivered'],
};
return allowed[from]?.includes(to) ?? false;
};
Next part idea
Part 3 will cover receipt verification UX and reconciliation edge cases.