Skip to main content

apply_transition

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

Applies one hand action in the caller’s transaction.

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.