Skip to main content

Module seed_credit_registration

Module seed_credit_registration 

Source
Expand description

Database rows for the credit-registration (Suotar) system tests. The identities they are built from, and the matching registry world, are in crate::mock_suotar::fixtures.

The workers tick every phase unscoped every few seconds in the test deployment, so a fixture row nothing may move has to sit on a paused module β€” that is what the states course is for.

StructsΒ§

GeneralCourse πŸ”’
LinkedStudents πŸ”’
The accounts holding a linked number, by the fixture they were built from.
SeededCourse πŸ”’
A course with an instance, for enrolling students after the course itself exists.
SeededStudent πŸ”’
A seeded student, with the deterministic id a spec navigates by.

ConstantsΒ§

CERTIFICATE_DETOUR_COURSE_ID
The certificate detour’s own course. Not in mock_suotar::fixtures with the others: this one never reaches Suotar, so the mock registry knows nothing about it.
CERTIFICATE_DETOUR_COURSE_SLUG
CRS_DETOUR_101
LINKING_TOKEN_ALREADY_USED
LINKING_TOKEN_CONFLICT
Its student number is already live on another account, so claiming it is refused without consuming the token.
LINKING_TOKEN_EXPIRED
LINKING_TOKEN_VALID
Linking tokens for suotar-account-linking.spec.ts, seeded rather than mailed.
PROFILE_EMPTY_EMAIL πŸ”’
Enrolled on the general Suotar course and nothing else, for the studies page’s empty state.
PULL_REGISTRAR_ID
A study registry registrar whose key a spec can present, so the legacy pull stream is readable from a test. Every other registrar’s key is random by design.
PULL_REGISTRAR_SECRET_KEY
SUPERSEDED_ATTEMPT_1_ID
The seeded attempt chain, by fixed id so a spec can open the detail page without searching.
SUPERSEDED_ATTEMPT_2_ID

FunctionsΒ§

account_email πŸ”’
credit_registration_config πŸ”’
Turns the module on with an enrolment link unique to its course code, without which the config check flags the module, and opts its linked students’ completions in.
default_module_id πŸ”’
enroll πŸ”’
Enrols the way a student who has been through the course’s opening dialogs is: without user_course_settings and the AI notice acknowledgement, the course pages open on a dialog.
insert_registered_attempt πŸ”’
insert_student πŸ”’
instance_config πŸ”’
link_student_number πŸ”’
module_ids_by_course_code πŸ”’
push_mock_suotar_world πŸ”’
Aligns the mock Suotar’s world with the rows just written. Nothing is cleared first: the mock installs under a fresh generation and flips the pointer last.
seed_admin_actions πŸ”’
One global_admin and one course_teacher row, so the Audit tab has content without depending on another spec having clicked something.
seed_admin_course πŸ”’
The account-linking fixtures, on a course of their own, and one linked student a tick can register.
seed_certificate_detour_course πŸ”’
Owned by completion-registration-certificate-detour.spec.ts.
seed_credit_registration
seed_eligible_completion πŸ”’
A completion the pipeline will pick up. prerequisite_modules_completed is the trap: the builder defaults it to false, and such a completion never leaves pending.
seed_frozen_registration πŸ”’
One completion and one ledger row parked in state, for student on course_module_id.
seed_general_course πŸ”’
One of the courses LANE_COMPLETIONS allocates: a single working Suotar module.
seed_grade_improvement_course πŸ”’
seed_import_outcomes_course πŸ”’
One module per failing import shape, so the spec picks its error by picking a module rather than by flipping something every other spec on the course can see.
seed_linked_students πŸ”’
Creates the credit-registration accounts and links every seeded student to its fixture’s number. student6–student8 already exist: the general user seed creates them.
seed_linking_tokens πŸ”’
emailed_to matches no seeded account on purpose: tokens are unbound, and bind to whoever opens the link while logged in.
seed_old_flow_course πŸ”’
Owned by suotar-old-flow-coexistence.spec.ts.
seed_retry_course πŸ”’
Rows a teacher may put back on the queue and rows they may not, one per holder so a spec finds each by the holder’s last name.
seed_states_course πŸ”’
Every registration state, and every error code, as a frozen row.
seed_superseded_attempt_pair πŸ”’
A registered grade-3 attempt superseded by a grade-4 one, so the admin-detail and profile specs get an attempt chain without driving a regrade first.