{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/comp-ai/main/json-schema/comp-ai-policy-response-dto-schema.json",
  "title": "PolicyResponseDto",
  "x-generated": "2026-10-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/comp-ai-openapi.json#/components/schemas/PolicyResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The policy ID"
    },
    "name": {
      "type": "string",
      "description": "Name of the policy"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the policy"
    },
    "status": {
      "type": "string",
      "description": "Status of the policy",
      "enum": [
        "draft",
        "published",
        "needs_review"
      ]
    },
    "content": {
      "type": "array",
      "description": "Content of the policy as TipTap JSON (array of nodes)",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "frequency": {
      "type": [
        "string",
        "null"
      ],
      "description": "Review frequency of the policy",
      "enum": [
        "monthly",
        "quarterly",
        "yearly"
      ]
    },
    "department": {
      "type": [
        "string",
        "null"
      ],
      "description": "Department this policy applies to. May be one of the built-in values (none, admin, gov, hr, it, itsm, qms) or a custom department name."
    },
    "isRequiredToSign": {
      "type": "boolean",
      "description": "Whether this policy requires a signature"
    },
    "signedBy": {
      "type": "array",
      "description": "List of user IDs who have signed this policy",
      "items": {
        "type": "string"
      }
    },
    "reviewDate": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ],
      "description": "Review date for the policy"
    },
    "isArchived": {
      "type": "boolean",
      "description": "Whether this policy is archived"
    },
    "archivedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ],
      "description": "When the policy was archived by framework sync"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "When the policy was created"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "When the policy was last updated"
    },
    "lastArchivedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ],
      "description": "When the policy was last archived"
    },
    "lastPublishedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ],
      "description": "When the policy was last published"
    },
    "organizationId": {
      "type": "string",
      "description": "Organization ID this policy belongs to"
    },
    "assigneeId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the user assigned to this policy"
    },
    "approverId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the user who approved this policy"
    },
    "policyTemplateId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the policy template this policy is based on"
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "status",
    "content",
    "frequency",
    "department",
    "isRequiredToSign",
    "signedBy",
    "reviewDate",
    "isArchived",
    "archivedAt",
    "createdAt",
    "updatedAt",
    "lastArchivedAt",
    "lastPublishedAt",
    "organizationId",
    "assigneeId",
    "approverId",
    "policyTemplateId"
  ]
}