Skip to main content

Module credit_registrations

Module credit_registrations 

Source
Expand description

Handlers for HTTP requests to /api/v0/main-frontend/credit-registrations.

Every handler filters by user.id in SQL and re-checks ownership before it writes. The stage a student is shown is StudentFacingCreditRegistrationStatus, computed in the models crate and never re-derived here.

Structs§

ClaimStudentNumberVerificationTokenResult
LinkingEmailStatus
What we can honestly say about the linking mail: our send status, never a delivery.
LinkingMailCache 🔒
An account’s linking mails and their send status, fetched once per request rather than once per row: they are the same for every one of a student’s rows.
MainFrontendCreditRegistrationsApiDoc 🔒
MyCreditRegistration
MyCreditRegistrationForCourseModule
The live registration for one course module, with the attempts a newer one replaced.
MyVerifiedStudentNumber
The account’s linked student number, unmasked: it is the holder’s own.
NotificationEmailStatus
The same, for one of the two terminal-state mails. No address: these go to the account’s own, which the reader either owns or already sees.
RequestCreditRegistrationEnrolmentRecheckResult
StudentNumberVerificationTokenPreview
What a mailed link would do, without doing it. Read-only on purpose: a mail scanner must not be able to spend the token.
UnlinkMyStudentNumberResult

Enums§

ClaimStudentNumberVerificationTokenOutcome

Constants§

ENROLMENT_RECHECK_MIN_INTERVAL_SECS 🔒
How long after the last enrolment check the student may ask us to look again. The pipeline’s own recheck is daily, so this only bounds the button.

Functions§

_add_routes
build_my_credit_registrations 🔒
Assembles the wire rows for one account, adding the enrolment link and the linking-mail status the ledger does not carry.
claim_student_number_verification_token
POST /api/v0/main-frontend/credit-registrations/student-number-verifications/{token}/claim - Spends a mailed link and links the student number to the signed-in account.
course_name_of_token 🔒
dismiss_credit_registration_enrolment_banner
POST /api/v0/main-frontend/credit-registrations/my/{id}/dismiss-enrolment-banner - Puts away the in-course re-enrol banner for one registration.
dismiss_my_auto_link_notice
POST /api/v0/main-frontend/credit-registrations/my/student-number/dismiss-auto-link-notice - Puts away the notice saying the pipeline linked this student number without asking.
find_conflicting_account 🔒
Whether the token’s holder is already live on some other account of ours.
get_my_credit_registration_enrolment_banners
GET /api/v0/main-frontend/credit-registrations/my/enrolment-banners/by-course/{course_id} - The caller’s registrations on one course that owe them the in-course re-enrol banner.
get_my_credit_registration_for_course_module
GET /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id} - The signed-in account’s registration for one course module, or null when the pipeline has not created one yet.
get_my_credit_registrations
GET /api/v0/main-frontend/credit-registrations/my - Every credit registration of the signed-in account, newest completion first.
get_my_verified_student_number
GET /api/v0/main-frontend/credit-registrations/my/student-number - The student number linked to the signed-in account, or null.
get_token_or_404 🔒
mask_email 🔒
Keeps the domain and drops the local part: enough to recognise which mailbox to open, not a new disclosure of an address. Teachers get the same masking; only admins see an address in full.
preview_student_number_verification_token
GET /api/v0/main-frontend/credit-registrations/student-number-verifications/{token} - What the mailed link would link, without linking it.
request_credit_registration_enrolment_recheck
POST /api/v0/main-frontend/credit-registrations/my/{id}/recheck-enrolment - Asks the pipeline to look for an enrolment again, for a row parked because the study registry had none.
resolve_enrolment_link 🔒
The enrolment page for the module’s open university product, cached per product because several of a student’s rows can share one.
resolve_linking_email 🔒
The latest linking mail for this account’s Sisu person on this course. None for an account that was never linked: the mail is addressed to a Sisu person, not to an email address.
to_my_credit_registration 🔒
to_my_verified_student_number 🔒
unlink_my_student_number
DELETE /api/v0/main-frontend/credit-registrations/my/student-number - Unlinks the student number from the signed-in account.