{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dbt-se/json-schema/dbt-se-case-contact-response-body-schema.json",
  "title": "CaseContactResponseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dbt-se-identity-api-openapi.yml#/components/schemas/CaseContactResponseBody",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "caseId": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "phoneNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "representative",
              "ceo",
              "cfo",
              "board-chair",
              "board-member",
              "deputy-board-member",
              "authorized-signatory",
              "shareholder",
              "beneficial-owner",
              "contact-person",
              "proxy",
              "auditor",
              "accounting-consultant",
              "legal-counsel",
              "bookkeeping-data-contact",
              "invoice-contact",
              "other"
            ]
          }
        }
      },
      "required": [
        "id",
        "caseId",
        "name",
        "email",
        "phoneNumber",
        "roles"
      ]
    },
    {
      "anyOf": [
        {
          "$ref": "#/$defs/CaseContactWithNationalId"
        },
        {
          "$ref": "#/$defs/CaseContactWithoutNationalId"
        }
      ]
    },
    {
      "anyOf": [
        {
          "$ref": "#/$defs/ActiveCaseContact"
        },
        {
          "$ref": "#/$defs/RevokedCaseContact"
        }
      ]
    }
  ],
  "$defs": {
    "ActiveCaseContact": {
      "type": "object",
      "properties": {
        "revokedAt": {
          "type": "null"
        },
        "isSignee": {
          "type": "boolean"
        },
        "isOfficialContact": {
          "type": "boolean"
        }
      },
      "required": [
        "revokedAt",
        "isSignee",
        "isOfficialContact"
      ]
    },
    "CaseContactWithNationalId": {
      "type": "object",
      "properties": {
        "physicalPersonId": {
          "type": "string",
          "format": "uuid"
        },
        "maskedNationalIdentificationNumber": {
          "type": "string"
        },
        "nationalIdentificationNumber": {
          "type": "string"
        },
        "isIdentityVerified": {
          "type": "boolean"
        }
      },
      "required": [
        "physicalPersonId",
        "maskedNationalIdentificationNumber",
        "nationalIdentificationNumber",
        "isIdentityVerified"
      ]
    },
    "CaseContactWithoutNationalId": {
      "type": "object",
      "properties": {
        "nationalIdentificationNumber": {
          "type": "null"
        },
        "isIdentityVerified": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      },
      "required": [
        "nationalIdentificationNumber",
        "isIdentityVerified"
      ]
    },
    "RevokedCaseContact": {
      "type": "object",
      "properties": {
        "revokedAt": {
          "type": "string",
          "format": "date-time"
        },
        "isSignee": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "isOfficialContact": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      },
      "required": [
        "revokedAt",
        "isSignee",
        "isOfficialContact"
      ]
    }
  }
}