{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-facility-state-license-update-request-schema.json",
  "title": "FacilityStateLicenseUpdateRequest",
  "description": "Facility state license data for PUT operations that replace the entire state licenses array",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-facilitycredentialingworkflow-api-openapi.yml#/components/schemas/FacilityStateLicenseUpdateRequest",
  "type": "object",
  "required": [
    "expirationDate",
    "licenseNumber",
    "state",
    "licenseType",
    "licenseStatus",
    "licenseSource",
    "reportDate"
  ],
  "properties": {
    "type": {
      "type": "string",
      "description": "The type of license"
    },
    "expirationDate": {
      "type": "string",
      "description": "Expiration date of the license"
    },
    "issueDate": {
      "type": "string",
      "description": "Issue date of the license"
    },
    "licenseNumber": {
      "type": "string",
      "pattern": "\\S",
      "description": "License number"
    },
    "state": {
      "type": "string",
      "pattern": "\\S",
      "description": "State where license was issued"
    },
    "licenseType": {
      "type": "string",
      "pattern": "\\S",
      "description": "Type of license"
    },
    "licenseStatus": {
      "type": "string",
      "pattern": "\\S",
      "description": "Status of the license"
    },
    "licenseSource": {
      "type": "string",
      "pattern": "\\S",
      "description": "Source of the license information"
    },
    "reportDate": {
      "type": "string",
      "description": "Report date"
    },
    "licenseNumberVariations": {
      "type": "string",
      "description": "Variations of the license number"
    },
    "flaggedDate": {
      "type": "string",
      "description": "Date when license was flagged"
    },
    "dataSource": {
      "type": "string",
      "description": "Data source for the license"
    },
    "url": {
      "type": "string",
      "description": "URL for license verification"
    },
    "createdAt": {
      "type": "string",
      "description": "Date when the record was created"
    },
    "createdBy": {
      "type": "string",
      "description": "User who created the record"
    },
    "updatedAt": {
      "type": "string",
      "description": "Date when the record was last updated"
    },
    "updatedBy": {
      "type": "string",
      "description": "User who last updated the record"
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FacilityCredentialingWorkflowAttachment"
      },
      "description": "Supporting documents for the license"
    },
    "verifiedDate": {
      "type": "string",
      "description": "Date when license was verified"
    },
    "verifiedBy": {
      "type": "string",
      "description": "Person who verified the license"
    }
  },
  "$defs": {
    "FacilityCredentialingWorkflowAttachment": {
      "type": "object",
      "required": [
        "fileType",
        "fileUrl",
        "originalFileName"
      ],
      "description": "Attachment metadata for facility credentialing workflow sections",
      "properties": {
        "createdAt": {
          "type": "string",
          "description": "The date the attachment was created"
        },
        "fileType": {
          "type": "string",
          "description": "Supporting Document File Type (i.e. Malpractice Insurance Policy, License, etc.)"
        },
        "fileUrl": {
          "type": "string",
          "description": "Supporting Document File URI in GCS"
        },
        "originalFileName": {
          "type": "string",
          "description": "Supporting Document Original File Name"
        },
        "state": {
          "type": "string",
          "description": "The state associated with the supporting document"
        },
        "expirationDate": {
          "type": "string",
          "description": "The expiration date of the supporting document"
        },
        "source": {
          "type": "string",
          "description": "The source of the supporting document"
        },
        "createdBy": {
          "type": "string",
          "description": "The user who created the record"
        },
        "updatedAt": {
          "type": "string",
          "description": "The date the attachment was last updated"
        },
        "updatedBy": {
          "type": "string",
          "description": "The user who last updated the record"
        }
      }
    }
  }
}