{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/self_reported_disease/v1.json",
  "title": "self_reported_disease contract v1",
  "type": "object",
  "required": [
    "disease",
    "email_issue_fact_id",
    "kind",
    "raised_at",
    "raised_by",
    "raised_by_name",
    "status"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "the kind the person raised it as (`extra_work`, `delay`, `defect`, `dispute`, `over_budget` or `compliance`).",
      "x-demiton-requiredness": "required"
    },
    "status": {
      "type": "string",
      "description": "counting, answered Not an issue, or deducted at verification. Withdrawn raises are retracted, not listed.",
      "x-demiton-requiredness": "required"
    },
    "disease": {
      "type": "string",
      "description": "the disease the raised kind names: a `DISEASE_CATALOG` key (`claim_window`, `rework_signal`, `evidence_gap`, `overrun_signal` or `compliance_gate`).",
      "x-demiton-requiredness": "required"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 code of `estimate`, `supported_estimate` and `deducted`.",
      "x-demiton-requiredness": "optional"
    },
    "deducted": {
      "type": "number",
      "description": "the amount deducted again: `estimate` less `supported_estimate`.",
      "x-demiton-requiredness": "optional"
    },
    "estimate": {
      "type": "number",
      "description": "the raiser's estimate, in `currency`.",
      "x-demiton-requiredness": "optional"
    },
    "raised_at": {
      "type": "string",
      "description": "when the issue was raised, UTC.",
      "x-demiton-requiredness": "required",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "raised_by": {
      "type": "integer",
      "description": "the Demiton user id of the first raiser.",
      "x-demiton-requiredness": "required"
    },
    "raised_by_name": {
      "type": "string",
      "description": "the raiser's display name at the time of the last sync.",
      "x-demiton-requiredness": "required"
    },
    "supported_estimate": {
      "type": "number",
      "description": "what Demiton found the email and the job's records support, when the raise was deducted; 0 when the figure was made up.",
      "x-demiton-requiredness": "optional"
    },
    "email_issue_fact_id": {
      "type": "integer",
      "description": "the `email_issue` fact this row is the self-reported view of. The only link back to the email.",
      "x-demiton-requiredness": "required"
    }
  },
  "x-demiton-register-type": "self_reported_disease",
  "x-demiton-contract-version": "1.0.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "project",
      "requirement": "required",
      "role": "subject"
    }
  ],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "The Self reported disease register contract, version 1. JSON Schema (draft 2020-12); x-demiton-* keywords carry Demiton's own meaning and standard validators ignore them.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/self_reported_disease/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}