{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uklsp.org/schemas/v0.1/compliance-credential.schema.json",
  "title": "ComplianceCredential",
  "description": "A machine-verifiable reference to a statutory or scheme registration. UKLSP stores the reference and where to verify it \u2014 never a claim of verification it hasn't performed.",
  "type": "object",
  "properties": {
    "credential_type": {
      "type": "string",
      "enum": [
        "gas_safe",
        "niceic",
        "napit",
        "stroma",
        "elmhurst_epc",
        "fdis_fire_door",
        "bafe",
        "rpii",
        "hse_asbestos_licence",
        "other"
      ]
    },
    "credential_label": {
      "type": "string"
    },
    "registration_number": {
      "type": "string",
      "minLength": 3
    },
    "register_url": {
      "type": "string",
      "format": "uri",
      "description": "Public register where the number can be checked."
    },
    "verified_by_operator": {
      "type": "boolean",
      "description": "True only after the operator has manually checked the register. Default false."
    },
    "verified_date": {
      "type": "string",
      "format": "date"
    },
    "expires": {
      "type": "string",
      "format": "date"
    }
  },
  "required": [
    "credential_type",
    "registration_number"
  ],
  "additionalProperties": false
}
