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::controllers::mock_suotar::fixtures.

The backfill course keeps enable_credit_registration_via_suotar off and nothing may turn it on: its spec flips it from the UI, which is one-way and run-wide. Every other course has it on.

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Β§

SeededStudent πŸ”’
A seeded student, with the deterministic id a spec navigates by.

ConstantsΒ§

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.
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Β§

credit_registration_config πŸ”’
Turns the module on and points it at the mock’s realisation for the same course code.
insert_registered_attempt πŸ”’
insert_student πŸ”’
instance_config πŸ”’
link_student_number πŸ”’
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.
seed_backfill_course πŸ”’
Four passed completions, one already registered by the legacy pull flow so the backfill spec can assert it is skipped rather than re-pushed.
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_fast_track_near_misses πŸ”’
The accounts that make the fast track not fire, one per reason it may refuse. Each holds a confirmed address, so what separates them is only the thing under test; the twin above is the unconfirmed case. None of them is given a completion: being on the registry’s roster is all it takes to be offered to the fast track.
seed_frozen_registration πŸ”’
One student, one completion and one ledger row parked in state.
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_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: student numbers 9000010xx.
seed_retry_course πŸ”’
Rows a teacher may put back on the queue and rows they may not.
seed_spec_account πŸ”’
The same, without a student number: whoever is meant to be discovered and mailed.
seed_spec_student πŸ”’
A user, an enrolment and a verified student number for one spec’s actor.
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 grade-improvement specs get an attempt chain without driving a regrade first.