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
CreditRegistrationSettings
Deployment-wide switches the credit registration views adapt to.
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 🔒
MyCreditJustification
What the caller wrote about needing the credits rather than a certificate.
MyCreditRegistration
MyCreditRegistrationForCourseModule
The live registration for one course module, with the attempts a newer one replaced.
MyEnrolmentRoute
The caller’s answer about where they enrol one module, and whether it can still be changed.
MyVerifiedStudentNumber
The account’s linked student number, unmasked: it is the holder’s own. Deliberately carries no Sisu-held names.
RequestCreditRegistrationEnrolmentRecheckResult
SetCreditJustificationPayload
SetEnrolmentRoutePayload
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. Deliberately carries no Sisu-held names.
UnlinkMyStudentNumberResult

Enums§

ClaimStudentNumberVerificationTokenOutcome

Constants§

CREDIT_JUSTIFICATION_MAX_LENGTH 🔒
Long enough for the few sentences the question asks for; a bound at all so a scripted client cannot park a book in the column.

Functions§

_add_routes
book_roster_listing_for_unlinked_student 🔒
With account linking on, books a roster listing for a student we hold no number for; see book_listing_for_unlinked_student.
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.
build_my_enrolment_route 🔒
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.
confirm_my_enrolment
POST /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/enrolment-route/confirm
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.
find_conflicting_account 🔒
Whether the token’s holder is already live on some other account of ours.
get_credit_registration_settings
GET /api/v0/main-frontend/credit-registrations/settings - Deployment-wide credit registration switches.
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_enrolment_route
GET /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/enrolment-route
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 🔒
my_completion_for_module 🔒
The caller’s completion for a module, as my_registration_completion_for_module, but only on the push path.
my_enrolment_route 🔒
Kept apart from build_my_enrolment_route so a write can answer from the row it already returned, instead of reading the completion and the registration back a second time.
my_live_registration_for_module 🔒
The caller’s live registration for a module, or None before the pipeline has created one.
my_registration_completion_for_module 🔒
The caller’s completion for a module, whichever registration path it is on, which is also the ownership check: the lookup is scoped to their own user, so a module someone else completed is a not-found rather than a forbidden.
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.
record_my_enrolment_page_visit
POST /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/enrolment-page-visit
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_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.
set_my_credit_justification
PUT /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/credit-justification
set_my_enrolment_route
PUT /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/enrolment-route
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.
withdraw_my_enrolment_confirmation
DELETE /api/v0/main-frontend/credit-registrations/my/by-course-module/{course_module_id}/enrolment-route/confirm