Skip to main content

Module fast_track

Module fast_track 

Source
Expand description

Linking a student number without the emailed round trip, when the study registry’s primary address for a person is an address one of our accounts has proved it controls.

This is a terminal branch taken before a linking mail is claimed, never a filter in front of one: every outcome other than FastTrackDecision::Link falls through to the ordinary mailed link. The population whose two addresses differ is exactly the population the linking mail exists for, and nothing here may narrow it.

Structs§

FastTrackCandidate
What an account offers the fast track, gathered in one query so the decision below stays pure.
FastTrackLink
One person the fast track is about to link, as the caller read them off the registry’s roster.
FastTrackLookup
One roster entry to look an account up by.
RegistryName
The names the study registry holds for a listed person, for the loose name check.

Enums§

FastTrackDecision
Why the fast track did or did not fire for one listed person. Every variant but Link means the ordinary linking mail is still owed.

Constants§

MATCHED_FIELD_PRIMARY
Recorded on the link as verified_via_email_match_field. The study registry’s secondary address is self-entered, so it is never proof; the value is reserved rather than accepted.

Functions§

decide_fast_track
The whole fast-track predicate, as one pure function over facts the caller has already read.
find_fast_track_candidate
The one live account holding primary_email, with everything decide_fast_track needs. None when no account holds it, and also when more than one does — the fast track only ever acts on an unambiguous account, and ambiguity falls through to the mailed link like everything else.
find_fast_track_candidates
find_fast_track_candidate for a whole roster in one query, keyed by sisu_person_id.
fold 🔒
Casefolds and strips diacritics so Mäkelä and Makela compare equal.
link_by_email_match
Links person’s student number to candidate’s account and returns the new link’s id.
names_loosely_match 🔒
Whether the two records plausibly describe the same person: either surname or any one of the registry’s given names has to agree, ignoring case and diacritics.