pub async fn transition(
conn: &mut PgConnection,
id: Uuid,
transition: &Transition,
) -> ModelResult<CreditRegistration>Expand description
Moves a ledger row to a new state and appends the matching audit event, atomically.
Also stamps, so callers must not: state_entered_at (every call, including a self-transition),
terminal_at (set on entry to a terminal state, cleared on leaving one), first_failed_at (the
first failure only), registered_at, submitted_at, enrolment_checked_at (on leaving
checking_enrolment), and clears enrolment_banner_dismissed_at on entry to
no_usable_enrolment so a fresh enrolment problem shows the banner again.