Skip to content

Data shapes

This is the single-page reference for every shape used by Oversight. The narrative discussion lives in Data model; this page is the lookup.

export type Ulid = string; // 26-char Crockford Base32, URL-safe
export type IsoTimestamp = string; // ISO 8601 with offset, e.g. 2026-05-08T18:00:00Z
export type Frn = string; // FCA Firm Reference Number, 6-7 digits
export type Pence = number; // Integer GBP minor units
NameValues
Vertical"mortgage", "general-insurance", "credit-broking"
RubricCode"MCOB", "ICOBS", "CONC"
ArType"AR" (Appointed Representative), "IAR" (Introducer AR)
RiskBand"low", "moderate", "elevated", "high", "critical"
Persona"principal-admin", "principal-compliance-officer", "ar-user"
RolePersona values plus "fca-auditor"
ArStatus"active", "suspended", "under-investigation", "terminated"
BreachCategory"conduct", "financial-crime", "data-protection", "complaints-handling", "advice-suitability", "disclosure", "training-competence", "other"
BreachSeverity"minor", "moderate", "material", "significant"
BreachCustomerImpact"none", "potential", "actual-low", "actual-high"
BreachStatus"open", "in-remediation", "resolved", "closed"
FileReviewStatus"scheduled", "in-progress", "complete", "challenged"
MIReturnStatus"draft", "submitted", "queried", "accepted"
AnnualReviewStatus"draft", "in-review", "signed-off", "rejected"
ConductEventType"complaint", "training-completion", "supervision-1to1", "policy-attestation", "other"
FieldTypeSemantics
line1stringStreet address, required
line2string | nullOptional
citystringRequired
postcodestringUK postcode, validated server-side
country"GB"Literal, UK-only at v1
FieldTypeSemantics
idUlidPrimary key
typeArTypeAR or IAR
tradingNamestringCustomer-facing name
legalNamestringCompanies House name
frnFrn | nullNull for IARs (share principal’s FRN)
statusArStatusLifecycle state
permissionsPermission[]Granted regulatory permissions
citystringDemo only; production uses registeredOffice: PostalAddress
appointedOnIsoTimestampDate the AR contract started
lastAnnualReviewAtIsoTimestamp | nullDrives timeSinceLastReview risk input
nextReviewDueAtIsoTimestampCadence policy + last review
riskScorenumberComposite 0-100
riskBandRiskBandDerived from riskScore
isSelfEmployedbooleanPS22/11 enhanced-supervision flag
supportsImportantBusinessServicebooleanSYSC 15A flag
contact{ name: string; email: string }Primary contact at the AR
FieldTypeSemantics
codestringe.g. "MCOB.ARRANGE", "CONC.CREDIT_BROKING"
labelstringPlain-language label for the UI
grantedOnIsoTimestampWhen granted
revokedOnIsoTimestamp | nullNull while active
FieldTypeSemantics
idUlidPrimary key
arIdUlidSubject AR
titlestringShort headline, 4-200 chars
descriptionstringFacts, 20-10000 chars
categoryBreachCategoryTaxonomy
severityBreachSeveritySelf-assessed at filing, may be revised on triage
customerImpactBreachCustomerImpactDrives notify-FCA routing and risk weighting
awareAtIsoTimestampDrives the SUP 15 clock
reportedAtIsoTimestampWhen filed in Oversight
notifiedFcaAtIsoTimestamp | nullNull until step-up notification recorded
notifyByAtIsoTimestamp | nullComputed deadline by SUP 15.3 timing
rootCauseTaxonomystring[]Up to 8 tags
statusBreachStatusLifecycle
filedByPersonaPersonaDemo only; production uses filedBy: Ulid
FieldTypeSemantics
idUlidPrimary key
arIdUlidSubject AR
caseRefstringThe AR’s internal case reference being reviewed
reviewerNamestringDemo only; production uses reviewerId: Ulid
rubricCodeRubricCodeDetermines the rubric for this review
findingsFileReviewFinding[]Per-rubric-item outcome
scorenumber0-100 derived from findings
statusFileReviewStatusLifecycle
startedAtIsoTimestamp | nullSet on first edit
completedAtIsoTimestamp | nullSet on complete transition
rootCauseTaxonomystring[]Up to 8 tags
notesstringFree-text reviewer notes
FieldTypeSemantics
itemCodestringRubric item code, e.g. "MCOB 4.7A.2"
itemLabelstringPlain-language descriptor (denormalised for audit immutability)
outcome"pass" | "advisory" | "fail" | "n/a"Scored outcome
evidencestringReviewer’s evidence note
remediationstring | nullRequired remediation if fail
FieldTypeSemantics
idUlidPrimary key
arIdUlidSubject AR
period{ year: number; quarter: 1 | 2 | 3 | 4 }Reporting period
submittedAtIsoTimestamp | nullNull while draft
statusMIReturnStatusLifecycle
metricsMIReturnMetricsReported figures
anomalyScorenumber0-1, computed against AR’s own historic distribution
FieldTypeSemantics
newBusinessVolumeGBPPenceTotal volume in the period, integer pence
newBusinessCountnumberCount of new business cases
complaintsReceivednumberAll complaints received
complaintsUpheldnumberSubset upheld; must be <= complaintsReceived
breachesSelfReportednumberBreaches the AR self-reported in the period
conductEventsLoggednumberConduct events captured
cancellationsnumberNew-business cancellations in the period
FieldTypeSemantics
idUlidPrimary key
arIdUlidSubject AR
cycleYearnumberCalendar year of the review
statusAnnualReviewStatusLifecycle
riskTrajectory{ at: IsoTimestamp; score: number }[]Snapshot of the AR’s score history
breachSummaryRefsUlid[]Breaches in scope
fileReviewSummaryRefsUlid[]File reviews in scope
miReturnRefsUlid[]MI returns in scope
signOffByNamestring | nullDemo only; production uses signOffByUserId: Ulid
signOffAtIsoTimestamp | nullSet on sign-off
signOffNotesstringFree-text reviewer notes
FieldTypeSemantics
idUlidPrimary key
arIdUlidSubject AR
typeConductEventTypeTaxonomy
occurredAtIsoTimestampWhen the event happened
detailstringFree-text
FieldTypeSemantics
idUlidPrimary key (transient in production, derived per request)
arIdUlidOwning AR
titlestringDisplay label
dueAtIsoTimestampDue date
hrefstringSurface to land on
FieldTypeSemantics
idUlidPrimary key
atIsoTimestampWhen the action happened
actorNamestringDemo only; production uses actorUserId: Ulid | null
actorRoleRoleActing role
actionstringAction name, e.g. "breach.notify-fca"
subjectType"ar" | "breach" | "review" | "annual-review" | "mi-return" | "tenant" | "user"Subject taxonomy
subjectIdUlidSubject row

