Reference

Data model

The shape of the entities behind the Bedrock API. Sourced from packages/db/prisma/schema.prisma.

These tables describe the public-facing entities. Internal control-plane tables (webhook delivery logs, SLA monitor state, Bedrock staff admin records, etc.) are intentionally omitted — they are not part of the API contract and may change without notice.

Every type name in the tables below is a link: named enums go to the enums reference, and named entities link back to their own section on this page. Primitive types (String, Int, DateTime, Json, Boolean) are rendered as plain text.

Firm

A regulated entity. The unit of tenancy — every other record is scoped to a firm.

FieldTypeNote
idStringuuid
nameString
frnNumberStringFCA Firm Reference Number, unique
planFirmPlan
webhookSecretStringHMAC secret for webhook signatures
enforceImpactAssessmentsBooleanWhen true (default), jobs declaring a modelProvider/modelVersion are gated on a matching APPROVED ImpactAssessment. Toggling emits FIRM_SETTINGS_UPDATED.
createdAtDateTime
updatedAtDateTime

User

A human with access to one firm. Covers firm admins, reviewers, and lead reviewers.

FieldTypeNote
idString
firmIdStringFK → Firm
nameString
emailStringunique
fcaRefString?Individual Reference Number (IRN)
qualificationsReviewerQualification[]
roleUserRole
cognitoUserIdString?unique; populated after first sign-in
isAvailableBoolean
specialistVulnerabilityBooleanFG21/1 specialist flag
invitedAtDateTime
activatedAtDateTime?
deactivatedAtDateTime?
activeJobIdString?
createdAtDateTime

ApiKey

A programmatic credential scoped to a firm. The raw key is never stored — only its SHA-256 hash.

FieldTypeNote
idString
firmIdStringFK → Firm
keyHashStringsha256 of the full key, unique
lastFourCharsStringe.g. "a8c4", for display in the settings UI
nameStringhuman-assigned label
createdAtDateTime
lastUsedAtDateTime?
revokedAtDateTime?

LedgerRecord

A single entry on the firm’s hash chain. Append-only: once written, never updated or deleted.

FieldTypeNote
idString
firmIdStringFK → Firm
sequenceNumberIntmonotonic per firm, unique with firmId
eventTypeLedgerEventType
actorIdStringuser id, api key id, or "system"
actorNameString
actorFcaRefString?
documentHashStringsha256 of the event-specific document snapshot
documentMetadataJson
previousHashStringchainHash of the previous record, or GENESIS_HASH
recordHashStringsha256 of the canonicalised record
chainHashStringsha256(previousHash + recordHash)
timestampStringISO 8601
signatureStringECDSA P-256 signature over recordHash
publicKeyStringbase64 signing key used for this record
reviewJobIdString?FK → ReviewJob, where applicable

ReviewJob

A job moving through the Principal review workflow. One per submitted advice record.

FieldTypeNote
idString
firmIdStringFK → Firm
documentReferenceStringfirm-assigned stable identifier
documentTypeDocumentType
documentUrlString
documentHashStringsha256 of the original upload
clientReferenceStringfirm-assigned client id (not a name)
factFindSummaryJson
vulnerabilityFlagsVulnerabilityFlag[]FG21/1 drivers
requiresSeniorSignOffBooleanauto-true when any vulnerability flag set
clientSegmentsJsonanonymised categories for bias monitoring
modelProviderString?e.g. "openai"
modelVersionString?e.g. "gpt-4o-2024-08-06"
modelConfigurationJson
submittedAtStringISO 8601
slaDeadlineStringISO 8601
statusReviewStatus
priorityReviewPriority
assignedReviewerIdString?FK → User
assignedAtString?
completedAtString?
outcomeReviewOutcome?
outcomeReasonString?
modificationsString?verbatim reviewer modifications
certificateIdString?FK → Certificate, unique

ReviewAction

A captured reviewer interaction with a job — every click, scroll, and annotation.

FieldTypeNote
idString
reviewJobIdStringFK → ReviewJob
reviewerIdStringFK → User
actionTypeReviewActionType
metadataJson
timestampStringISO 8601

Certificate

A thin envelope around a LedgerRecord. Polymorphic: any compliance-relevant ledger event can carry a certificate. Cryptographic proof (hashes, signature, public key) lives on the linked record. Event-specific content captured at issue time lives in the metadata blob, projected from the record by an event-typed assembler.

FieldTypeNote
idString
ledgerRecordIdStringFK → LedgerRecord; unique (1:1)
firmIdStringFK → Firm
firmNameStringdenormalised for offline verification
firmFrnNumberStringdenormalised
issuedAtStringISO 8601
verificationUrlStringpublic verify.bedrockcompliance.co.uk URL
pdfUrlString
pdfStorageKeyStringS3 key inside the certificate bucket
metadataJsonevent-specific snapshot — eventLabel, optional statusPill, sections of labelled fields. Shape determined by the assembler that produced it.

WebhookEndpoint

A firm’s subscription to ledger events. Delivery is recorded in WebhookDelivery (internal, not documented).

FieldTypeNote
idString
firmIdStringFK → Firm
urlString
secretStringHMAC secret for signature header
eventsLedgerEventType[]
isActiveBoolean
createdAtDateTime

ImpactAssessment

A Consumer Duty impact assessment for an AI use case. Approval anchors a hashed snapshot to the immutable ledger as IMPACT_ASSESSMENT_APPROVED. APPROVED and SUPERSEDED rows are immutable.

FieldTypeNote
idString
firmIdStringFK → Firm
useCaseStringshort title (e.g. 'GPT-4 fact-find summariser')
descriptionString
modelProviderString?optional; pair with modelVersion to feed the impact-assessment enforcement gate
modelVersionString?
templateVersionIntcurrently 1
outcomesJsonfour PRIN 2A outcome responses
statusImpactAssessmentStatus
createdByIdString?FK → User
signedOffByIdString?FK → User; LEAD_REVIEWER or FIRM_ADMIN
signedOffAtDateTime?server-stamped on transition to APPROVED
createdAtDateTime
updatedAtDateTime

Incident

An operational or compliance incident logged against the firm. Anchored to the immutable ledger via INCIDENT_LOGGED / INCIDENT_RESOLVED events.

FieldTypeNote
idString
firmIdStringFK → Firm
titleString
descriptionString
severityIncidentSeverity
categoryIncidentCategory
statusIncidentStatus
reportedAtDateTime
reportedByIdString?FK → User
resolvedAtDateTime?server-controlled on transition to RESOLVED / CLOSED
rootCauseString?
affectedReviewJobIdsString[]
affectedLedgerRecordIdsString[]
metadataJson

IncidentRemediation

A remediation action attached to an Incident. Multiple remediations can live under one incident.

FieldTypeNote
idString
incidentIdStringFK → Incident, cascade on delete
descriptionString
statusRemediationStatus
ownerNameString?free-text; not linked to User yet
dueAtDateTime?
completedAtDateTime?
createdAtDateTime

Report

An audit-trail entry for every generated compliance report (currently just Consumer Duty outcome reports). The PDF itself is rendered on demand; this row records that a report existed at a given point in time.

FieldTypeNote
idString
firmIdStringFK → Firm
typeReportType
periodFromDateTime
periodToDateTime
generatedAtDateTime
generatedByUserIdString?FK → User
metadataJsonheadline metrics snapshot at generation time