{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-facility-certificate-update-request-schema.json",
  "title": "FacilityCertificateUpdateRequest",
  "description": "Facility certificate data for PUT operations that replace the entire certifications 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/FacilityCertificateUpdateRequest",
  "type": "object",
  "required": [
    "certificateType",
    "number",
    "source"
  ],
  "properties": {
    "certificateId": {
      "type": "string",
      "description": "The certificate ID"
    },
    "certificateType": {
      "type": "string",
      "pattern": "\\S",
      "description": "The type of certificate"
    },
    "durationType": {
      "type": "string",
      "description": "The duration type"
    },
    "expirationDate": {
      "type": "string",
      "description": "The expiration date of the certificate"
    },
    "issueDate": {
      "type": "string",
      "description": "The issue date of the certificate"
    },
    "speciality": {
      "type": "string",
      "description": "The specialty associated with the certificate"
    },
    "subspeciality": {
      "type": "string",
      "description": "The subspecialty associated with the certificate"
    },
    "moc": {
      "type": "string",
      "description": "Maintenance of Certification status"
    },
    "status": {
      "type": "string",
      "description": "The status of the certificate"
    },
    "occurrenceType": {
      "type": "string",
      "description": "The occurrence type"
    },
    "recordType": {
      "type": "string",
      "description": "The record type"
    },
    "number": {
      "type": "string",
      "pattern": "\\S",
      "description": "The certificate number"
    },
    "source": {
      "type": "string",
      "pattern": "\\S",
      "description": "The source of the certificate"
    },
    "createdAt": {
      "type": "string",
      "description": "The date the record was created"
    },
    "createdBy": {
      "type": "string",
      "description": "The user who created the record"
    },
    "updatedAt": {
      "type": "string",
      "description": "The date the record was last updated"
    },
    "updatedBy": {
      "type": "string",
      "description": "The user who last updated the record"
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FacilityCredentialingWorkflowAttachment"
      },
      "description": "Supporting documents for the certificate"
    },
    "verifiedDate": {
      "type": "string",
      "description": "The date the certificate was verified"
    },
    "verifiedBy": {
      "type": "string",
      "description": "The user who verified the certificate"
    }
  },
  "$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"
        }
      }
    }
  }
}