Skip to main content

Module credit_registration

Module credit_registration 

Source
Expand description

The credit registration state machine: credit_registrations::transition owns the write, this module owns the decision. A waiting row is only ever moved by the precondition recompute here or by a worker phase applying one of this module’s outcomes to an answer from the study registry.

Re-exports§

pub use pending_reason::CreditRegistrationPendingReason;
pub use pending_reason::PendingPreconditions;
pub use pending_reason::PendingReasonCounts;
pub use student_facing_status::StudentFacingCreditRegistrationStatus;

Modules§

account_linking
Claiming the right to mail a Sisu person an account-linking link, and minting the token it carries. Both caps and the dedup guard are evaluated here and nowhere else, and no argument switches them off; an override has to soft-delete a ledger row.
backoff
How long the pipeline waits before trying again. Generic scheduling math; which error codes are even retryable is super::classification.
classification
What a Suotar per-item code means: the one place the wire vocabulary is spelled out, and the one place retryability is decided. The mock Suotar’s fault validator reads it too. Timing (how long to wait) is super::backoff.
config_validation
Deciding whether one module’s credit-registration configuration is usable.
enrolment_selection
Which of a student’s enrolments the attainment is registered against. Degree before open university: a degree student who also holds an open-university study right wants the credit inside their degree.
fast_track
Linking a student number without the emailed round trip, when the study registry’s primary address for a person is an address one of our accounts has proved it controls.
grade_mapping
Our grade in the study registry’s terms. A scale or grade the registry does not know is rejected at request level, taking the whole batch of twenty-five with it, so every pair that reaches a batch has been through map_grade or is_known_grade.
legacy_mirror
Mirroring our successes into the legacy study-registry ledger. The mirror row makes the registry’s own ?exclude_already_registered=true skip the completion, keeps the teacher views’ existing registered flag working, and gives support the real student number.
materialize
Creating ledger rows for completions that are allowed to be registered. The same statement is the backfill: flipping a module on makes every pre-existing eligible completion match, and they stop at pending, because historical completions belong to students nobody ever asked.
outcomes
What one Suotar answer does to one ledger row, decided apart from the phases that apply it. No outcome here may return a state that leads back to import: a row whose import may have landed must never be sent again.
payload
The frozen copy of what we submit: written once before the row leaves enrolment resolution and never rewritten, so a later regrade cannot silently change something already sent.
pending_reason
Why a pending ledger row is still pending.
preconditions
Moving a row along, or out of, the chain of things that must be true before we submit. Decided from the database alone, so it keeps running during a Suotar outage.
student_facing_status
What a student is told about one credit registration. Computed here rather than in the frontend so a new ledger state has to be classified before it compiles.
student_notifications
The two terminal-state mails a student may get about a credit registration.
student_number_change
What changing an account’s linked student number does to its registrations: both the student’s own unlink/claim and an admin’s unlink/manual-link go through this, so the audit trail and the recompute stay in one place regardless of who acted.
submission_context
Everything a submission needs that does not live on the ledger row yet. One query rather than a lookup per row: the phases work in batches of up to a hundred.