Skip to main content

Module credit_registrations

Module credit_registrations 

Source
Expand description

The credit registration ledger.

transition is the only writer of state, stamping state_entered_at, the lifecycle timestamps and the audit event in one transaction. Policy — which transition to make, how to back off, grade mapping, enrolment choice — lives in the state machine, not here.

Structs§

CreditRegistration
NewCreditRegistration
PayloadSnapshot
Frozen copy of what we are about to submit. Written once, before the row leaves checking_enrolment: a later regrade must not alter a submitted row.
Transition

Enums§

CreditRegistrationErrorCode
Why a ledger row is where it is; state says what happens to it next.
CreditRegistrationState
What the pipeline does next with a ledger row.

Functions§

claim_due
Claims up to limit due rows in the given states for this worker.
count_by_state
Live rows per state, for the dashboard funnel.
dismiss_enrolment_banner
The student dismissed the in-course-material re-enrol banner for this registration.
get_all_attempts_by_completion_id
Every attempt for a completion, newest first. Superseded rows are included on purpose: if Sisu ended up holding both attainments the student must see both.
get_by_course_id
get_by_id
get_by_ids
get_by_user_id
get_live_by_completion_id
The live (non-superseded) row for a completion.
import_request_item_id
The item id Suotar sees for the import and resolve calls. Deterministic, so a Suotar log line maps to exactly one ledger row without an id allocation table.
increment_submit_retry_count
increment_verify_attempt_count
insert
Creates a ledger row at pending_prerequisites with a created event. The id is allocated here because request_item_id derives from it.
mark_superseded
Points an old attempt at the newer one that replaced it. The old row keeps its state and terminal_at: it really was registered.
schedule_next_attempt
Defers when the pipeline may next claim this row; the delay is the caller’s policy.
set_needs_admin_attention
set_payload_snapshot
set_sisu_attainment
set_submitted_attainment
transition
Moves a ledger row to a new state and appends the matching audit event, atomically.
verify_request_item_id
The item id Suotar sees for one verify poll.