pub async fn claim_unnotified(
conn: &mut PgConnection,
scope: &RegistrationScope,
limit: i64,
is_account_linking_enabled: bool,
) -> ModelResult<Vec<StudentNotificationToQueue>>Expand description
Claims the rows owed a mail, locking them until the caller’s transaction ends, so callers must
pass a transaction. Never claims cancelled, blocked or any failure state: those get
nothing. Nor a duplicate or not_improved row whose student already has, or is owed, the
registered mail for another row of the module. A pending row is owed the action-needed mail
only while its student has no student number and is_account_linking_enabled, since only then
does enrolling lead to one.