{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-facility-license-ov-request-schema.json",
  "title": "FacilityLicenseOvRequest",
  "description": "Facility license payload for full-array replace in CoreFacility data.licenses (OV)",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-facility-api-openapi.yml#/components/schemas/FacilityLicenseOvRequest",
  "type": "object",
  "required": [
    "expirationDate",
    "reportDate"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Optional client-side id"
    },
    "licenseNumber": {
      "type": "string",
      "description": "License number"
    },
    "state": {
      "type": "string",
      "description": "US state code"
    },
    "licenseType": {
      "type": "string",
      "description": "License type"
    },
    "licenseStatus": {
      "type": "string",
      "description": "License status"
    },
    "licenseSource": {
      "type": "string",
      "description": "Source"
    },
    "issueDate": {
      "type": "string",
      "description": "Issue date (YYYY-MM-DD)"
    },
    "expirationDate": {
      "type": "string",
      "description": "Expiration date (YYYY-MM-DD)"
    },
    "reportDate": {
      "type": "string",
      "description": "Report date (YYYY-MM-DD)"
    },
    "flaggedDate": {
      "type": "string",
      "description": "Flagged date (YYYY-MM-DD)"
    },
    "url": {
      "type": "string",
      "description": "Reference URL"
    },
    "licenseNumberVariations": {
      "type": "string",
      "description": "Alternate license numbers"
    },
    "type": {
      "type": "string",
      "description": "Legacy type field when present on stored rows"
    },
    "attachments": {
      "$ref": "#/$defs/JsonNode",
      "type": "object",
      "description": "Optional attachment payload"
    },
    "action": {
      "type": "string",
      "description": "Set to delete for soft-delete"
    },
    "deletedAt": {
      "type": "string",
      "description": "Soft-delete timestamp"
    },
    "deletedBy": {
      "type": "string",
      "description": "Soft-delete actor"
    },
    "createdAt": {
      "type": "string",
      "description": "Created timestamp"
    },
    "createdBy": {
      "type": "string",
      "description": "Created by"
    },
    "updatedAt": {
      "type": "string",
      "description": "Updated timestamp"
    },
    "updatedBy": {
      "type": "string",
      "description": "Updated by"
    },
    "verifiedDate": {
      "type": "string",
      "description": "Verified date"
    },
    "verifiedBy": {
      "type": "string",
      "description": "Verified by"
    }
  },
  "$defs": {
    "JsonNode": {
      "type": "object",
      "properties": {
        "empty": {
          "type": "boolean"
        },
        "valueNode": {
          "type": "boolean"
        },
        "containerNode": {
          "type": "boolean"
        },
        "missingNode": {
          "type": "boolean"
        },
        "array": {
          "type": "boolean"
        },
        "object": {
          "type": "boolean"
        },
        "nodeType": {
          "$ref": "#/$defs/JsonNodeType"
        },
        "pojo": {
          "type": "boolean"
        },
        "number": {
          "type": "boolean"
        },
        "integralNumber": {
          "type": "boolean"
        },
        "floatingPointNumber": {
          "type": "boolean"
        },
        "short": {
          "type": "boolean"
        },
        "int": {
          "type": "boolean"
        },
        "long": {
          "type": "boolean"
        },
        "float": {
          "type": "boolean"
        },
        "double": {
          "type": "boolean"
        },
        "bigDecimal": {
          "type": "boolean"
        },
        "bigInteger": {
          "type": "boolean"
        },
        "textual": {
          "type": "boolean"
        },
        "boolean": {
          "type": "boolean"
        },
        "null": {
          "type": "boolean"
        },
        "binary": {
          "type": "boolean"
        }
      }
    },
    "JsonNodeType": {
      "type": "string",
      "enum": [
        "ARRAY",
        "BINARY",
        "BOOLEAN",
        "MISSING",
        "NULL",
        "NUMBER",
        "OBJECT",
        "POJO",
        "STRING"
      ]
    }
  }
}