Skip to main content

apply_transition

async fn apply_transition(
    tx: &mut PgConnection,
    row: &CreditRegistration,
    action: AdminCreditRegistrationAction,
    actor_user_id: Uuid,
    reason: &str,
) -> Result<(AdminTransitionOutcome, CreditRegistrationState, bool, bool), ControllerError>
Expand description

Applies one hand action in the caller’s transaction, returning what it did, where the row ended up, whether it still asks for a human, and whether the caller must still make it due now.

The caller has already asked admin_transition_refusal whether this row may take the move, because what a refusal is reported as differs per caller. Making the row due is left to the caller too, rather than done here, so the bulk caller can batch it over every row it applies instead of one UPDATE per row.