Skip to main content

Module student_number_change

Module student_number_change 

Source
Expand description

What changing an account’s linked student number does to its registrations: both the student’s own unlink/claim and an admin’s unlink/manual-link go through this, so the audit trail and the recompute stay in one place regardless of who acted.

Functions§

record_student_number_change
Audits a change to subject_user_id’s linked student number on every registration it can affect, then applies it. Returns how many of the account’s registrations the recompute moved.
unlink_verified_student_number
Retires a verified link and reopens every registration it had gated, as one step. Both the student’s own unlink and the admin unlink call this rather than each doing the soft-delete and the recompute themselves; callers keep owning the transaction and any admin-action row around it.