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§
- Credit
Registration - NewCredit
Registration - Payload
Snapshot - 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§
- Credit
Registration Error Code - Why a ledger row is where it is;
statesays what happens to it next. - Credit
Registration State - What the pipeline does next with a ledger row.
Functions§
- claim_
due - Claims up to
limitdue 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_prerequisiteswith acreatedevent. The id is allocated here becauserequest_item_idderives 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.