Contract editor
The Claims product's data contract: what its table promises the teams that read it. Change the schema, the meaning, the quality promises, the service levels, the owner and the version; the draft is validated against the Open Data Contract Standard and every change is classified as additive or breaking.
Exercise: Add a column without breaking anyone
The fraud team wants a fraud_score on every claim, a decimal number, empty for claims scored before the model existed. Add it to the Claims contract with a description that says what it means, change nothing a consumer relies on, and give the draft the version its change needs.
- The draft has an optional decimal column
fraud_score. fraud_scorehas a description of what it means, not just its name.- No change breaks a consumer.
- The version is a new minor version of 1: higher than 1.0.0, still 1.x.
Schema and meaning
| Column | Type | Required | Unique | Classification | Meaning | Remove |
|---|---|---|---|---|---|---|
claim_id · key |
Surrogate key | |||||
claim_number |
claim_number | |||||
policy_id |
policy_id | |||||
loss_date |
when the event happened | |||||
reported_date |
when Harbour Mutual heard of it | |||||
cause |
cause | |||||
status |
open, closed or rejected | |||||
reserve |
what the insurer still expects to pay on an open claim |
Quality promises
| Rule | Dimension | Column | At least (%) | Withdraw |
|---|---|---|---|---|
| A claim is reported on or after its loss date | Validity | reported_date |
||
| A claim has a reported date | Completeness | reported_date |
||
| A claim's cause is on the loss-cause list | Validity | cause |
||
| A reserve is between 0 and the large-loss limit of 100,000 | Accuracy | reserve |
||
| A claim is reported within 60 days of the loss | Timeliness | loss_date |
||
| Each claim number is used once | Uniqueness | claim_number |
||
| A claim's policy exists | Consistency | policy_id |
The change, checked
The draft is valid against the Open Data Contract Standard v3.1.0 schema.
No change from the published version.
The draft as an Open Data Contract Standard document
{
"apiVersion": "v3.1.0",
"kind": "DataContract",
"id": "dc-claims",
"name": "Claim: claims",
"version": "1.0.0",
"status": "active",
"domain": "Claim",
"dataProduct": "Claim",
"description": {
"purpose": "A loss reported against one policy.",
"usage": "Read by reporting, reserving and the claims assistant through the product's output port."
},
"team": {
"name": "Claim domain",
"members": [
{
"username": "ruud.hendriks@harbourmutual.example",
"name": "Ruud Hendriks",
"role": "owner",
"description": "Claims Director"
}
]
},
"schema": [
{
"name": "claims",
"physicalName": "claims",
"physicalType": "table",
"logicalType": "object",
"description": "A loss reported against one policy.",
"properties": [
{
"name": "claim_id",
"logicalType": "integer",
"physicalType": "integer",
"required": true,
"unique": true,
"primaryKey": true,
"primaryKeyPosition": 1,
"classification": "internal",
"description": "Surrogate key"
},
{
"name": "claim_number",
"logicalType": "string",
"physicalType": "text",
"required": true,
"unique": false,
"classification": "internal",
"description": "claim_number"
},
{
"name": "policy_id",
"logicalType": "integer",
"physicalType": "integer",
"required": true,
"unique": false,
"classification": "internal",
"description": "policy_id"
},
{
"name": "loss_date",
"logicalType": "date",
"physicalType": "date",
"required": true,
"unique": false,
"classification": "internal",
"description": "when the event happened"
},
{
"name": "reported_date",
"logicalType": "date",
"physicalType": "date",
"required": true,
"unique": false,
"classification": "internal",
"description": "when Harbour Mutual heard of it"
},
{
"name": "cause",
"logicalType": "string",
"physicalType": "text",
"required": true,
"unique": false,
"classification": "confidential",
"description": "cause"
},
{
"name": "status",
"logicalType": "string",
"physicalType": "text",
"required": true,
"unique": false,
"classification": "internal",
"description": "open, closed or rejected"
},
{
"name": "reserve",
"logicalType": "number",
"physicalType": "numeric(12,2)",
"required": true,
"unique": false,
"classification": "confidential",
"description": "what the insurer still expects to pay on an open claim"
}
],
"quality": [
{
"id": "rule-reported-after-loss",
"name": "A claim is reported on or after its loss date",
"dimension": "conformity",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(reported_date >= loss_date, FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 98,
"unit": "percent",
"severity": "warning"
},
{
"id": "rule-claim-reported-present",
"name": "A claim has a reported date",
"dimension": "completeness",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(reported_date IS NOT NULL, FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 99,
"unit": "percent",
"severity": "warning"
},
{
"id": "rule-claim-cause-known",
"name": "A claim's cause is on the loss-cause list",
"dimension": "conformity",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(cause IN ('collision', 'theft', 'windscreen', 'storm', 'escape of water', 'fire', 'medical', 'baggage'), FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 99,
"unit": "percent",
"severity": "warning"
},
{
"id": "rule-claim-reserve-range",
"name": "A reserve is between 0 and the large-loss limit of 100,000",
"dimension": "accuracy",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(reserve BETWEEN 0 AND 100000, FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 99,
"unit": "percent",
"severity": "warning"
},
{
"id": "rule-claim-reported-on-time",
"name": "A claim is reported within 60 days of the loss",
"dimension": "timeliness",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(reported_date - loss_date <= 60, FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 95,
"unit": "percent",
"severity": "warning"
},
{
"id": "rule-claim-number-unique",
"name": "Each claim number is used once",
"dimension": "uniqueness",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(NOT EXISTS (SELECT 1 FROM claims o WHERE o.claim_number = claims.claim_number AND o.claim_id <> claims.claim_id), FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 100,
"unit": "percent",
"severity": "error"
},
{
"id": "rule-claim-policy-exists",
"name": "A claim's policy exists",
"dimension": "consistency",
"type": "sql",
"query": "SELECT 100.0 * AVG(CASE WHEN COALESCE(EXISTS (SELECT 1 FROM policies r WHERE r.policy_id = claims.policy_id), FALSE) THEN 1 ELSE 0 END) FROM claims",
"mustBeGreaterOrEqualTo": 100,
"unit": "percent",
"severity": "error"
}
]
}
],
"slaProperties": [
{
"property": "freshness",
"value": 24,
"unit": "h"
},
{
"property": "retention",
"value": 7,
"unit": "y"
}
]
}
Used in
- Chapter 22 · Classification, privacy and security controls
- Chapter 23 · Designing a data product
- Chapter 24 · Data contracts
- Chapter 36 · Controls
- Chapter 43 · Stage 6: The platform
Glossary: Data contractOpen Data Contract StandardBreaking changeService level