A status column with six string values is not a state machine. The machine is the transition relation:
fn allowed(from: Status, to: Status) -> bool {
match (from, to) {
(Status::Received, Status::Validating) => true,
(Status::Validating, Status::Submitted) => true,
(Status::Submitted, Status::Pending) => true,
(Status::Pending, Status::Confirmed) => true,
// ... every state may fail ...
_ => false,
}
}
Its value is entirely in what it returns false for. The catch-all _ => false is the design, not a formality: every edge you did not write down is refused by construction, so adding a seventh status later fails closed rather than silently permitting a dozen new transitions.
