{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-facility-insurance-ov-request-schema.json",
  "title": "FacilityInsuranceOvRequest",
  "description": "Facility insurance payload for full-array replace in CoreFacility data.insurances (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/FacilityInsuranceOvRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Optional client-side id"
    },
    "policyNumber": {
      "type": "string",
      "description": "Policy number (Number field in UI)"
    },
    "type": {
      "type": "string",
      "description": "Insurance type"
    },
    "status": {
      "type": "string",
      "description": "Insurance status"
    },
    "effectiveDate": {
      "type": "string",
      "description": "Effective date (YYYY-MM-DD)"
    },
    "expirationDate": {
      "type": "string",
      "description": "Expiration date (YYYY-MM-DD)"
    },
    "occurrenceCoverageAmount": {
      "type": "string",
      "description": "Occurrence coverage amount, numeric when present"
    },
    "aggregateCoverageAmount": {
      "type": "string",
      "description": "Aggregate coverage amount, numeric when present"
    },
    "unlimitedCoverage": {
      "type": "boolean",
      "description": "Unlimited coverage flag"
    },
    "carrierName": {
      "type": "string",
      "description": "Carrier name"
    },
    "source": {
      "type": "string",
      "description": "Source field"
    },
    "attachments": {
      "$ref": "#/$defs/JsonNode",
      "type": "object",
      "description": "Optional attachment array"
    },
    "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"
      ]
    }
  }
}