{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-license-update-request-schema.json",
  "title": "License",
  "description": "License data for PUT operations that replace the entire licenses array",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-credentialingworkflow-api-openapi.yml#/components/schemas/LicenseUpdateRequest",
  "type": "object",
  "required": [
    "expiration",
    "issueDate",
    "licenseNumber",
    "state",
    "licenseType",
    "licenseStatus",
    "licenseSource",
    "reportDate"
  ],
  "properties": {
    "createdAt": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "The date the record was created"
    },
    "createdBy": {
      "type": "string",
      "description": "The user who created the record"
    },
    "updatedAt": {
      "$ref": "#/$defs/Date",
      "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/CredentialingWorkflowAttachment"
      },
      "description": "Array of attachment metadata for this record"
    },
    "verifiedBy": {
      "type": "string",
      "description": "Person who verified this record"
    },
    "verifiedDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date when this record was verified"
    },
    "expiration": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Expiration date of the license"
    },
    "issueDate": {
      "$ref": "#/$defs/Date",
      "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": "License source of the license information"
    },
    "reportDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Report date"
    },
    "licenseNumberVariations": {
      "type": "string",
      "description": "Variations of the license number"
    },
    "practitionerType": {
      "type": "string",
      "description": "Type of practitioner"
    },
    "specialty": {
      "type": "string",
      "description": "Medical specialty"
    },
    "flaggedDate": {
      "$ref": "#/$defs/Date",
      "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"
    }
  },
  "$defs": {
    "CredentialingWorkflowAttachment": {
      "type": "object",
      "required": [
        "fileType",
        "fileUrl",
        "originalFileName"
      ],
      "description": "Attachment metadata for credentialing workflow row",
      "properties": {
        "createdAt": {
          "type": "string",
          "description": "Creation timestamp"
        },
        "fileType": {
          "type": "string",
          "description": "Document file type"
        },
        "fileUrl": {
          "type": "string",
          "description": "GCS file URL for file retrieval"
        },
        "originalFileName": {
          "type": "string",
          "description": "Original file name"
        },
        "expirationDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "Expiration date",
          "default": "9999-12-31"
        },
        "createdBy": {
          "type": "string",
          "description": "User who created the record"
        },
        "artifactLinkId": {
          "type": "string",
          "description": "Shared identifier linking this attachment to its corresponding supportingDocuments entry"
        }
      }
    },
    "Date": {
      "type": "string",
      "format": "date"
    }
  }
}