Skip to main content

Module credit_registration_events

Module credit_registration_events 

Source
Expand description

Append-only audit trail for the credit registration ledger.

No retention sweep touches this table, so every Suotar payload must go through scrub_suotar_body at the write site — redacting on read would leave the raw values on disk.

Structs§

CreditRegistrationEvent
ErrorCodeWindowCounts
One error code’s standing over a window and the window before it.
NewCreditRegistrationEvent
NotImprovedAttainment
The attainment the study registry pointed at when it turned a submission down as no improvement.
SuotarItemOutcomeTotals
How the study registry answered the items it was asked about in a window.

Enums§

CreditRegistrationEventKind
SuotarAnswer
What Suotar did with one row of a request.

Functions§

count_item_outcomes_since
Per-item outcomes in [since, now), counted over events rather than rows: an item that failed really failed, whatever its row has since become.
get_by_registration_id
The per-item timeline, newest first.
get_by_suotar_api_call_id
The per-item timeline entries one study registry call produced, oldest first: what the answer did to each row it covered.
get_error_code_counts_for_window
Error events per code over [now - 2 * window, now), split at now - window.
get_ids_with_several_submitted_attainments
Registrations whose answers named more than one submitted attainment id, which is the shape a double submission would leave behind.
get_not_improved_attainment
The registry’s verdict for a row it declined as no improvement. None for every other row, and for one whose answer named no attainment.
get_request_item_ids_in_call
The requestItemId each of credit_registration_ids went out under among request_item_ids, which are one call’s. A row the call carried but no event recorded is missing from the map.
insert
Callers that also change state must go through credit_registrations::transition instead, which writes both in one transaction.
insert_batch
Appends one event per element, in one statement. The column list is insert’s, so a batch writes the same rows a loop would.
insert_many
Appends the same event to many rows in one round trip; insert_batch for events that differ.
string_field 🔒