Skip to main content

Module wire

Module wire 

Source
Expand description

The mock’s half of the moocfi endpoints: its own request and response shapes, deliberately not shared with the client so the two can disagree the way a real Suotar and our client can.

Every endpoint takes a top-level JSON array and answers with one item per request item, in order. Per-item outcomes are HTTP 200; only request-level failures are 4xx/5xx. Suotar serializes an undefined field by leaving it out and a null one as null, and the response structs keep that distinction field by field.

Structs§

AttainmentReference
AttainmentSummary
The seven fields duplicateAttainment and notImprovedAttainment report.
CourseAllowedResult
CourseCodeRequestItem
Shared by list-by-course and course-code validation, which both take only a code.
CreditRange
DatePeriod
DuplicateAttainmentResult
Enrolment
EnrolmentResolutionResult
EnrolmentsListedResult
ExistingAttainment
The importer’s attainment passed through: a course-unit attainment has no assessment item or realisation, and a missing grade leaves passed out.
ExistingAttainmentsResult
What enrolmentNotFound and enrolmentNotAccepted still hand back.
ImportAttainmentRequestItem
ItemError
ListedEnrolment
ListedPerson
LocalizedName
NotImprovedAttainmentResult
PersonResult
Exactly the four keys Suotar passes on from the importer’s person row.
RecentlySentAttainment
The five fields of the duplicateAttainment Suotar answers from its own recent sends, which names the submission rather than anything the importer has seen.
RecentlySentDuplicateResult
RegisteredResult
RequestLevelError
RequestLevelErrorBody
ResolveEnrolmentRequestItem
ResolvePersonRequestItem
ResponseItem
A request’s items are all one endpoint’s shape, but the pipeline also carries fault-shaped items and logs them, so the result is erased to JSON as soon as the logic has built it.
SubmissionPendingResult
SubmittedAttainment
VerifyAttainmentRequestItem

Enums§

Endpoint
The moocfi endpoints, keyed the way the audited client names them.
ItemStatus

Constants§

ASSESSMENT_ITEM_ATTAINMENT
COURSE_NOT_CARRIED
COURSE_UNIT_ATTAINMENT
NOT_AN_ARRAY

Functions§

canonical_message 🔒
Suotar’s fixed wording per code, endpoint being None for a request-level one. Codes whose real message names the item fall back to a generic sentence here, for a fault that names the code without a message.
iso_millis
JavaScript’s toISOString(): UTC with exactly three fractional digits.
number_when_numeric 🔒
sisu_midnight
A date the way the importer passes Sisu’s through: an instant at UTC midnight.