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§
- Claim
Student Number Verification Token Result - Linking
Email Status - What we can honestly say about the linking mail: our send status, never a delivery.
- Linking
Mail 🔒Cache - 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.
- Main
Frontend 🔒Credit Registrations ApiDoc - MyCredit
Registration - MyCredit
Registration ForCourse Module - The live registration for one course module, with the attempts a newer one replaced.
- MyVerified
Student Number - The account’s linked student number, unmasked: it is the holder’s own.
- Notification
Email Status - 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.
- Request
Credit Registration Enrolment Recheck Result - Student
Number Verification Token Preview - What a mailed link would do, without doing it. Read-only on purpose: a mail scanner must not be able to spend the token.
- Unlink
MyStudent Number Result
Enums§
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.
Nonefor 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.