Adds tenantId: Ulid, actorUserId: Ulid \| null (replaces actorName), ip: string \| null, userAgent: string \| null, prevHash: string (SHA-256 of prior event’s hash), hash: string (SHA-256 of canonicalised JSON of this row including prevHash).

FieldTypeSemantics
idUlidPrimary key
legalNamestringCompanies House name
tradingNamestringCustomer-facing name
frnFrnPrincipal firm’s FRN
verticalVerticalDetermines default rubric
rubricRubricCodeActive rubric for file reviews
brandHexstringBrand colour hex
registeredOfficePostalAddressRequired
onboardedAtIsoTimestampWhen the tenant signed up
FieldTypeSemantics
idUlidPrimary key
tenantIdUlidTenant scope
emailstringSign-in identity, unique within tenant
displayNamestringUI-rendered name
roleRoleRBAC role
arIdUlid | nullSet when role === "ar-user", null otherwise
status"invited" | "active" | "suspended" | "off-boarded"Lifecycle
lastLoginAtIsoTimestamp | nullFor audit and session reporting
FieldTypeSemantics
idUlidPrimary key
filenamestringOriginal filename
mimeTypestringDetected at upload
bytesnumberSize after virus scan
storageKeystringObject-store key, prefixed tenant/<tenantId>/...

For the canonical Zod definitions, see Data model: Zod schemas. Every write route in API routes cites the schema it parses against.