Expand description
Client for Suotar, the University of Helsinki study registry.
Every endpoint is a batch. Per-item outcomes arrive as HTTP 200 and are read from each item’s
status and code; only request-level failures are 4xx/5xx and Err. Items are matched back
by requestItemId, never by position.
The mock study registry serializes these same types, so skip_serializing_if here is what keeps
its bodies byte-identical to Suotar’s.
Macros§
Structs§
- Credit
Range - Date
Period - Enrolment
Resolution Result - Enrolments
Listed Result - Existing
Attainment - Import
Attainment Request Item - Import
Attainment Result - One shape for import’s four success codes:
sentfills the submitted pair,registeredandduplicateAttainmentfillattainment,notImprovedAttainmentfillsprevious_attainment. - List
ByCourse Request Item - Listed
Enrolment - Listed
Person - Localized
Name - NoSuotar
Call Audit - Person
Result - Product
Access Token Request Item - Product
Access Token Result - Request
Level 🔒Error Body - Request
Level 🔒Error Detail - Resolve
Enrolment Request Item - Resolve
Person Request Item - Suotar
Attainment - Covers both contract bodies: the bare
{id, type}of aregisteredanswer and the fuller one behindduplicateAttainmentandnotImprovedAttainment. - Suotar
Batch Response - Suotar
Call Context - Both fields are audit-row columns:
worker_nameseparates the submitter from the verify poller from a manual retry, and the ids replace the identifiers scrubbing removes from stored bodies. - Suotar
Call Finished - Suotar
Call Started - Suotar
Client - Suotar
Enrolment - Suotar
Item Error - Suotar
Response Item - Verify
Attainment Request Item - Verify
Attainment Result
Enums§
Constants§
- CORRELATION_
ID_ HEADER - Carries
suotar_api_calls.idso Suotar’s log and ours join on one value. - MAX_
REQUEST_ BODY_ BYTES - Matches the actix payload limit the mock Suotar runs behind, so an oversized batch is refused here rather than 413’d at the far end.
- SUOTAR_
REQUEST_ TIMEOUT - Bounds one call so a Suotar that never answers cannot stall a worker tick.
- TRANSIENT_
ITEM_ CODE - The only code the contract classifies as “transient, retry me”.
Traits§
- Suotar
Call Audit - Persists one
suotar_api_callsrow per call. A trait because the table is in the models crate, which depends on this one. Implementations must scrub the bodies. - Suotar
Request Item - Sent verbatim from
credit_registrations.request_item_id; Suotar echoes it back, which is what makes a reordered or partial response safe to read.
Functions§
- authorization_
header_ 🔒value - Suotar’s legacy study-registry path takes the token verbatim after the scheme word, not base64
of
user:password. - body_
for_ 🔒audit - A body that is not JSON is still worth keeping; the scrubber takes a bare string too.
- check_
batch 🔒 - Refuses our own bugs before a request goes out; both would come back as a request-level error rejecting the whole batch.
- empty_
batch_ 🔒response - An empty array is a request-level error at the far end, so an empty batch is never sent and leaves no audit row.
- failed 🔒
- reconcile 🔒
- Pairs the response against what was sent by
requestItemId; order is not consulted. - request_
level_ 🔒error - transport_
variant 🔒 is_connectis the one case where the request provably never reached Suotar; everything else, a timeout above all, may have been processed.