{
 "openapi": "3.1.0",
 "info": {
  "title": "ComplianceOS API",
  "version": "1.0",
  "description": "The ComplianceOS API lets your ERP, HR, payroll and data systems push records into ComplianceOS and read compliance results back, and lets ComplianceOS notify your systems through signed webhooks.\n\nAuthenticate every request with an API key in the `X-API-Key` header. Create keys in **Settings → API keys & audit log → Manage API Keys**. A key carries roles (viewer, editor, auditor) and may be limited to some entities.\n\nErrors are JSON with a human-readable `detail`. See the developer guide at https://www.complianceos.me/developers for authentication, errors, rate limits, pagination and webhook signatures.\n",
  "contact": {
   "name": "ComplianceOS",
   "url": "https://www.complianceos.me/contact"
  }
 },
 "servers": [
  {
   "url": "https://api.complianceos.me",
   "description": "Production"
  }
 ],
 "tags": [
  {
   "name": "Entities",
   "description": "Companies (legal entities) in your organisation. Almost every other route is scoped to one entity: `/api/v1/entities/{entity_id}/...`. A key limited to some entities sees and reaches only those."
  },
  {
   "name": "Tax transactions",
   "description": "The transactions VAT and Corporate Tax are computed from: push them from your ERP or accounting system one at a time or as a file, attach evidence, and have them classified."
  },
  {
   "name": "VAT & Corporate Tax",
   "description": "Return drafts and tax positions computed from classified transactions. Filing, locking and elections are sign-offs a person makes in the app; they are not available to API keys."
  },
  {
   "name": "Documents & evidence",
   "description": "The document library and the Evidence Vault. Vaulted evidence is stored with a SHA-256 hash, verified on every download."
  },
  {
   "name": "Calendar & obligations",
   "description": "The statutory compliance calendar (VAT, CT, ESR, UBO … deadlines) and the compliance tasks behind each framework."
  },
  {
   "name": "Sanctions screening",
   "description": "Screen names against the UAE Local Terrorist List, UN, OFAC and other loaded watchlists. Clearing or confirming a match is a person's decision in the app."
  },
  {
   "name": "AML & CDD",
   "description": "Customer due diligence records, PEP screening and AML alerts."
  },
  {
   "name": "Employees & WPS",
   "description": "Sync the employee register from your HR or payroll system, record WPS salary payments and follow document expiries."
  },
  {
   "name": "Contracts",
   "description": "Contracts uploaded for AI extraction (parties, dates, value, obligations) and risk scoring."
  },
  {
   "name": "ESG",
   "description": "Emission records and ESG metrics from meters, utility systems or your sustainability data warehouse."
  },
  {
   "name": "Regulatory & search",
   "description": "Regulatory alerts relevant to an entity, and search across modules."
  },
  {
   "name": "Webhooks",
   "description": "Webhook endpoints are registered by an organisation admin in Settings → Webhooks, which shows the signing secret once and keeps the delivery log. The event catalogue can be read with any key."
  },
  {
   "name": "Access",
   "description": "What the calling key may do."
  }
 ],
 "paths": {
  "/api/v1/entities": {
   "get": {
    "tags": [
     "Entities"
    ],
    "summary": "List entities",
    "operationId": "list_entities_api_v1_entities_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_EntityResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Entities in your organisation that this key may reach."
   }
  },
  "/api/v1/entities/{entity_id}": {
   "get": {
    "tags": [
     "Entities"
    ],
    "summary": "Get an entity",
    "operationId": "get_entity_api_v1_entities__entity_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EntityDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The entity profile with its mapped frameworks."
   },
   "patch": {
    "tags": [
     "Entities"
    ],
    "summary": "Update an entity",
    "operationId": "update_entity_api_v1_entities__entity_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EntityUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EntityResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Changes profile fields; only the fields you send change. Changing the legal structure or a tax election (realisation basis, transparency, exemption …) is a person's decision: API keys get 403 `Only people can …` for those fields."
   }
  },
  "/api/v1/entities/{entity_id}/readiness": {
   "get": {
    "tags": [
     "Entities"
    ],
    "summary": "Module readiness",
    "operationId": "get_readiness_api_v1_entities__entity_id__readiness_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ModuleReadinessResponse"
         },
         "title": "Response Get Readiness Api V1 Entities  Entity Id  Readiness Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Which prerequisites each module has met or is missing for this entity."
   }
  },
  "/api/v1/entities/{entity_id}/tax/transactions": {
   "post": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Create a transaction",
    "operationId": "create_transaction_api_v1_entities__entity_id__tax_transactions_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TaxTransactionCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TaxTransactionResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Adds one transaction (sale, purchase, expense …). It starts unclassified; classify it with the classify-batch route or in the app."
   },
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "List transactions",
    "operationId": "list_transactions_api_v1_entities__entity_id__tax_transactions_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "review_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/ReviewStatus-Input"
        },
        {
         "type": "null"
        }
       ],
       "title": "Review Status"
      }
     },
     {
      "name": "transaction_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/TransactionType"
        },
        {
         "type": "null"
        }
       ],
       "title": "Transaction Type"
      }
     },
     {
      "name": "date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Date From"
      }
     },
     {
      "name": "date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Date To"
      }
     },
     {
      "name": "vendor_customer",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by vendor/customer name (partial match)",
       "title": "Vendor Customer"
      },
      "description": "Filter by vendor/customer name (partial match)"
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_TransactionWithClassificationResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Transactions with optional filters, paged with `page` and `page_size`."
   }
  },
  "/api/v1/entities/{entity_id}/tax/transactions/{transaction_id}": {
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Get a transaction",
    "operationId": "get_transaction_api_v1_entities__entity_id__tax_transactions__transaction_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "transaction_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Transaction Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TaxTransactionResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "One transaction with its classification."
   },
   "patch": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Update a transaction",
    "operationId": "update_transaction_api_v1_entities__entity_id__tax_transactions__transaction_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "transaction_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Transaction Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TaxTransactionUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TaxTransactionResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Corrects a transaction. Refused with 409 when its period is filed and locked."
   }
  },
  "/api/v1/entities/{entity_id}/tax/transactions/import": {
   "post": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Import transactions from a file",
    "operationId": "import_tax_transactions_api_v1_entities__entity_id__tax_transactions_import_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "dry_run",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Validate and preview the file without writing anything.",
       "default": false,
       "title": "Dry Run"
      },
      "description": "Validate and preview the file without writing anything."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_import_tax_transactions_api_v1_entities__entity_id__tax_transactions_import_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ImportResultResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Bulk import from a CSV or XLSX file (multipart `file`)."
   }
  },
  "/api/v1/entities/{entity_id}/tax/transactions/classify-batch": {
   "post": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Classify transactions (async)",
    "operationId": "batch_classify_api_v1_entities__entity_id__tax_transactions_classify_batch_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "transaction_ids",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "array",
         "items": {
          "type": "string",
          "format": "uuid"
         }
        },
        {
         "type": "null"
        }
       ],
       "title": "Transaction Ids"
      }
     },
     {
      "name": "date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Without transaction_ids: classify the unclassified lines whose VAT date (tax point, else transaction date) is on or after this day",
       "title": "Date From"
      },
      "description": "Without transaction_ids: classify the unclassified lines whose VAT date (tax point, else transaction date) is on or after this day"
     },
     {
      "name": "date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Without transaction_ids: ... on or before this day",
       "title": "Date To"
      },
      "description": "Without transaction_ids: ... on or before this day"
     }
    ],
    "responses": {
     "202": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AsyncTaskResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Queues AI classification for the entity's unclassified transactions (or the ids you send) and returns a `task_id`; poll `GET /api/v1/tasks/{task_id}/status`. Uses AI credits.\n\nRate limit: 5/minute per API key.",
    "x-rate-limit": "5/minute"
   }
  },
  "/api/v1/entities/{entity_id}/tax/classification-status": {
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Classification progress",
    "description": "How many transactions are classified, pending or in review.",
    "operationId": "classification_status_api_v1_entities__entity_id__tax_classification_status_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Count only lines whose VAT date (tax point, else transaction date) is on or after this day, e.g. a return period's start",
       "title": "Date From"
      },
      "description": "Count only lines whose VAT date (tax point, else transaction date) is on or after this day, e.g. a return period's start"
     },
     {
      "name": "date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Count only lines whose VAT date is on or before this day",
       "title": "Date To"
      },
      "description": "Count only lines whose VAT date is on or before this day"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/tax/review-queue": {
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Review queue summary",
    "operationId": "review_queue_summary_api_v1_entities__entity_id__tax_review_queue_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ReviewQueueSummary"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Classifications waiting for a person's sign-off."
   }
  },
  "/api/v1/entities/{entity_id}/tax/transactions/{transaction_id}/evidence": {
   "post": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Attach evidence to a transaction",
    "description": "Uploads the invoice or receipt behind a transaction (multipart `file`).",
    "operationId": "upload_transaction_evidence_api_v1_entities__entity_id__tax_transactions__transaction_id__evidence_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "transaction_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Transaction Id"
      }
     },
     {
      "name": "document_type",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Document type: INVOICE, RECEIPT, CREDIT_NOTE, CUSTOMS_DECLARATION, UTILITY_BILL, CONTRACT",
       "default": "INVOICE",
       "title": "Document Type"
      },
      "description": "Document type: INVOICE, RECEIPT, CREDIT_NOTE, CUSTOMS_DECLARATION, UTILITY_BILL, CONTRACT"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_transaction_evidence_api_v1_entities__entity_id__tax_transactions__transaction_id__evidence_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TransactionEvidenceResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "List a transaction's evidence",
    "operationId": "list_transaction_evidence_api_v1_entities__entity_id__tax_transactions__transaction_id__evidence_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "transaction_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Transaction Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/TransactionEvidenceResponse"
         },
         "title": "Response List Transaction Evidence Api V1 Entities  Entity Id  Tax Transactions  Transaction Id  Evidence Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List a transaction's evidence"
   }
  },
  "/api/v1/tasks/{task_id}/status": {
   "get": {
    "tags": [
     "Tax transactions"
    ],
    "summary": "Background task status",
    "operationId": "get_task_status_api_v1_tasks__task_id__status_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "task_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Task Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AsyncTaskStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Status and result of an async job started by another route (classification, imports …)."
   }
  },
  "/api/v1/entities/{entity_id}/tax/vat-periods": {
   "get": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "VAT periods",
    "description": "Recent VAT tax periods for the entity's filing frequency.",
    "operationId": "list_vat_periods_api_v1_entities__entity_id__tax_vat_periods_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "count",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 36,
       "minimum": 1,
       "default": 8,
       "title": "Count"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VATPeriodsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/tax/vat-return": {
   "post": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "Compute a VAT return draft",
    "operationId": "compute_vat_return_api_v1_entities__entity_id__tax_vat_return_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "enum": [
        "projected",
        "filing_ready"
       ],
       "type": "string",
       "description": "projected (all) or filing_ready (evidence-validated only)",
       "default": "projected",
       "title": "Mode"
      },
      "description": "projected (all) or filing_ready (evidence-validated only)"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/VATReturnComputeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VATReturnResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Computes (or refreshes) the VAT return draft for a period from classified transactions."
   }
  },
  "/api/v1/entities/{entity_id}/tax/vat-returns": {
   "get": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "List VAT returns",
    "operationId": "list_vat_returns_api_v1_entities__entity_id__tax_vat_returns_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_VATReturnResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List VAT returns"
   }
  },
  "/api/v1/entities/{entity_id}/tax/ct-return": {
   "post": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "Compute a CT return draft",
    "operationId": "compute_ct_return_api_v1_entities__entity_id__tax_ct_return_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "enum": [
        "projected",
        "filing_ready"
       ],
       "type": "string",
       "description": "projected (all) or filing_ready (evidence-validated only)",
       "default": "projected",
       "title": "Mode"
      },
      "description": "projected (all) or filing_ready (evidence-validated only)"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CTReturnComputeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CTReturnResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Computes (or refreshes) the Corporate Tax return draft for a fiscal year."
   }
  },
  "/api/v1/entities/{entity_id}/tax/ct-returns": {
   "get": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "List CT returns",
    "operationId": "list_ct_returns_api_v1_entities__entity_id__tax_ct_returns_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_CTReturnResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List CT returns"
   }
  },
  "/api/v1/entities/{entity_id}/tax/ct-summary": {
   "get": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "Corporate Tax position",
    "description": "The CT position for a period in one call, computed now and not saved.",
    "operationId": "ct_summary_api_v1_entities__entity_id__tax_ct_summary_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 2100,
         "minimum": 2023
        },
        {
         "type": "null"
        }
       ],
       "description": "Calendar financial year, e.g. 2026",
       "title": "Fiscal Year"
      },
      "description": "Calendar financial year, e.g. 2026"
     },
     {
      "name": "period_start",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Period Start"
      }
     },
     {
      "name": "period_end",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Period End"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response Ct Summary Api V1 Entities  Entity Id  Tax Ct Summary Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/tax/vendors": {
   "get": {
    "tags": [
     "VAT & Corporate Tax"
    ],
    "summary": "List counterparties",
    "operationId": "list_vendors_api_v1_entities__entity_id__tax_vendors_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Search"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The entity's supplier and customer directory (TRN, country, zone)."
   }
  },
  "/api/v1/entities/{entity_id}/documents": {
   "post": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Upload a document",
    "operationId": "upload_document_api_v1_entities__entity_id__documents_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_document_api_v1_entities__entity_id__documents_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocumentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Adds a file to the entity's document library (multipart `file`)."
   },
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "List documents",
    "operationId": "list_documents_api_v1_entities__entity_id__documents_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     },
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Search"
      }
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Category"
      }
     },
     {
      "name": "folder",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Folder"
      }
     },
     {
      "name": "uploaded_by_me",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Uploaded By Me"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocumentListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List documents"
   }
  },
  "/api/v1/entities/{entity_id}/documents/{doc_id}": {
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Get a document",
    "operationId": "get_document_api_v1_entities__entity_id__documents__doc_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Doc Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocumentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Get a document"
   },
   "patch": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Update document details",
    "operationId": "update_document_api_v1_entities__entity_id__documents__doc_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Doc Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocumentUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocumentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Update document details"
   }
  },
  "/api/v1/entities/{entity_id}/documents/{doc_id}/download": {
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Download a document",
    "operationId": "download_document_api_v1_entities__entity_id__documents__doc_id__download_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "doc_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Doc Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Download a document"
   }
  },
  "/api/v1/entities/{entity_id}/evidence/upload": {
   "post": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Upload evidence",
    "operationId": "upload_evidence_api_v1_entities__entity_id__evidence_upload_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_evidence_api_v1_entities__entity_id__evidence_upload_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EvidenceRecordResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Stores a file in the Evidence Vault with its SHA-256 integrity hash, optionally linked to a source record.\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   }
  },
  "/api/v1/entities/{entity_id}/evidence/from-document": {
   "post": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Vault a library document",
    "description": "Seals a document from the library into the Evidence Vault.\n\nRate limit: 20/minute per API key.",
    "operationId": "evidence_from_document_api_v1_entities__entity_id__evidence_from_document_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EvidenceFromDocumentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response Evidence From Document Api V1 Entities  Entity Id  Evidence From Document Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/evidence": {
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "List evidence",
    "operationId": "list_evidence_api_v1_entities__entity_id__evidence_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "source_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/EvidenceSourceType"
        },
        {
         "type": "null"
        }
       ],
       "title": "Source Type"
      }
     },
     {
      "name": "retention_policy",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/RetentionPolicy"
        },
        {
         "type": "null"
        }
       ],
       "title": "Retention Policy"
      }
     },
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        },
        {
         "type": "null"
        }
       ],
       "title": "Search"
      }
     },
     {
      "name": "date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Date From"
      }
     },
     {
      "name": "date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Date To"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_EvidenceRecordListResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List evidence"
   }
  },
  "/api/v1/entities/{entity_id}/evidence/by-source": {
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Evidence for a record",
    "operationId": "get_evidence_by_source_api_v1_entities__entity_id__evidence_by_source_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "source_type",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/EvidenceSourceType"
      }
     },
     {
      "name": "source_id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Source Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EvidenceBySourceResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Evidence linked to a given source record."
   }
  },
  "/api/v1/entities/{entity_id}/evidence/{evidence_id}/download": {
   "get": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Download evidence",
    "operationId": "download_evidence_api_v1_entities__entity_id__evidence__evidence_id__download_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "evidence_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Evidence Id"
      }
     },
     {
      "name": "preview",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "The record's own page showing a small generated snapshot inline (not a download)",
       "default": false,
       "title": "Preview"
      },
      "description": "The record's own page showing a small generated snapshot inline (not a download)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The file, verified against its stored hash on access (`X-File-Hash`, `X-Integrity-Valid` response headers)."
   }
  },
  "/api/v1/entities/{entity_id}/evidence/{evidence_id}/verify": {
   "post": {
    "tags": [
     "Documents & evidence"
    ],
    "summary": "Verify evidence integrity",
    "operationId": "verify_evidence_api_v1_entities__entity_id__evidence__evidence_id__verify_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "evidence_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Evidence Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EvidenceVerifyResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Re-computes the file's SHA-256 hash and compares it with the stored one."
   }
  },
  "/api/v1/entities/{entity_id}/calendar": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "List calendar entries",
    "operationId": "list_calendar_entries_api_v1_entities__entity_id__calendar_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 200,
       "minimum": 1,
       "default": 50,
       "title": "Page Size"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by status: PENDING, COMPLETED, WAIVED, OVERDUE",
       "title": "Status"
      },
      "description": "Filter by status: PENDING, COMPLETED, WAIVED, OVERDUE"
     },
     {
      "name": "source_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by source type",
       "title": "Source Type"
      },
      "description": "Filter by source type"
     },
     {
      "name": "due_after",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only entries with due_date >= this date",
       "title": "Due After"
      },
      "description": "Only entries with due_date >= this date"
     },
     {
      "name": "due_before",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only entries with due_date <= this date",
       "title": "Due Before"
      },
      "description": "Only entries with due_date <= this date"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CalendarListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Deadlines with filters and pagination."
   },
   "post": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Create a calendar entry",
    "operationId": "create_calendar_entry_api_v1_entities__entity_id__calendar_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CalendarEntryCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/app__schemas__calendar__CalendarEntryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Adds a manual deadline (e.g. an internal obligation)."
   }
  },
  "/api/v1/entities/{entity_id}/calendar/{entry_id}": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Get a calendar entry",
    "operationId": "get_calendar_entry_api_v1_entities__entity_id__calendar__entry_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "entry_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entry Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/app__schemas__calendar__CalendarEntryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Get a calendar entry"
   },
   "patch": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Update a manual calendar entry",
    "operationId": "update_calendar_entry_api_v1_entities__entity_id__calendar__entry_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "entry_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entry Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CalendarEntryUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/app__schemas__calendar__CalendarEntryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Reschedules or re-describes an entry. Marking it COMPLETED or WAIVED is a person's decision: API keys get 403 `Only people can …`."
   }
  },
  "/api/v1/entities/{entity_id}/calendar/overdue": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Overdue filings",
    "operationId": "get_overdue_filings_api_v1_entities__entity_id__calendar_overdue_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/OverdueFilingItem"
         },
         "title": "Response Get Overdue Filings Api V1 Entities  Entity Id  Calendar Overdue Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Overdue filings"
   }
  },
  "/api/v1/entities/{entity_id}/calendar/filing-status": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Deadlines with filing status",
    "operationId": "get_filing_status_api_v1_entities__entity_id__calendar_filing_status_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FilingStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Deadlines with filing status"
   }
  },
  "/api/v1/entities/{entity_id}/calendar/export.ics": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Calendar as iCal",
    "operationId": "export_ical_api_v1_entities__entity_id__calendar_export_ics_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       },
       "text/calendar": {}
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The calendar as an `.ics` file for Outlook or Google Calendar."
   }
  },
  "/api/v1/entities/{entity_id}/compliance-tasks": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "List compliance tasks",
    "operationId": "list_compliance_tasks_api_v1_entities__entity_id__compliance_tasks_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response List Compliance Tasks Api V1 Entities  Entity Id  Compliance Tasks Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Tasks grouped by framework, with their status."
   }
  },
  "/api/v1/entities/{entity_id}/compliance-tasks/{instance_id}": {
   "get": {
    "tags": [
     "Calendar & obligations"
    ],
    "summary": "Get a compliance task",
    "operationId": "get_task_instance_api_v1_entities__entity_id__compliance_tasks__instance_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "instance_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Instance Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TaskInstanceResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Get a compliance task"
   }
  },
  "/api/v1/entities/{entity_id}/sanctions/screen": {
   "post": {
    "tags": [
     "Sanctions screening"
    ],
    "summary": "Screen a name",
    "operationId": "screen_counterparty_api_v1_entities__entity_id__sanctions_screen_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ScreenCounterpartyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ScreeningCheckResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Screens a person or company and stores the check. `status` is CLEARED (no match above the threshold) or PENDING (a possible match for a person to review). 503 when no watchlist is loaded yet — nothing was screened; try again later.\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   }
  },
  "/api/v1/entities/{entity_id}/sanctions/checks": {
   "get": {
    "tags": [
     "Sanctions screening"
    ],
    "summary": "List screening checks",
    "description": "Screenings made for this entity, newest first, with any matched list entry, status (PENDING / CLEARED / MATCHED / ESCALATED) and assignee. Filter with subject_name (part of the name), subject_type, since, status or assigned_to rather than paging the whole history — the history holds every automatic screening of the ledger's counterparties.\n\nRate limit: 20/minute per API key.",
    "operationId": "list_screening_checks_api_v1_entities__entity_id__sanctions_checks_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/ScreeningStatus"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "assigned_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "\"me\" for the reviews assigned to the caller, or a member id",
       "title": "Assigned To"
      },
      "description": "\"me\" for the reviews assigned to the caller, or a member id"
     },
     {
      "name": "subject_name",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "minLength": 2,
         "maxLength": 2000
        },
        {
         "type": "null"
        }
       ],
       "description": "Only screenings of subjects whose name contains this (case-insensitive) — answers \"was X screened before?\" in one call. Several subjects at once: separate them with \"|\" (at most 20), e.g. \"Silverdune Trading|Omari Kentwell\"",
       "title": "Subject Name"
      },
      "description": "Only screenings of subjects whose name contains this (case-insensitive) — answers \"was X screened before?\" in one call. Several subjects at once: separate them with \"|\" (at most 20), e.g. \"Silverdune Trading|Omari Kentwell\""
     },
     {
      "name": "subject_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 20
        },
        {
         "type": "null"
        }
       ],
       "description": "Only this subject type (e.g. CUSTOMER, VENDOR, UBO, EMPLOYEE, OTHER)",
       "title": "Subject Type"
      },
      "description": "Only this subject type (e.g. CUSTOMER, VENDOR, UBO, EMPLOYEE, OTHER)"
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only screenings made on or after this date (YYYY-MM-DD)",
       "title": "Since"
      },
      "description": "Only screenings made on or after this date (YYYY-MM-DD)"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_ScreeningCheckResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/sanctions/summary": {
   "get": {
    "tags": [
     "Sanctions screening"
    ],
    "summary": "Screening summary counts",
    "operationId": "get_sanctions_summary_api_v1_entities__entity_id__sanctions_summary_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SanctionsSummaryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Screening summary counts\n\nRate limit: 20/minute per API key.",
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/sanctions/list-status": {
   "get": {
    "tags": [
     "Sanctions screening"
    ],
    "summary": "Watchlist status",
    "description": "Which lists are loaded and how recent they are.\n\nRate limit: 30/minute per API key.",
    "operationId": "get_list_status_api_v1_entities__entity_id__sanctions_list_status_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WatchlistStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-rate-limit": "30/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/cdd": {
   "post": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "Create a CDD record",
    "operationId": "create_cdd_api_v1_entities__entity_id__aml_cdd_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CDDCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CDDResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Opens customer due diligence for a customer.\n\nRate limit: 5/minute per API key.",
    "x-rate-limit": "5/minute"
   },
   "get": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "List CDD records",
    "operationId": "list_cdd_api_v1_entities__entity_id__aml_cdd_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "risk_level",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Risk Level"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "all_years",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "No year limit (used when fiscal_year is not given)",
       "default": false,
       "title": "All Years"
      },
      "description": "No year limit (used when fiscal_year is not given)"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_CDDResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List CDD records\n\nRate limit: 20/minute per API key.",
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/cdd/{cdd_id}": {
   "patch": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "Update a CDD record",
    "operationId": "update_cdd_api_v1_entities__entity_id__aml_cdd__cdd_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "cdd_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Cdd Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CDDUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CDDResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Update a CDD record\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/cdd/{cdd_id}/documents": {
   "post": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "Upload a KYC document",
    "operationId": "upload_kyc_document_api_v1_entities__entity_id__aml_cdd__cdd_id__documents_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "cdd_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Cdd Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/KYCDocumentUploadResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Stores a KYC document (PDF, PNG, JPG) on a CDD record; every access is logged.\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   },
   "get": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "List KYC documents",
    "operationId": "list_kyc_documents_api_v1_entities__entity_id__aml_cdd__cdd_id__documents_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "cdd_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Cdd Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/KYCDocumentListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List KYC documents\n\nRate limit: 60/minute per API key.",
    "x-rate-limit": "60/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/pep-screen": {
   "post": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "Screen for PEP status",
    "operationId": "screen_pep_api_v1_entities__entity_id__aml_pep_screen_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PEPScreenRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PEPScreeningResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Screen for PEP status\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/pep-results": {
   "get": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "List PEP screening results",
    "operationId": "list_pep_results_api_v1_entities__entity_id__aml_pep_results_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "default": 50,
       "title": "Page Size"
      }
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "all_years",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "No year limit (used when fiscal_year is not given)",
       "default": false,
       "title": "All Years"
      },
      "description": "No year limit (used when fiscal_year is not given)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/PEPScreeningResponse"
         },
         "title": "Response List Pep Results Api V1 Entities  Entity Id  Aml Pep Results Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List PEP screening results\n\nRate limit: 20/minute per API key.",
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/aml/alerts": {
   "get": {
    "tags": [
     "AML & CDD"
    ],
    "summary": "List AML alerts",
    "operationId": "list_alerts_api_v1_entities__entity_id__aml_alerts_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "severity",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Severity"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "default": 50,
       "title": "Page Size"
      }
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "all_years",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Every year (ignored when fiscal_year is given)",
       "default": false,
       "title": "All Years"
      },
      "description": "Every year (ignored when fiscal_year is given)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AlertResponse"
         },
         "title": "Response List Alerts Api V1 Entities  Entity Id  Aml Alerts Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List AML alerts\n\nRate limit: 20/minute per API key.",
    "x-rate-limit": "20/minute"
   }
  },
  "/api/v1/entities/{entity_id}/employees": {
   "post": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Create an employee",
    "operationId": "create_employee_api_v1_entities__entity_id__employees_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmployeeCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmployeeDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Create an employee"
   },
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "List employees",
    "operationId": "list_employees_api_v1_entities__entity_id__employees_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "include_terminated",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Terminated"
      }
     },
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 200
        },
        {
         "type": "null"
        }
       ],
       "description": "Search by name or employee number",
       "title": "Search"
      },
      "description": "Search by name or employee number"
     },
     {
      "name": "nationality",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 100
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by nationality",
       "title": "Nationality"
      },
      "description": "Filter by nationality"
     },
     {
      "name": "department",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 200
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by department",
       "title": "Department"
      },
      "description": "Filter by department"
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_EmployeeListResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Salaries are masked in list and detail responses."
   }
  },
  "/api/v1/entities/{entity_id}/employees/{employee_id}": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Get an employee",
    "operationId": "get_employee_api_v1_entities__entity_id__employees__employee_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Employee Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmployeeDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Get an employee"
   },
   "patch": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Update an employee",
    "operationId": "update_employee_api_v1_entities__entity_id__employees__employee_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Employee Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmployeeUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmployeeDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Update an employee"
   }
  },
  "/api/v1/entities/{entity_id}/employees/bulk-upload": {
   "post": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Import employees from a file",
    "operationId": "bulk_upload_employees_api_v1_entities__entity_id__employees_bulk_upload_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_bulk_upload_employees_api_v1_entities__entity_id__employees_bulk_upload_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response Bulk Upload Employees Api V1 Entities  Entity Id  Employees Bulk Upload Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Creates or updates employees from a CSV or XLSX file (multipart `file`)."
   }
  },
  "/api/v1/entities/{entity_id}/workforce/summary": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Head counts",
    "operationId": "get_workforce_summary_api_v1_entities__entity_id__workforce_summary_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WorkforceSummaryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Head counts"
   }
  },
  "/api/v1/entities/{entity_id}/employees/{employee_id}/wps": {
   "post": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Record a WPS salary payment",
    "operationId": "upsert_wps_record_api_v1_entities__entity_id__employees__employee_id__wps_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Employee Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WPSRecordCreateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WPSRecordResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Creates or updates the employee's WPS salary record for a month."
   }
  },
  "/api/v1/entities/{entity_id}/workforce/wps/bulk-upload": {
   "post": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Import WPS salary records",
    "description": "Bulk import of WPS salary records from CSV or XLSX.",
    "operationId": "bulk_upload_wps_api_v1_entities__entity_id__workforce_wps_bulk_upload_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_bulk_upload_wps_api_v1_entities__entity_id__workforce_wps_bulk_upload_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ImportResultResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/workforce/wps/records": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "List WPS salary records",
    "description": "Holders of workforce:view get the entity's records. Someone with only\nworkforce:view_own (the employee self-service role) gets the records of\nthe employee record linked to their login — never anyone else's, whatever\n``employee_id`` asks for.",
    "operationId": "list_wps_records_api_v1_entities__entity_id__workforce_wps_records_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "uuid"
        },
        {
         "type": "null"
        }
       ],
       "title": "Employee Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/WPSRecordResponse"
         },
         "title": "Response List Wps Records Api V1 Entities  Entity Id  Workforce Wps Records Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/workforce/wps": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "WPS compliance",
    "operationId": "get_wps_compliance_api_v1_entities__entity_id__workforce_wps_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/WPSComplianceStatus"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "WPS compliance"
   }
  },
  "/api/v1/entities/{entity_id}/workforce/emiratization": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Emiratisation status",
    "operationId": "get_emiratization_api_v1_entities__entity_id__workforce_emiratization_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "include_recommendations",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Recommendations"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmiratiZationStatus"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Emiratisation status"
   }
  },
  "/api/v1/entities/{entity_id}/workforce/documents/expiring": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Expiring employee documents",
    "operationId": "list_expiring_documents_api_v1_entities__entity_id__workforce_documents_expiring_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "within_days",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 730,
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "description": "Look-ahead window; defaults to the entity's longest reminder lead time",
       "title": "Within Days"
      },
      "description": "Look-ahead window; defaults to the entity's longest reminder lead time"
     },
     {
      "name": "document_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/EmployeeDocumentType"
        },
        {
         "type": "null"
        }
       ],
       "title": "Document Type"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/EmployeeDocumentResponse"
         },
         "title": "Response List Expiring Documents Api V1 Entities  Entity Id  Workforce Documents Expiring Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Visas, Emirates IDs, labour cards and passports that have expired or expire soon."
   }
  },
  "/api/v1/entities/{entity_id}/employees/{employee_id}/documents": {
   "get": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "List an employee's documents",
    "description": "Document numbers are shown in full to workforce:view_sensitive holders\nand to the employee themselves; other readers see the last four\ncharacters.",
    "operationId": "list_employee_documents_api_v1_entities__entity_id__employees__employee_id__documents_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Employee Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/EmployeeDocumentResponse"
         },
         "title": "Response List Employee Documents Api V1 Entities  Entity Id  Employees  Employee Id  Documents Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Employees & WPS"
    ],
    "summary": "Record an employee document",
    "operationId": "create_employee_document_api_v1_entities__entity_id__employees__employee_id__documents_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "employee_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Employee Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmployeeDocumentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmployeeDocumentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Records a visa, Emirates ID, labour card or passport and its expiry date."
   }
  },
  "/api/v1/entities/{entity_id}/contracts": {
   "post": {
    "tags": [
     "Contracts"
    ],
    "summary": "Upload a contract",
    "operationId": "upload_contract_api_v1_entities__entity_id__contracts_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_contract_api_v1_entities__entity_id__contracts_post"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ContractUploadResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Uploads a contract file (multipart `file`) and starts extraction in the background. Uses AI credits.\n\nRate limit: 10/minute per API key.",
    "x-rate-limit": "10/minute"
   },
   "get": {
    "tags": [
     "Contracts"
    ],
    "summary": "List contracts",
    "operationId": "list_contracts_api_v1_entities__entity_id__contracts_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/ContractProcessingStatus"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "lifecycle_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/ContractLifecycleStatus"
        },
        {
         "type": "null"
        }
       ],
       "title": "Lifecycle Status"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        },
        {
         "type": "null"
        }
       ],
       "title": "Q"
      }
     },
     {
      "name": "contract_type",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/app__models__contract__ContractType"
        },
        {
         "type": "null"
        }
       ],
       "title": "Contract Type"
      }
     },
     {
      "name": "risk_category",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/app__models__contract__RiskCategory"
        },
        {
         "type": "null"
        }
       ],
       "title": "Risk Category"
      }
     },
     {
      "name": "requires_human_review",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "boolean"
        },
        {
         "type": "null"
        }
       ],
       "title": "Requires Human Review"
      }
     },
     {
      "name": "effective_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Effective From"
      }
     },
     {
      "name": "effective_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Effective To"
      }
     },
     {
      "name": "expiry_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Expiry From"
      }
     },
     {
      "name": "expiry_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Expiry To"
      }
     },
     {
      "name": "fiscal_year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Fiscal year (defaults to current year)",
       "title": "Fiscal Year"
      },
      "description": "Fiscal year (defaults to current year)"
     },
     {
      "name": "counterparty_vendor_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "uuid"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only contracts linked to this vendor-directory record",
       "title": "Counterparty Vendor Id"
      },
      "description": "Only contracts linked to this vendor-directory record"
     },
     {
      "name": "review_assigned_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "uuid"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only contracts whose review is assigned to this person",
       "title": "Review Assigned To"
      },
      "description": "Only contracts whose review is assigned to this person"
     },
     {
      "name": "assigned_to_me",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Only contracts whose review is assigned to the caller",
       "default": false,
       "title": "Assigned To Me"
      },
      "description": "Only contracts whose review is assigned to the caller"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_ContractListResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List contracts"
   }
  },
  "/api/v1/entities/{entity_id}/contracts/{contract_id}": {
   "get": {
    "tags": [
     "Contracts"
    ],
    "summary": "Get a contract",
    "operationId": "get_contract_api_v1_entities__entity_id__contracts__contract_id__get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "contract_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Contract Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ContractDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The contract with its extracted fields and compliance checks."
   }
  },
  "/api/v1/entities/{entity_id}/contracts/expiring": {
   "get": {
    "tags": [
     "Contracts"
    ],
    "summary": "Contracts expiring soon",
    "operationId": "get_expiring_contracts_api_v1_entities__entity_id__contracts_expiring_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 365,
       "minimum": 1,
       "default": 90,
       "title": "Days"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_ContractListResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Contracts expiring soon"
   }
  },
  "/api/v1/entities/{entity_id}/contracts/{contract_id}/obligations": {
   "get": {
    "tags": [
     "Contracts"
    ],
    "summary": "List a contract's obligations",
    "operationId": "list_obligations_api_v1_entities__entity_id__contracts__contract_id__obligations_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "contract_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Contract Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ObligationListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List a contract's obligations"
   }
  },
  "/api/v1/entities/{entity_id}/esg/emissions": {
   "post": {
    "tags": [
     "ESG"
    ],
    "summary": "Create an emission record",
    "operationId": "create_emission_record_api_v1_entities__entity_id__esg_emissions_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmissionRecordCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmissionRecordResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Create an emission record"
   },
   "get": {
    "tags": [
     "ESG"
    ],
    "summary": "List emission records",
    "operationId": "list_emission_records_api_v1_entities__entity_id__esg_emissions_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/EmissionScope"
        },
        {
         "type": "null"
        }
       ],
       "title": "Scope"
      }
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/EmissionCategory"
        },
        {
         "type": "null"
        }
       ],
       "title": "Category"
      }
     },
     {
      "name": "period_start",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Period Start"
      }
     },
     {
      "name": "period_end",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Period End"
      }
     },
     {
      "name": "year",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by year",
       "title": "Year"
      },
      "description": "Filter by year"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_EmissionRecordResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List emission records"
   }
  },
  "/api/v1/entities/{entity_id}/esg/emissions/{record_id}": {
   "patch": {
    "tags": [
     "ESG"
    ],
    "summary": "Update an emission record",
    "operationId": "update_emission_record_api_v1_entities__entity_id__esg_emissions__record_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "record_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Record Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmissionRecordUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmissionRecordResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Update an emission record"
   }
  },
  "/api/v1/entities/{entity_id}/esg/emissions/import": {
   "post": {
    "tags": [
     "ESG"
    ],
    "summary": "Import emission records from a file",
    "description": "CSV or XLSX (multipart `file`).",
    "operationId": "import_emissions_api_v1_entities__entity_id__esg_emissions_import_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "duplicates",
      "in": "query",
      "required": false,
      "schema": {
       "enum": [
        "check",
        "skip",
        "import"
       ],
       "type": "string",
       "description": "Rows that already exist: check (import nothing, report them), skip (import only new rows) or import (import all)",
       "default": "check",
       "title": "Duplicates"
      },
      "description": "Rows that already exist: check (import nothing, report them), skip (import only new rows) or import (import all)"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_import_emissions_api_v1_entities__entity_id__esg_emissions_import_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmissionImportResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/entities/{entity_id}/esg/metrics": {
   "post": {
    "tags": [
     "ESG"
    ],
    "summary": "Create an ESG metric data point",
    "description": "One live data point per metric key and period: posting it again updates\nthe value (200) instead of adding a duplicate row. Changing an existing\nfigure needs esg:edit, exactly as PATCH does.",
    "operationId": "create_esg_metric_api_v1_entities__entity_id__esg_metrics_post",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ESGMetricCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ESGMetricResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "ESG"
    ],
    "summary": "List ESG metrics",
    "operationId": "list_esg_metrics_api_v1_entities__entity_id__esg_metrics_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "pillar",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "$ref": "#/components/schemas/ESGPillar"
        },
        {
         "type": "null"
        }
       ],
       "title": "Pillar"
      }
     },
     {
      "name": "include_archived",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Archived"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_ESGMetricResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List ESG metrics"
   }
  },
  "/api/v1/entities/{entity_id}/esg/metrics/{metric_id}": {
   "patch": {
    "tags": [
     "ESG"
    ],
    "summary": "Update an ESG metric",
    "operationId": "update_esg_metric_api_v1_entities__entity_id__esg_metrics__metric_id__patch",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "metric_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Metric Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ESGMetricUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ESGMetricResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Update an ESG metric"
   }
  },
  "/api/v1/entities/{entity_id}/esg/carbon-footprint": {
   "get": {
    "tags": [
     "ESG"
    ],
    "summary": "Carbon footprint",
    "operationId": "get_carbon_footprint_api_v1_entities__entity_id__esg_carbon_footprint_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "year",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "maximum": 2100,
       "minimum": 2020,
       "title": "Year"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CarbonFootprintResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Scope 1, 2 and 3 totals for a year."
   }
  },
  "/api/v1/entities/{entity_id}/esg/dashboard": {
   "get": {
    "tags": [
     "ESG"
    ],
    "summary": "ESG dashboard figures",
    "operationId": "get_dashboard_api_v1_entities__entity_id__esg_dashboard_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "year",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 2100,
       "minimum": 2020,
       "default": 2026,
       "title": "Year"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ESGDashboardResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "ESG dashboard figures"
   }
  },
  "/api/v1/entities/{entity_id}/regulatory/alerts": {
   "get": {
    "tags": [
     "Regulatory & search"
    ],
    "summary": "List regulatory alerts",
    "operationId": "list_entity_alerts_api_v1_entities__entity_id__regulatory_alerts_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "include_dismissed",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Dismissed"
      }
     },
     {
      "name": "impact_level",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by impact level: LOW, MEDIUM, HIGH, CRITICAL",
       "title": "Impact Level"
      },
      "description": "Filter by impact level: LOW, MEDIUM, HIGH, CRITICAL"
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 20,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedResponse_EntityAlertListResponse_"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "List regulatory alerts"
   }
  },
  "/api/v1/entities/{entity_id}/search": {
   "get": {
    "tags": [
     "Regulatory & search"
    ],
    "summary": "Search records",
    "description": "Finds records across modules by name, reference or invoice number.",
    "operationId": "search_records_api_v1_entities__entity_id__search_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Entity Id"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 200,
       "description": "Text to find (case-insensitive, part of a word is enough)",
       "title": "Q"
      },
      "description": "Text to find (case-insensitive, part of a word is enough)"
     },
     {
      "name": "types",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Comma-separated: counterparty, transaction, contract, cdd, employee, document, sanctions_check, alert, obligation, free_zone_item, calendar, member",
       "title": "Types"
      },
      "description": "Comma-separated: counterparty, transaction, contract, cdd, employee, document, sanctions_check, alert, obligation, free_zone_item, calendar, member"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "description": "Most hits per type",
       "default": 20,
       "title": "Limit"
      },
      "description": "Most hits per type"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response Search Records Api V1 Entities  Entity Id  Search Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/settings/webhooks/events": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "List event types",
    "operationId": "list_event_types_api_v1_settings_webhooks_events_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "string"
         },
         "title": "Response List Event Types Api V1 Settings Webhooks Events Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "Every event type an endpoint can subscribe to."
   }
  },
  "/api/v1/me/permissions": {
   "get": {
    "tags": [
     "Access"
    ],
    "summary": "The key's permissions",
    "operationId": "my_permissions_api_v1_me_permissions_get",
    "security": [
     {
      "ApiKeyAuth": []
     }
    ],
    "parameters": [
     {
      "name": "entity_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "uuid"
        },
        {
         "type": "null"
        }
       ],
       "title": "Entity Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "title": "Response My Permissions Api V1 Me Permissions Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     },
     "401": {
      "description": "Missing, invalid, expired or revoked API key.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key lacks the permission, or may not reach this entity.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Rate limit exceeded; wait `Retry-After` seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "The effective permissions of the caller, organisation-wide or on one entity (`entity_id` query parameter)."
   }
  }
 },
 "components": {
  "schemas": {
   "AccountingSystem": {
    "type": "string",
    "enum": [
     "QUICKBOOKS",
     "ZOHO_BOOKS",
     "XERO",
     "TALLY",
     "SAGE",
     "NETSUITE",
     "DYNAMICS",
     "ODOO",
     "CLEARTAX",
     "WAFEQ",
     "MANUAL"
    ],
    "title": "AccountingSystem"
   },
   "AlertResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "rule_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rule Id"
     },
     "alert_type": {
      "type": "string",
      "title": "Alert Type"
     },
     "severity": {
      "$ref": "#/components/schemas/AlertSeverity"
     },
     "status": {
      "$ref": "#/components/schemas/AlertStatus"
     },
     "amount_involved": {
      "type": "string",
      "title": "Amount Involved"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "transaction_ids": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Transaction Ids",
      "default": []
     },
     "transactions": {
      "items": {
       "type": "object"
      },
      "type": "array",
      "title": "Transactions",
      "default": []
     },
     "sar": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Sar"
     },
     "assigned_to": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assigned To"
     },
     "assigned_to_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assigned To Name"
     },
     "resolution_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Resolution Notes"
     },
     "dismissed_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dismissed Reason"
     },
     "escalated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Escalated At"
     },
     "resolved_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Resolved At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "alert_type",
     "severity",
     "status",
     "amount_involved",
     "created_at"
    ],
    "title": "AlertResponse"
   },
   "AlertSeverity": {
    "type": "string",
    "enum": [
     "LOW",
     "MEDIUM",
     "HIGH",
     "CRITICAL"
    ],
    "title": "AlertSeverity"
   },
   "AlertStatus": {
    "type": "string",
    "enum": [
     "OPEN",
     "INVESTIGATING",
     "ESCALATED",
     "DISMISSED",
     "FILED"
    ],
    "title": "AlertStatus"
   },
   "AsyncTaskResponse": {
    "properties": {
     "task_id": {
      "type": "string",
      "title": "Task Id"
     },
     "status": {
      "type": "string",
      "title": "Status",
      "default": "PENDING"
     },
     "message": {
      "type": "string",
      "title": "Message",
      "default": "Task submitted"
     }
    },
    "type": "object",
    "required": [
     "task_id"
    ],
    "title": "AsyncTaskResponse",
    "description": "Returned when work is dispatched to a background Celery task (HTTP 202)."
   },
   "AsyncTaskStatusResponse": {
    "properties": {
     "task_id": {
      "type": "string",
      "title": "Task Id"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "result": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Result"
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     }
    },
    "type": "object",
    "required": [
     "task_id",
     "status"
    ],
    "title": "AsyncTaskStatusResponse",
    "description": "Returned by GET /tasks/{task_id}/status — poll until state is SUCCESS/FAILURE."
   },
   "Body_bulk_upload_employees_api_v1_entities__entity_id__employees_bulk_upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_bulk_upload_employees_api_v1_entities__entity_id__employees_bulk_upload_post"
   },
   "Body_bulk_upload_wps_api_v1_entities__entity_id__workforce_wps_bulk_upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_bulk_upload_wps_api_v1_entities__entity_id__workforce_wps_bulk_upload_post"
   },
   "Body_import_emissions_api_v1_entities__entity_id__esg_emissions_import_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_import_emissions_api_v1_entities__entity_id__esg_emissions_import_post"
   },
   "Body_import_tax_transactions_api_v1_entities__entity_id__tax_transactions_import_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_import_tax_transactions_api_v1_entities__entity_id__tax_transactions_import_post"
   },
   "Body_upload_contract_api_v1_entities__entity_id__contracts_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_contract_api_v1_entities__entity_id__contracts_post"
   },
   "Body_upload_document_api_v1_entities__entity_id__documents_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "category": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Category"
     },
     "tags": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tags"
     },
     "folder": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Folder"
     }
    },
    "type": "object",
    "required": [
     "file",
     "title"
    ],
    "title": "Body_upload_document_api_v1_entities__entity_id__documents_post"
   },
   "Body_upload_evidence_api_v1_entities__entity_id__evidence_upload_post": {
    "properties": {
     "source_type": {
      "$ref": "#/components/schemas/EvidenceSourceType"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id"
     },
     "retention_policy": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RetentionPolicy"
       },
       {
        "type": "null"
       }
      ]
     },
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "source_type",
     "file"
    ],
    "title": "Body_upload_evidence_api_v1_entities__entity_id__evidence_upload_post"
   },
   "Body_upload_transaction_evidence_api_v1_entities__entity_id__tax_transactions__transaction_id__evidence_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_transaction_evidence_api_v1_entities__entity_id__tax_transactions__transaction_id__evidence_post"
   },
   "CDDCreateRequest": {
    "properties": {
     "customer_name": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Customer Name"
     },
     "customer_type": {
      "$ref": "#/components/schemas/CustomerType"
     },
     "risk_level": {
      "$ref": "#/components/schemas/RiskLevel-Input",
      "default": "MEDIUM"
     },
     "cdd_type": {
      "$ref": "#/components/schemas/CDDType",
      "default": "STANDARD"
     },
     "documents_collected": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Documents Collected"
     },
     "source_of_funds": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Funds"
     },
     "source_of_wealth": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Wealth"
     },
     "next_review_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Review Date"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 5000
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "required": [
     "customer_name",
     "customer_type"
    ],
    "title": "CDDCreateRequest"
   },
   "CDDResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "customer_name": {
      "type": "string",
      "title": "Customer Name"
     },
     "customer_type": {
      "$ref": "#/components/schemas/CustomerType"
     },
     "risk_level": {
      "$ref": "#/components/schemas/app__models__aml__RiskLevel"
     },
     "cdd_type": {
      "$ref": "#/components/schemas/CDDType"
     },
     "verification_status": {
      "$ref": "#/components/schemas/CDDVerificationStatus"
     },
     "documents_collected": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Documents Collected"
     },
     "source_of_funds": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Funds"
     },
     "source_of_wealth": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Wealth"
     },
     "next_review_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Review Date"
     },
     "reviewer_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewer Id"
     },
     "reviewer_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewer Name"
     },
     "verified_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified At"
     },
     "verified_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified By"
     },
     "verified_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified By Name"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     },
     "relationship_end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Relationship End Date"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "customer_name",
     "customer_type",
     "risk_level",
     "cdd_type",
     "verification_status",
     "created_at"
    ],
    "title": "CDDResponse"
   },
   "CDDType": {
    "type": "string",
    "enum": [
     "STANDARD",
     "ENHANCED",
     "SIMPLIFIED"
    ],
    "title": "CDDType"
   },
   "CDDUpdateRequest": {
    "properties": {
     "customer_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Customer Name"
     },
     "customer_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CustomerType"
       },
       {
        "type": "null"
       }
      ]
     },
     "risk_level": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RiskLevel-Input"
       },
       {
        "type": "null"
       }
      ]
     },
     "cdd_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CDDType"
       },
       {
        "type": "null"
       }
      ]
     },
     "verification_status": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CDDVerificationStatus"
       },
       {
        "type": "null"
       }
      ]
     },
     "documents_collected": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Documents Collected"
     },
     "source_of_funds": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Funds"
     },
     "source_of_wealth": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Of Wealth"
     },
     "next_review_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Review Date"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 5000
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     },
     "relationship_end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Relationship End Date"
     }
    },
    "type": "object",
    "title": "CDDUpdateRequest"
   },
   "CDDVerificationStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "IN_PROGRESS",
     "VERIFIED",
     "FAILED",
     "EXPIRED"
    ],
    "title": "CDDVerificationStatus"
   },
   "CTReturnComputeRequest": {
    "properties": {
     "tax_period_start": {
      "type": "string",
      "format": "date",
      "title": "Tax Period Start"
     },
     "tax_period_end": {
      "type": "string",
      "format": "date",
      "title": "Tax Period End"
     }
    },
    "type": "object",
    "required": [
     "tax_period_start",
     "tax_period_end"
    ],
    "title": "CTReturnComputeRequest",
    "description": "Trigger CT return computation for a fiscal year."
   },
   "CTReturnResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "tax_period_start": {
      "type": "string",
      "format": "date",
      "title": "Tax Period Start"
     },
     "tax_period_end": {
      "type": "string",
      "format": "date",
      "title": "Tax Period End"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "gross_income": {
      "type": "string",
      "title": "Gross Income"
     },
     "exempt_income": {
      "type": "string",
      "title": "Exempt Income"
     },
     "qualifying_free_zone_income": {
      "type": "string",
      "title": "Qualifying Free Zone Income"
     },
     "total_deductions": {
      "type": "string",
      "title": "Total Deductions"
     },
     "taxable_income": {
      "type": "string",
      "title": "Taxable Income"
     },
     "tax_payable": {
      "type": "string",
      "title": "Tax Payable"
     },
     "status": {
      "$ref": "#/components/schemas/ReturnStatus"
     },
     "filed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed At"
     },
     "filed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed By"
     },
     "ai_summary": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Summary"
     },
     "ai_risk_flags": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Risk Flags"
     },
     "unclassified_amount": {
      "type": "string",
      "title": "Unclassified Amount"
     },
     "requires_human_review": {
      "type": "boolean",
      "title": "Requires Human Review"
     },
     "gross_interest_expense": {
      "type": "string",
      "title": "Gross Interest Expense",
      "default": "0.00"
     },
     "interest_deduction_allowed": {
      "type": "string",
      "title": "Interest Deduction Allowed",
      "default": "0.00"
     },
     "interest_disallowed": {
      "type": "string",
      "title": "Interest Disallowed",
      "default": "0.00"
     },
     "prior_interest_carried_in": {
      "type": "string",
      "title": "Prior Interest Carried In",
      "default": "0.00"
     },
     "blocked_vat_total": {
      "type": "string",
      "title": "Blocked Vat Total",
      "default": "0.00"
     },
     "prior_year_losses_available": {
      "type": "string",
      "title": "Prior Year Losses Available",
      "default": "0.00"
     },
     "losses_used_this_period": {
      "type": "string",
      "title": "Losses Used This Period",
      "default": "0.00"
     },
     "losses_carried_forward": {
      "type": "string",
      "title": "Losses Carried Forward",
      "default": "0.00"
     },
     "foreign_tax_credit": {
      "type": "string",
      "title": "Foreign Tax Credit",
      "default": "0.00"
     },
     "unused_ftc_amount": {
      "type": "string",
      "title": "Unused Ftc Amount",
      "default": "0.00"
     },
     "ftc_carried_forward_from_prior": {
      "type": "string",
      "title": "Ftc Carried Forward From Prior",
      "default": "0.00"
     },
     "refundable_tax_credit": {
      "type": "string",
      "title": "Refundable Tax Credit",
      "default": "0.00"
     },
     "refundable_tax_credit_details": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Refundable Tax Credit Details"
     },
     "wht_on_foreign_payments": {
      "type": "string",
      "title": "Wht On Foreign Payments",
      "default": "0.00"
     },
     "foreign_payment_count": {
      "type": "integer",
      "title": "Foreign Payment Count",
      "default": 0
     },
     "tp_related_party_count": {
      "type": "integer",
      "title": "Tp Related Party Count",
      "default": 0
     },
     "tp_total_amount": {
      "type": "string",
      "title": "Tp Total Amount",
      "default": "0.00"
     },
     "tp_docs_complete": {
      "type": "boolean",
      "title": "Tp Docs Complete",
      "default": true
     },
     "payroll_total_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Payroll Total Aed"
     },
     "staff_cost_delta_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Staff Cost Delta Aed"
     },
     "expense_subcategories": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense Subcategories"
     },
     "depreciation_amount": {
      "type": "string",
      "title": "Depreciation Amount",
      "default": "0.00"
     },
     "entertainment_deduction": {
      "type": "string",
      "title": "Entertainment Deduction",
      "default": "0.00"
     },
     "other_deductions": {
      "type": "string",
      "title": "Other Deductions",
      "default": "0.00"
     },
     "proforma_taxable_income": {
      "type": "string",
      "title": "Proforma Taxable Income",
      "default": "0.00"
     },
     "proforma_tax_payable": {
      "type": "string",
      "title": "Proforma Tax Payable",
      "default": "0.00"
     },
     "pending_income_total": {
      "type": "string",
      "title": "Pending Income Total",
      "default": "0.00"
     },
     "pending_expense_total": {
      "type": "string",
      "title": "Pending Expense Total",
      "default": "0.00"
     },
     "ai_projected_gross_income": {
      "type": "string",
      "title": "Ai Projected Gross Income",
      "default": "0.00"
     },
     "ai_projected_exempt_income": {
      "type": "string",
      "title": "Ai Projected Exempt Income",
      "default": "0.00"
     },
     "ai_projected_qualifying_fz_income": {
      "type": "string",
      "title": "Ai Projected Qualifying Fz Income",
      "default": "0.00"
     },
     "ai_projected_total_deductions": {
      "type": "string",
      "title": "Ai Projected Total Deductions",
      "default": "0.00"
     },
     "ai_projected_taxable_income": {
      "type": "string",
      "title": "Ai Projected Taxable Income",
      "default": "0.00"
     },
     "ai_projected_tax_payable": {
      "type": "string",
      "title": "Ai Projected Tax Payable",
      "default": "0.00"
     },
     "ai_projected_pending_count": {
      "type": "integer",
      "title": "Ai Projected Pending Count",
      "default": 0
     },
     "ai_projected_confidence_avg": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Projected Confidence Avg"
     },
     "ai_projected_de_minimis_breached": {
      "type": "boolean",
      "title": "Ai Projected De Minimis Breached",
      "default": false
     },
     "data_coverage_confirmed_pct": {
      "type": "string",
      "title": "Data Coverage Confirmed Pct",
      "default": "0.00"
     },
     "data_coverage_ai_projected_pct": {
      "type": "string",
      "title": "Data Coverage Ai Projected Pct",
      "default": "0.00"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "computation_notes": {
      "items": {
       "type": "object"
      },
      "type": "array",
      "title": "Computation Notes",
      "default": []
     },
     "deduction_breakdown": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deduction Breakdown"
     },
     "recompute_blocked": {
      "type": "boolean",
      "title": "Recompute Blocked",
      "default": false
     },
     "requires_voluntary_disclosure": {
      "type": "boolean",
      "title": "Requires Voluntary Disclosure",
      "default": false
     },
     "filed_figures": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed Figures"
     },
     "recomputed_figures": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recomputed Figures"
     },
     "recompute_delta": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recompute Delta"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "tax_period_start",
     "tax_period_end",
     "due_date",
     "gross_income",
     "exempt_income",
     "qualifying_free_zone_income",
     "total_deductions",
     "taxable_income",
     "tax_payable",
     "status",
     "unclassified_amount",
     "requires_human_review",
     "created_at"
    ],
    "title": "CTReturnResponse"
   },
   "CalendarEntryCreate": {
    "properties": {
     "title": {
      "type": "string",
      "maxLength": 500,
      "minLength": 3,
      "title": "Title"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "description": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     }
    },
    "type": "object",
    "required": [
     "title",
     "due_date"
    ],
    "title": "CalendarEntryCreate"
   },
   "CalendarEntryUpdate": {
    "properties": {
     "title": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500,
        "minLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Title"
     },
     "due_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Due Date"
     },
     "description": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "status": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CalendarStatus"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "type": "object",
    "title": "CalendarEntryUpdate"
   },
   "CalendarListResponse": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/app__schemas__calendar__CalendarEntryResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size"
    ],
    "title": "CalendarListResponse"
   },
   "CalendarStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "COMPLETED",
     "WAIVED",
     "OVERDUE"
    ],
    "title": "CalendarStatus"
   },
   "CarbonFootprintResponse": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "year": {
      "type": "integer",
      "title": "Year"
     },
     "total_co2e_kg": {
      "type": "string",
      "title": "Total Co2E Kg"
     },
     "total_co2e_tonnes": {
      "type": "string",
      "title": "Total Co2E Tonnes"
     },
     "scope_breakdown": {
      "items": {
       "$ref": "#/components/schemas/ScopeBreakdown"
      },
      "type": "array",
      "title": "Scope Breakdown"
     },
     "category_breakdown": {
      "items": {
       "$ref": "#/components/schemas/CategoryBreakdown"
      },
      "type": "array",
      "title": "Category Breakdown"
     },
     "monthly_trend": {
      "items": {
       "$ref": "#/components/schemas/MonthlyEmission"
      },
      "type": "array",
      "title": "Monthly Trend"
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "year",
     "total_co2e_kg",
     "total_co2e_tonnes",
     "scope_breakdown",
     "category_breakdown",
     "monthly_trend"
    ],
    "title": "CarbonFootprintResponse"
   },
   "CategoryBreakdown": {
    "properties": {
     "category": {
      "$ref": "#/components/schemas/EmissionCategory"
     },
     "total_co2e_kg": {
      "type": "string",
      "title": "Total Co2E Kg"
     },
     "percentage": {
      "type": "string",
      "title": "Percentage"
     }
    },
    "type": "object",
    "required": [
     "category",
     "total_co2e_kg",
     "percentage"
    ],
    "title": "CategoryBreakdown"
   },
   "CheckStatus": {
    "type": "string",
    "enum": [
     "PASS",
     "FAIL",
     "WARNING",
     "NOT_APPLICABLE",
     "PENDING"
    ],
    "title": "CheckStatus"
   },
   "ClassificationResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "transaction_id": {
      "type": "string",
      "format": "uuid",
      "title": "Transaction Id"
     },
     "ct_category": {
      "$ref": "#/components/schemas/TaxCategory"
     },
     "vat_treatment": {
      "$ref": "#/components/schemas/TaxCategory"
     },
     "ai_reasoning": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Reasoning"
     },
     "ai_confidence": {
      "type": "string",
      "title": "Ai Confidence"
     },
     "review_flags": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Flags"
     },
     "review_status": {
      "$ref": "#/components/schemas/app__models__tax__ReviewStatus"
     },
     "reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By"
     },
     "reviewed_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By Name"
     },
     "reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed At"
     },
     "reviewer_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewer Notes"
     },
     "ct_category_override": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TaxCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "vat_treatment_override": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TaxCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "effective_ct_category": {
      "$ref": "#/components/schemas/TaxCategory"
     },
     "effective_vat_treatment": {
      "$ref": "#/components/schemas/TaxCategory"
     },
     "is_unrealised": {
      "type": "boolean",
      "title": "Is Unrealised",
      "default": false
     },
     "asset_account_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Asset Account Type"
     },
     "asset_cost_base": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Asset Cost Base"
     },
     "vat_evidence_block": {
      "type": "boolean",
      "title": "Vat Evidence Block",
      "default": false
     },
     "vat_evidence_block_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Evidence Block Reason"
     },
     "ct_evidence_override": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Evidence Override"
     },
     "ct_evidence_override_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Evidence Override Reason"
     },
     "entity_context": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/EntityElectionContext"
       },
       {
        "type": "null"
       }
      ]
     },
     "classification_source": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Classification Source"
     },
     "source_ref": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Ref"
     },
     "mandatory_review_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mandatory Review Reason"
     }
    },
    "type": "object",
    "required": [
     "id",
     "transaction_id",
     "ct_category",
     "vat_treatment",
     "ai_confidence",
     "review_status",
     "effective_ct_category",
     "effective_vat_treatment"
    ],
    "title": "ClassificationResponse"
   },
   "ComplianceCheckResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "check_code": {
      "type": "string",
      "title": "Check Code"
     },
     "check_name": {
      "type": "string",
      "title": "Check Name"
     },
     "status": {
      "$ref": "#/components/schemas/CheckStatus"
     },
     "detail": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Detail"
     },
     "recommendation": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recommendation"
     },
     "legal_reference": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Legal Reference"
     },
     "ai_confidence": {
      "type": "string",
      "title": "Ai Confidence"
     },
     "requires_human_review": {
      "type": "boolean",
      "title": "Requires Human Review"
     }
    },
    "type": "object",
    "required": [
     "id",
     "check_code",
     "check_name",
     "status",
     "ai_confidence",
     "requires_human_review"
    ],
    "title": "ComplianceCheckResponse"
   },
   "CompliancePriority": {
    "type": "string",
    "enum": [
     "CRITICAL",
     "HIGH",
     "MEDIUM",
     "LOW"
    ],
    "title": "CompliancePriority"
   },
   "ComplianceStatus": {
    "type": "string",
    "enum": [
     "COMPLIANT",
     "AT_RISK",
     "NON_COMPLIANT",
     "PENDING_REVIEW",
     "NOT_APPLICABLE"
    ],
    "title": "ComplianceStatus"
   },
   "ContractDetailResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "contract_type": {
      "$ref": "#/components/schemas/app__models__contract__ContractType"
     },
     "contract_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Title"
     },
     "processing_status": {
      "$ref": "#/components/schemas/ContractProcessingStatus"
     },
     "lifecycle_status": {
      "$ref": "#/components/schemas/ContractLifecycleStatus",
      "default": "ACTIVE"
     },
     "overall_risk_score": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Overall Risk Score"
     },
     "risk_category": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__contract__RiskCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "effective_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Effective Date"
     },
     "expiry_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expiry Date"
     },
     "party_a_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party A Name"
     },
     "party_b_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party B Name"
     },
     "contract_value_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Value Aed"
     },
     "counterparty_vendor_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Counterparty Vendor Id"
     },
     "requires_human_review": {
      "type": "boolean",
      "title": "Requires Human Review"
     },
     "review_assigned_to": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned To"
     },
     "review_assigned_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned At"
     },
     "review_assigned_to_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned To Name"
     },
     "ai_summary": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Summary"
     },
     "reanalysis_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reanalysis Status"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "governing_law": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Governing Law"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "file_content_type": {
      "type": "string",
      "title": "File Content Type"
     },
     "page_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page Count"
     },
     "word_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Word Count"
     },
     "ocr_confidence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ocr Confidence"
     },
     "risk_breakdown": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Risk Breakdown"
     },
     "lifecycle_changed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lifecycle Changed At"
     },
     "lifecycle_changed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lifecycle Changed By"
     },
     "lifecycle_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lifecycle Notes"
     },
     "reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By"
     },
     "reviewer_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewer Notes"
     },
     "reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed At"
     },
     "extraction": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/ContractExtractionResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "compliance_checks": {
      "items": {
       "$ref": "#/components/schemas/ComplianceCheckResponse"
      },
      "type": "array",
      "title": "Compliance Checks",
      "default": []
     },
     "reviewed_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By Name"
     },
     "lifecycle_changed_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lifecycle Changed By Name"
     },
     "counterparty_vendor_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Counterparty Vendor Name"
     },
     "recheck_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recheck Status"
     },
     "processing_active": {
      "type": "boolean",
      "title": "Processing Active",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "original_filename",
     "contract_type",
     "processing_status",
     "requires_human_review",
     "created_at",
     "file_size_bytes",
     "file_content_type"
    ],
    "title": "ContractDetailResponse"
   },
   "ContractExtractionResponse": {
    "properties": {
     "contract_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Type"
     },
     "contract_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Title"
     },
     "governing_law": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Governing Law"
     },
     "jurisdiction": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Jurisdiction"
     },
     "language": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Language"
     },
     "effective_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Effective Date"
     },
     "expiry_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expiry Date"
     },
     "auto_renewal": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Auto Renewal"
     },
     "renewal_notice_period_days": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Renewal Notice Period Days"
     },
     "notice_period_days": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notice Period Days"
     },
     "party_a_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party A Name"
     },
     "party_a_jurisdiction": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party A Jurisdiction"
     },
     "party_b_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party B Name"
     },
     "party_b_jurisdiction": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party B Jurisdiction"
     },
     "contract_value_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Value Aed"
     },
     "currency": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Currency"
     },
     "payment_terms": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Payment Terms"
     },
     "termination_for_convenience": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Termination For Convenience"
     },
     "termination_notice_days": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Termination Notice Days"
     },
     "liability_cap_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Liability Cap Aed"
     },
     "arbitration_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Arbitration Clause"
     },
     "arbitration_body": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Arbitration Body"
     },
     "non_compete_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Non Compete Clause"
     },
     "non_disclosure_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Non Disclosure Clause"
     },
     "gratuity_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Gratuity Clause"
     },
     "wps_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wps Clause"
     },
     "pdpl_compliance_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Pdpl Compliance Clause"
     },
     "late_payment_penalty_rate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Late Payment Penalty Rate"
     },
     "non_compete_duration_months": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Non Compete Duration Months"
     },
     "data_processing_clause": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Data Processing Clause"
     },
     "all_fields": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "All Fields"
     },
     "field_confidence": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Field Confidence"
     },
     "fields_needing_review": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Fields Needing Review"
     },
     "all_fields_translated": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "All Fields Translated"
     },
     "translation_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Translation Status"
     }
    },
    "type": "object",
    "title": "ContractExtractionResponse"
   },
   "ContractLifecycleStatus": {
    "type": "string",
    "enum": [
     "DRAFT",
     "ACTIVE",
     "COMPLETED",
     "CANCELLED",
     "EXPIRED",
     "SUSPENDED"
    ],
    "title": "ContractLifecycleStatus",
    "description": "Business lifecycle status — distinct from AI processing pipeline status."
   },
   "ContractListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "contract_type": {
      "$ref": "#/components/schemas/app__models__contract__ContractType"
     },
     "contract_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Title"
     },
     "processing_status": {
      "$ref": "#/components/schemas/ContractProcessingStatus"
     },
     "lifecycle_status": {
      "$ref": "#/components/schemas/ContractLifecycleStatus",
      "default": "ACTIVE"
     },
     "overall_risk_score": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Overall Risk Score"
     },
     "risk_category": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__contract__RiskCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "effective_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Effective Date"
     },
     "expiry_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expiry Date"
     },
     "party_a_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party A Name"
     },
     "party_b_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Party B Name"
     },
     "contract_value_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Value Aed"
     },
     "counterparty_vendor_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Counterparty Vendor Id"
     },
     "requires_human_review": {
      "type": "boolean",
      "title": "Requires Human Review"
     },
     "review_assigned_to": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned To"
     },
     "review_assigned_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned At"
     },
     "review_assigned_to_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Assigned To Name"
     },
     "ai_summary": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Summary"
     },
     "reanalysis_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reanalysis Status"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "original_filename",
     "contract_type",
     "processing_status",
     "requires_human_review",
     "created_at"
    ],
    "title": "ContractListResponse"
   },
   "ContractProcessingStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "OCR_COMPLETE",
     "EXTRACTION_COMPLETE",
     "COMPLIANCE_CHECKED",
     "COMPLETE"
    ],
    "title": "ContractProcessingStatus"
   },
   "ContractUploadResponse": {
    "properties": {
     "job_id": {
      "type": "string",
      "format": "uuid",
      "title": "Job Id"
     },
     "contract_id": {
      "type": "string",
      "format": "uuid",
      "title": "Contract Id"
     },
     "status": {
      "$ref": "#/components/schemas/JobStatus"
     },
     "message": {
      "type": "string",
      "title": "Message"
     }
    },
    "type": "object",
    "required": [
     "job_id",
     "contract_id",
     "status",
     "message"
    ],
    "title": "ContractUploadResponse"
   },
   "CounterpartyRole": {
    "type": "string",
    "enum": [
     "CUSTOMER",
     "SUPPLIER",
     "UNKNOWN"
    ],
    "title": "CounterpartyRole",
    "description": "Whether the counterparty is a customer (AR / sales side → INCOME) or a\nsupplier (AP / purchase side → EXPENSE). This is the double-entry side and,\nfor a credit note, determines whether it reduces revenue or reduces cost.\nDistinct from ``counterparty_type`` which is the VAT zone (FZP/MAINLAND/…)."
   },
   "CustodyEvent": {
    "properties": {
     "action": {
      "type": "string",
      "title": "Action"
     },
     "actor_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Actor Id"
     },
     "actor_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Actor Name"
     },
     "actor_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Actor Email"
     },
     "timestamp": {
      "type": "string",
      "title": "Timestamp"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "required": [
     "action",
     "timestamp"
    ],
    "title": "CustodyEvent"
   },
   "CustomerType": {
    "type": "string",
    "enum": [
     "INDIVIDUAL",
     "CORPORATE"
    ],
    "title": "CustomerType"
   },
   "DocumentListResponse": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/DocumentResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "DocumentListResponse"
   },
   "DocumentResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "uploader_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploader Name"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "content_type": {
      "type": "string",
      "title": "Content Type"
     },
     "category": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Category"
     },
     "tags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Tags",
      "default": []
     },
     "folder": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Folder"
     },
     "is_sealed": {
      "type": "boolean",
      "title": "Is Sealed",
      "default": false
     },
     "sealed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Sealed At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "title",
     "original_filename",
     "file_size_bytes",
     "content_type",
     "created_at",
     "updated_at"
    ],
    "title": "DocumentResponse"
   },
   "DocumentUpdateRequest": {
    "properties": {
     "title": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Title"
     },
     "description": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "category": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "policy",
         "evidence",
         "contract",
         "correspondence",
         "other"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Category"
     },
     "tags": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array",
        "maxItems": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Tags"
     },
     "folder": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Folder"
     }
    },
    "type": "object",
    "title": "DocumentUpdateRequest"
   },
   "ESGDashboardResponse": {
    "properties": {
     "total_co2e_tonnes": {
      "type": "string",
      "title": "Total Co2E Tonnes"
     },
     "scope_1_tonnes": {
      "type": "string",
      "title": "Scope 1 Tonnes"
     },
     "scope_2_tonnes": {
      "type": "string",
      "title": "Scope 2 Tonnes"
     },
     "scope_3_tonnes": {
      "type": "string",
      "title": "Scope 3 Tonnes"
     },
     "total_emissions": {
      "type": "integer",
      "title": "Total Emissions"
     },
     "verified_emissions": {
      "type": "integer",
      "title": "Verified Emissions"
     },
     "active_targets": {
      "type": "integer",
      "title": "Active Targets"
     },
     "reports_submitted": {
      "type": "integer",
      "title": "Reports Submitted"
     },
     "reports_total": {
      "type": "integer",
      "title": "Reports Total",
      "default": 0
     },
     "reports_by_status": {
      "type": "object",
      "title": "Reports By Status",
      "default": {}
     },
     "social_metrics_count": {
      "type": "integer",
      "title": "Social Metrics Count"
     },
     "governance_metrics_count": {
      "type": "integer",
      "title": "Governance Metrics Count"
     },
     "yoy_change_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Yoy Change Pct"
     },
     "intensity": {
      "type": "object",
      "title": "Intensity",
      "default": {}
     },
     "moccae_deadline": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Moccae Deadline"
     },
     "targets": {
      "items": {},
      "type": "array",
      "title": "Targets",
      "default": []
     },
     "scope_breakdown": {
      "items": {},
      "type": "array",
      "title": "Scope Breakdown",
      "default": []
     },
     "monthly_trend": {
      "items": {},
      "type": "array",
      "title": "Monthly Trend",
      "default": []
     },
     "top_sources": {
      "items": {},
      "type": "array",
      "title": "Top Sources",
      "default": []
     },
     "year": {
      "type": "integer",
      "title": "Year"
     }
    },
    "type": "object",
    "required": [
     "total_co2e_tonnes",
     "scope_1_tonnes",
     "scope_2_tonnes",
     "scope_3_tonnes",
     "total_emissions",
     "verified_emissions",
     "active_targets",
     "reports_submitted",
     "social_metrics_count",
     "governance_metrics_count",
     "year"
    ],
    "title": "ESGDashboardResponse"
   },
   "ESGMetricCreateRequest": {
    "properties": {
     "pillar": {
      "$ref": "#/components/schemas/ESGPillar"
     },
     "category": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Category"
     },
     "metric_key": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Metric Key"
     },
     "metric_name": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1,
      "title": "Metric Name"
     },
     "value_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Text"
     },
     "value_numeric": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Numeric"
     },
     "unit": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Unit"
     },
     "reporting_period_start": {
      "type": "string",
      "format": "date",
      "title": "Reporting Period Start"
     },
     "reporting_period_end": {
      "type": "string",
      "format": "date",
      "title": "Reporting Period End"
     },
     "source": {
      "type": "string",
      "maxLength": 200,
      "title": "Source",
      "default": "MANUAL"
     },
     "evidence_document_url": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 1000
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Document Url"
     }
    },
    "type": "object",
    "required": [
     "pillar",
     "category",
     "metric_key",
     "metric_name",
     "reporting_period_start",
     "reporting_period_end"
    ],
    "title": "ESGMetricCreateRequest"
   },
   "ESGMetricResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "pillar": {
      "$ref": "#/components/schemas/ESGPillar"
     },
     "category": {
      "type": "string",
      "title": "Category"
     },
     "metric_key": {
      "type": "string",
      "title": "Metric Key"
     },
     "metric_name": {
      "type": "string",
      "title": "Metric Name"
     },
     "value_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Text"
     },
     "value_numeric": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Numeric"
     },
     "unit": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Unit"
     },
     "reporting_period_start": {
      "type": "string",
      "format": "date",
      "title": "Reporting Period Start"
     },
     "reporting_period_end": {
      "type": "string",
      "format": "date",
      "title": "Reporting Period End"
     },
     "source": {
      "type": "string",
      "title": "Source"
     },
     "evidence_document_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Document Url"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "archived_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Archived At"
     },
     "archived_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Archived By"
     },
     "archive_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Archive Reason"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "pillar",
     "category",
     "metric_key",
     "metric_name",
     "reporting_period_start",
     "reporting_period_end",
     "source",
     "created_at"
    ],
    "title": "ESGMetricResponse"
   },
   "ESGMetricUpdateRequest": {
    "properties": {
     "pillar": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/ESGPillar"
       },
       {
        "type": "null"
       }
      ]
     },
     "category": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Category"
     },
     "metric_key": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Metric Key"
     },
     "metric_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Metric Name"
     },
     "value_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Text"
     },
     "value_numeric": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Numeric"
     },
     "unit": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Unit"
     },
     "reporting_period_start": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reporting Period Start"
     },
     "reporting_period_end": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reporting Period End"
     },
     "source": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Source"
     },
     "evidence_document_url": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 1000
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Document Url"
     }
    },
    "type": "object",
    "title": "ESGMetricUpdateRequest"
   },
   "ESGPillar": {
    "type": "string",
    "enum": [
     "E",
     "S",
     "G"
    ],
    "title": "ESGPillar"
   },
   "EmiratiZationStatus": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "total_active_employees": {
      "type": "integer",
      "title": "Total Active Employees"
     },
     "emirati_active_employees": {
      "type": "integer",
      "title": "Emirati Active Employees"
     },
     "ratio_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ratio Pct"
     },
     "target_ratio_pct": {
      "type": "number",
      "title": "Target Ratio Pct"
     },
     "is_compliant": {
      "type": "boolean",
      "title": "Is Compliant"
     },
     "gap": {
      "type": "integer",
      "title": "Gap"
     },
     "ai_recommendations": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Recommendations"
     },
     "nafis_incentives": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Nafis Incentives"
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "total_active_employees",
     "emirati_active_employees",
     "target_ratio_pct",
     "is_compliant",
     "gap"
    ],
    "title": "EmiratiZationStatus",
    "description": "Emiratization compliance status."
   },
   "EmissionCategory": {
    "type": "string",
    "enum": [
     "ELECTRICITY",
     "FUEL",
     "TRAVEL",
     "WASTE",
     "WATER",
     "REFRIGERANT",
     "COOLING",
     "OTHER",
     "BIOGENIC"
    ],
    "title": "EmissionCategory"
   },
   "EmissionImportResponse": {
    "properties": {
     "imported": {
      "type": "integer",
      "title": "Imported"
     },
     "skipped": {
      "type": "integer",
      "title": "Skipped"
     },
     "errors": {
      "items": {
       "$ref": "#/components/schemas/EmissionImportRowError"
      },
      "type": "array",
      "title": "Errors"
     },
     "warnings": {
      "items": {
       "$ref": "#/components/schemas/EmissionImportRowError"
      },
      "type": "array",
      "title": "Warnings",
      "default": []
     },
     "status": {
      "type": "string",
      "title": "Status",
      "default": "imported"
     },
     "duplicates": {
      "items": {
       "$ref": "#/components/schemas/EmissionImportRowError"
      },
      "type": "array",
      "title": "Duplicates",
      "default": []
     },
     "new_rows": {
      "type": "integer",
      "title": "New Rows",
      "default": 0
     },
     "total_rows": {
      "type": "integer",
      "title": "Total Rows"
     }
    },
    "type": "object",
    "required": [
     "imported",
     "skipped",
     "errors",
     "total_rows"
    ],
    "title": "EmissionImportResponse"
   },
   "EmissionImportRowError": {
    "properties": {
     "row": {
      "type": "integer",
      "title": "Row"
     },
     "reason": {
      "type": "string",
      "title": "Reason"
     }
    },
    "type": "object",
    "required": [
     "row",
     "reason"
    ],
    "title": "EmissionImportRowError"
   },
   "EmissionRecordCreateRequest": {
    "properties": {
     "scope": {
      "$ref": "#/components/schemas/EmissionScope"
     },
     "category": {
      "$ref": "#/components/schemas/EmissionCategory"
     },
     "subcategory": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Subcategory"
     },
     "activity_data": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       }
      ],
      "title": "Activity Data"
     },
     "activity_unit": {
      "type": "string",
      "maxLength": 50,
      "title": "Activity Unit"
     },
     "emission_factor_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emission Factor Id"
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End"
     },
     "source_type": {
      "$ref": "#/components/schemas/EmissionSourceType",
      "default": "MANUAL"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 5000
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "required": [
     "scope",
     "category",
     "activity_data",
     "activity_unit",
     "period_start",
     "period_end"
    ],
    "title": "EmissionRecordCreateRequest"
   },
   "EmissionRecordResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "scope": {
      "$ref": "#/components/schemas/EmissionScope"
     },
     "category": {
      "$ref": "#/components/schemas/EmissionCategory"
     },
     "subcategory": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Subcategory"
     },
     "activity_data": {
      "type": "string",
      "title": "Activity Data"
     },
     "activity_unit": {
      "type": "string",
      "title": "Activity Unit"
     },
     "emission_factor_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emission Factor Id"
     },
     "co2e_kg": {
      "type": "string",
      "title": "Co2E Kg"
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End"
     },
     "source_type": {
      "$ref": "#/components/schemas/EmissionSourceType"
     },
     "source_document_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Url"
     },
     "extraction_data": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extraction Data"
     },
     "is_verified": {
      "type": "boolean",
      "title": "Is Verified"
     },
     "verified_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified By"
     },
     "verified_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified At"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     },
     "created_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Created By"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "factor": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Factor"
     },
     "factor_selection": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Factor Selection"
     },
     "created_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Created By Name"
     },
     "verified_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified By Name"
     },
     "approval": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Approval"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "scope",
     "category",
     "activity_data",
     "activity_unit",
     "co2e_kg",
     "period_start",
     "period_end",
     "source_type",
     "is_verified",
     "created_at"
    ],
    "title": "EmissionRecordResponse"
   },
   "EmissionRecordUpdateRequest": {
    "properties": {
     "scope": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/EmissionScope"
       },
       {
        "type": "null"
       }
      ]
     },
     "category": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/EmissionCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "subcategory": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Subcategory"
     },
     "activity_data": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Activity Data"
     },
     "activity_unit": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Activity Unit"
     },
     "emission_factor_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emission Factor Id"
     },
     "auto_select_factor": {
      "type": "boolean",
      "title": "Auto Select Factor",
      "default": false
     },
     "period_start": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period Start"
     },
     "period_end": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period End"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 5000
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "title": "EmissionRecordUpdateRequest"
   },
   "EmissionScope": {
    "type": "string",
    "enum": [
     "SCOPE_1",
     "SCOPE_2",
     "SCOPE_3"
    ],
    "title": "EmissionScope"
   },
   "EmissionSourceType": {
    "type": "string",
    "enum": [
     "UTILITY_BILL",
     "FUEL_RECEIPT",
     "TRAVEL_RECORD",
     "MANUAL",
     "ERP_SYNC"
    ],
    "title": "EmissionSourceType"
   },
   "EmployeeCreateRequest": {
    "properties": {
     "mohre_person_id": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(\\d{14})?$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mohre Person Id"
     },
     "wps_routing_code": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(\\d{9})?$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wps Routing Code"
     },
     "iban": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "null"
       }
      ],
      "title": "Iban"
     },
     "full_name": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Full Name"
     },
     "tenant_user_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tenant User Id"
     },
     "manager_employee_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manager Employee Id"
     },
     "nationality": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Nationality"
     },
     "is_emirati": {
      "type": "boolean",
      "title": "Is Emirati",
      "default": false
     },
     "job_title": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Job Title"
     },
     "department": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Department"
     },
     "employment_date": {
      "type": "string",
      "format": "date",
      "title": "Employment Date"
     },
     "basic_salary_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Basic Salary Aed"
     },
     "allowances_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Allowances Aed"
     },
     "is_wps_enrolled": {
      "type": "boolean",
      "title": "Is Wps Enrolled",
      "default": true
     },
     "employee_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Number"
     },
     "contract_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__workforce__ContractType"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "type": "object",
    "required": [
     "full_name",
     "employment_date"
    ],
    "title": "EmployeeCreateRequest"
   },
   "EmployeeDetailResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "tenant_user_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tenant User Id"
     },
     "manager_employee_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manager Employee Id"
     },
     "full_name": {
      "type": "string",
      "title": "Full Name"
     },
     "nationality": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Nationality"
     },
     "is_emirati": {
      "type": "boolean",
      "title": "Is Emirati"
     },
     "job_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Job Title"
     },
     "department": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Department"
     },
     "employment_date": {
      "type": "string",
      "format": "date",
      "title": "Employment Date"
     },
     "termination_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Termination Date"
     },
     "status": {
      "$ref": "#/components/schemas/EmploymentStatus"
     },
     "is_wps_enrolled": {
      "type": "boolean",
      "title": "Is Wps Enrolled"
     },
     "basic_salary_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Basic Salary Aed"
     },
     "employee_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Number"
     },
     "contract_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__workforce__ContractType"
       },
       {
        "type": "null"
       }
      ]
     },
     "mohre_person_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mohre Person Id"
     },
     "wps_routing_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wps Routing Code"
     },
     "iban_masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Iban Masked"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     },
     "termination_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TerminationType"
       },
       {
        "type": "null"
       }
      ]
     },
     "allowances_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Allowances Aed"
     },
     "iban": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Iban"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "full_name",
     "is_emirati",
     "employment_date",
     "status",
     "is_wps_enrolled",
     "created_at"
    ],
    "title": "EmployeeDetailResponse"
   },
   "EmployeeDocumentRequest": {
    "properties": {
     "document_type": {
      "$ref": "#/components/schemas/EmployeeDocumentType"
     },
     "document_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Number"
     },
     "expiry_date": {
      "type": "string",
      "format": "date",
      "title": "Expiry Date"
     }
    },
    "type": "object",
    "required": [
     "document_type",
     "expiry_date"
    ],
    "title": "EmployeeDocumentRequest"
   },
   "EmployeeDocumentResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "title": "Employee Id"
     },
     "employee_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Name"
     },
     "employee_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Number"
     },
     "document_type": {
      "$ref": "#/components/schemas/EmployeeDocumentType"
     },
     "document_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Number"
     },
     "expiry_date": {
      "type": "string",
      "format": "date",
      "title": "Expiry Date"
     },
     "days_until_expiry": {
      "type": "integer",
      "title": "Days Until Expiry"
     },
     "expiry_status": {
      "type": "string",
      "title": "Expiry Status"
     },
     "has_attachment": {
      "type": "boolean",
      "title": "Has Attachment",
      "default": false
     },
     "attachment_filename": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Attachment Filename"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "employee_id",
     "document_type",
     "expiry_date",
     "days_until_expiry",
     "expiry_status",
     "created_at"
    ],
    "title": "EmployeeDocumentResponse"
   },
   "EmployeeDocumentType": {
    "type": "string",
    "enum": [
     "VISA",
     "EMIRATES_ID",
     "LABOUR_CARD",
     "PASSPORT"
    ],
    "title": "EmployeeDocumentType"
   },
   "EmployeeListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "tenant_user_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tenant User Id"
     },
     "manager_employee_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manager Employee Id"
     },
     "full_name": {
      "type": "string",
      "title": "Full Name"
     },
     "nationality": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Nationality"
     },
     "is_emirati": {
      "type": "boolean",
      "title": "Is Emirati"
     },
     "job_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Job Title"
     },
     "department": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Department"
     },
     "employment_date": {
      "type": "string",
      "format": "date",
      "title": "Employment Date"
     },
     "termination_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Termination Date"
     },
     "status": {
      "$ref": "#/components/schemas/EmploymentStatus"
     },
     "is_wps_enrolled": {
      "type": "boolean",
      "title": "Is Wps Enrolled"
     },
     "basic_salary_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Basic Salary Aed"
     },
     "employee_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Number"
     },
     "contract_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__workforce__ContractType"
       },
       {
        "type": "null"
       }
      ]
     },
     "mohre_person_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mohre Person Id"
     },
     "wps_routing_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wps Routing Code"
     },
     "iban_masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Iban Masked"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "full_name",
     "is_emirati",
     "employment_date",
     "status",
     "is_wps_enrolled",
     "created_at"
    ],
    "title": "EmployeeListResponse"
   },
   "EmployeeUpdateRequest": {
    "properties": {
     "mohre_person_id": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(\\d{14})?$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mohre Person Id"
     },
     "wps_routing_code": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(\\d{9})?$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wps Routing Code"
     },
     "iban": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "null"
       }
      ],
      "title": "Iban"
     },
     "full_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Full Name"
     },
     "employment_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employment Date"
     },
     "employee_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Number"
     },
     "contract_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/app__models__workforce__ContractType"
       },
       {
        "type": "null"
       }
      ]
     },
     "tenant_user_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tenant User Id"
     },
     "manager_employee_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manager Employee Id"
     },
     "job_title": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Job Title"
     },
     "department": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Department"
     },
     "basic_salary_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Basic Salary Aed"
     },
     "allowances_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Allowances Aed"
     },
     "is_wps_enrolled": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Wps Enrolled"
     },
     "nationality": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Nationality"
     },
     "is_emirati": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Emirati"
     }
    },
    "type": "object",
    "title": "EmployeeUpdateRequest"
   },
   "EmploymentStatus": {
    "type": "string",
    "enum": [
     "ACTIVE",
     "TERMINATED",
     "ON_LEAVE"
    ],
    "title": "EmploymentStatus"
   },
   "EntityAlertListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "update_id": {
      "type": "string",
      "format": "uuid",
      "title": "Update Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "relevance_score": {
      "type": "string",
      "title": "Relevance Score"
     },
     "relevance_reasons": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Relevance Reasons",
      "default": []
     },
     "is_read": {
      "type": "boolean",
      "title": "Is Read"
     },
     "is_dismissed": {
      "type": "boolean",
      "title": "Is Dismissed"
     },
     "read_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Read At"
     },
     "dismissed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dismissed At"
     },
     "dismissed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dismissed By"
     },
     "regulatory_update": {
      "$ref": "#/components/schemas/RegulatoryUpdateListResponse"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "update_id",
     "entity_id",
     "relevance_score",
     "is_read",
     "is_dismissed",
     "regulatory_update",
     "created_at"
    ],
    "title": "EntityAlertListResponse"
   },
   "EntityDetailResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "org_unit_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Org Unit Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "name_arabic": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name Arabic"
     },
     "legal_structure": {
      "$ref": "#/components/schemas/LegalStructure"
     },
     "jurisdiction": {
      "$ref": "#/components/schemas/JurisdictionResponse"
     },
     "trade_license_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Number"
     },
     "trade_license_expiry": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Expiry"
     },
     "trade_license_activities": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Trade License Activities",
      "default": []
     },
     "trn": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trn"
     },
     "ct_registration_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Registration Number"
     },
     "license_issuance_month": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "License Issuance Month"
     },
     "vat_registration_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Registration Date"
     },
     "incorporation_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Incorporation Date"
     },
     "employee_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Count"
     },
     "emirati_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirati Count"
     },
     "revenue_bracket": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RevenueRange"
       },
       {
        "type": "null"
       }
      ]
     },
     "saudi_national_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Saudi National Count"
     },
     "industry_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Code"
     },
     "industry_description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Description"
     },
     "fiscal_year_start_month": {
      "type": "integer",
      "title": "Fiscal Year Start Month"
     },
     "accounting_method": {
      "type": "string",
      "title": "Accounting Method",
      "default": "ACCRUAL"
     },
     "parent_entity_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Parent Entity Id"
     },
     "is_active": {
      "type": "boolean",
      "title": "Is Active"
     },
     "is_sub_company": {
      "type": "boolean",
      "title": "Is Sub Company"
     },
     "company_phone": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Phone"
     },
     "company_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Email"
     },
     "company_website": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Website"
     },
     "payment_terms": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Payment Terms"
     },
     "logo_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Logo Blob Path"
     },
     "logo_content_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Logo Content Type"
     },
     "brand_primary_color": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Brand Primary Color"
     },
     "invoice_template_style": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Template Style"
     },
     "invoice_design_config": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Design Config"
     },
     "company_address_line1": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Address Line1"
     },
     "company_city": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company City"
     },
     "company_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Country"
     },
     "company_postal_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Postal Code"
     },
     "company_cr_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Cr Number"
     },
     "inbound_email_address": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Inbound Email Address"
     },
     "email_sender_whitelist": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Email Sender Whitelist"
     },
     "functional_currency": {
      "type": "string",
      "title": "Functional Currency",
      "default": "AED"
     },
     "capitalization_threshold_aed": {
      "type": "number",
      "title": "Capitalization Threshold Aed",
      "default": 5000
     },
     "entity_type": {
      "type": "string",
      "title": "Entity Type",
      "default": "JURIDICAL"
     },
     "ct_tax_group_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Tax Group Id"
     },
     "vat_group_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Group Id"
     },
     "tax_group_ownership_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tax Group Ownership Pct"
     },
     "realisation_basis": {
      "type": "string",
      "title": "Realisation Basis",
      "default": "ACCRUAL"
     },
     "realisation_basis_elected_on": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Elected On"
     },
     "realisation_basis_locked_until": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Locked Until"
     },
     "erp_write_back_enabled": {
      "type": "boolean",
      "title": "Erp Write Back Enabled",
      "default": false
     },
     "industry_sector": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Sector"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "foreign_pe_election": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Pe Election"
     },
     "dz_goods_mainland_vat": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dz Goods Mainland Vat"
     },
     "mne_group_revenue_eur": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mne Group Revenue Eur"
     },
     "natural_person_turnover_aed": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Natural Person Turnover Aed"
     },
     "transparency_election": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Election"
     },
     "transparency_elected_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Elected At"
     },
     "transparency_effective": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Effective"
     },
     "transparency_applicable": {
      "type": "boolean",
      "title": "Transparency Applicable",
      "default": false
     },
     "exemption_status": {
      "type": "string",
      "title": "Exemption Status",
      "default": "NONE"
     },
     "exemption_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Type"
     },
     "exemption_fta_reference": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Fta Reference"
     },
     "audited_fs_required": {
      "type": "boolean",
      "title": "Audited Fs Required",
      "default": false
     },
     "audited_fs_uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Uploaded At"
     },
     "audited_fs_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Blob Path"
     },
     "audited_fs_fiscal_year": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Fiscal Year"
     },
     "applicable_frameworks": {
      "items": {
       "$ref": "#/components/schemas/EntityFrameworkResponse"
      },
      "type": "array",
      "title": "Applicable Frameworks",
      "default": []
     },
     "compliance_calendar": {
      "items": {
       "$ref": "#/components/schemas/app__schemas__entity__CalendarEntryResponse"
      },
      "type": "array",
      "title": "Compliance Calendar",
      "default": []
     },
     "trn_formatted": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trn Formatted",
      "readOnly": true
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "name_arabic",
     "legal_structure",
     "jurisdiction",
     "trade_license_number",
     "trade_license_expiry",
     "trn",
     "ct_registration_number",
     "employee_count",
     "emirati_count",
     "revenue_bracket",
     "industry_description",
     "fiscal_year_start_month",
     "is_active",
     "is_sub_company",
     "trn_formatted"
    ],
    "title": "EntityDetailResponse"
   },
   "EntityElectionContext": {
    "properties": {
     "realisation_basis": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis"
     },
     "realisation_basis_elected_on": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Elected On"
     },
     "realisation_basis_locked_until": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Locked Until"
     },
     "transitional_election_count": {
      "type": "integer",
      "title": "Transitional Election Count",
      "default": 0
     },
     "transitional_elections_total_excluded_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transitional Elections Total Excluded Aed"
     },
     "transitional_election_types": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transitional Election Types"
     },
     "transitional_election_methods": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transitional Election Methods"
     }
    },
    "type": "object",
    "title": "EntityElectionContext",
    "description": "Entity-level election status surfaced at review time."
   },
   "EntityFrameworkResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "framework": {
      "$ref": "#/components/schemas/FrameworkResponse"
     },
     "priority": {
      "$ref": "#/components/schemas/CompliancePriority"
     },
     "status": {
      "$ref": "#/components/schemas/ComplianceStatus"
     },
     "applicability_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Applicability Reason"
     },
     "ai_determined": {
      "type": "boolean",
      "title": "Ai Determined"
     },
     "human_confirmed": {
      "type": "boolean",
      "title": "Human Confirmed"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "required": [
     "id",
     "framework",
     "priority",
     "status",
     "applicability_reason",
     "ai_determined",
     "human_confirmed"
    ],
    "title": "EntityFrameworkResponse"
   },
   "EntityResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "org_unit_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Org Unit Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "name_arabic": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name Arabic"
     },
     "legal_structure": {
      "$ref": "#/components/schemas/LegalStructure"
     },
     "jurisdiction": {
      "$ref": "#/components/schemas/JurisdictionResponse"
     },
     "trade_license_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Number"
     },
     "trade_license_expiry": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Expiry"
     },
     "trade_license_activities": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Trade License Activities",
      "default": []
     },
     "trn": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trn"
     },
     "ct_registration_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Registration Number"
     },
     "license_issuance_month": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "License Issuance Month"
     },
     "vat_registration_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Registration Date"
     },
     "incorporation_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Incorporation Date"
     },
     "employee_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Count"
     },
     "emirati_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirati Count"
     },
     "revenue_bracket": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RevenueRange"
       },
       {
        "type": "null"
       }
      ]
     },
     "saudi_national_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Saudi National Count"
     },
     "industry_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Code"
     },
     "industry_description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Description"
     },
     "fiscal_year_start_month": {
      "type": "integer",
      "title": "Fiscal Year Start Month"
     },
     "accounting_method": {
      "type": "string",
      "title": "Accounting Method",
      "default": "ACCRUAL"
     },
     "parent_entity_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Parent Entity Id"
     },
     "is_active": {
      "type": "boolean",
      "title": "Is Active"
     },
     "is_sub_company": {
      "type": "boolean",
      "title": "Is Sub Company"
     },
     "company_phone": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Phone"
     },
     "company_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Email"
     },
     "company_website": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Website"
     },
     "payment_terms": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Payment Terms"
     },
     "logo_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Logo Blob Path"
     },
     "logo_content_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Logo Content Type"
     },
     "brand_primary_color": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Brand Primary Color"
     },
     "invoice_template_style": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Template Style"
     },
     "invoice_design_config": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Design Config"
     },
     "company_address_line1": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Address Line1"
     },
     "company_city": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company City"
     },
     "company_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Country"
     },
     "company_postal_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Postal Code"
     },
     "company_cr_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Cr Number"
     },
     "inbound_email_address": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Inbound Email Address"
     },
     "email_sender_whitelist": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Email Sender Whitelist"
     },
     "functional_currency": {
      "type": "string",
      "title": "Functional Currency",
      "default": "AED"
     },
     "capitalization_threshold_aed": {
      "type": "number",
      "title": "Capitalization Threshold Aed",
      "default": 5000
     },
     "entity_type": {
      "type": "string",
      "title": "Entity Type",
      "default": "JURIDICAL"
     },
     "ct_tax_group_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Tax Group Id"
     },
     "vat_group_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Group Id"
     },
     "tax_group_ownership_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tax Group Ownership Pct"
     },
     "realisation_basis": {
      "type": "string",
      "title": "Realisation Basis",
      "default": "ACCRUAL"
     },
     "realisation_basis_elected_on": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Elected On"
     },
     "realisation_basis_locked_until": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis Locked Until"
     },
     "erp_write_back_enabled": {
      "type": "boolean",
      "title": "Erp Write Back Enabled",
      "default": false
     },
     "industry_sector": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Sector"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "foreign_pe_election": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Pe Election"
     },
     "dz_goods_mainland_vat": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dz Goods Mainland Vat"
     },
     "mne_group_revenue_eur": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mne Group Revenue Eur"
     },
     "natural_person_turnover_aed": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Natural Person Turnover Aed"
     },
     "transparency_election": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Election"
     },
     "transparency_elected_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Elected At"
     },
     "transparency_effective": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Effective"
     },
     "transparency_applicable": {
      "type": "boolean",
      "title": "Transparency Applicable",
      "default": false
     },
     "exemption_status": {
      "type": "string",
      "title": "Exemption Status",
      "default": "NONE"
     },
     "exemption_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Type"
     },
     "exemption_fta_reference": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Fta Reference"
     },
     "audited_fs_required": {
      "type": "boolean",
      "title": "Audited Fs Required",
      "default": false
     },
     "audited_fs_uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Uploaded At"
     },
     "audited_fs_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Blob Path"
     },
     "audited_fs_fiscal_year": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audited Fs Fiscal Year"
     },
     "trn_formatted": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trn Formatted",
      "readOnly": true
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "name_arabic",
     "legal_structure",
     "jurisdiction",
     "trade_license_number",
     "trade_license_expiry",
     "trn",
     "ct_registration_number",
     "employee_count",
     "emirati_count",
     "revenue_bracket",
     "industry_description",
     "fiscal_year_start_month",
     "is_active",
     "is_sub_company",
     "trn_formatted"
    ],
    "title": "EntityResponse"
   },
   "EntityUpdateRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500,
        "minLength": 2
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "name_arabic": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Name Arabic"
     },
     "legal_structure": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/LegalStructure"
       },
       {
        "type": "null"
       }
      ]
     },
     "jurisdiction_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Jurisdiction Id"
     },
     "trade_license_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Number"
     },
     "trade_license_expiry": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Expiry"
     },
     "trade_license_activities": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trade License Activities"
     },
     "trn": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trn"
     },
     "ct_registration_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ct Registration Number"
     },
     "license_issuance_month": {
      "anyOf": [
       {
        "type": "integer",
        "maximum": 12.0,
        "minimum": 1.0
       },
       {
        "type": "null"
       }
      ],
      "title": "License Issuance Month"
     },
     "vat_registration_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Registration Date"
     },
     "incorporation_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Incorporation Date"
     },
     "employee_count": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Employee Count"
     },
     "emirati_count": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirati Count"
     },
     "saudi_national_count": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Saudi National Count"
     },
     "revenue_bracket": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RevenueRange"
       },
       {
        "type": "null"
       }
      ]
     },
     "industry_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Code"
     },
     "industry_description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Description"
     },
     "industry_sector": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 30
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry Sector"
     },
     "fiscal_year_start_month": {
      "anyOf": [
       {
        "type": "integer",
        "maximum": 12.0,
        "minimum": 1.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Fiscal Year Start Month"
     },
     "accounting_method": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(ACCRUAL|CASH)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Accounting Method"
     },
     "realisation_basis": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(ACCRUAL|REALISATION)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Realisation Basis"
     },
     "company_phone": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Phone"
     },
     "company_email": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Email"
     },
     "company_website": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Website"
     },
     "payment_terms": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Payment Terms"
     },
     "company_address_line1": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Address Line1"
     },
     "company_city": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Company City"
     },
     "company_country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Country"
     },
     "company_postal_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 20
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Postal Code"
     },
     "company_cr_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Cr Number"
     },
     "brand_primary_color": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 20
       },
       {
        "type": "null"
       }
      ],
      "title": "Brand Primary Color"
     },
     "invoice_template_style": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Template Style"
     },
     "email_sender_whitelist": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Email Sender Whitelist"
     },
     "functional_currency": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Functional Currency"
     },
     "capitalization_threshold_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Capitalization Threshold Aed"
     },
     "entity_type": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(JURIDICAL|NATURAL_PERSON)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Entity Type"
     },
     "exemption_status": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(NONE|AUTOMATIC|APPLIED|APPROVED)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Status"
     },
     "exemption_type": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Type"
     },
     "exemption_fta_reference": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Exemption Fta Reference"
     },
     "natural_person_turnover_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Natural Person Turnover Aed"
     },
     "transparency_election": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(TRANSPARENT|OPAQUE)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transparency Election"
     },
     "erp_write_back_enabled": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Write Back Enabled"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(ABU_DHABI|DUBAI|SHARJAH|AJMAN|UMM_AL_QUWAIN|RAS_AL_KHAIMAH|FUJAIRAH)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "foreign_pe_election": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(NONE|ELECTED)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Pe Election"
     },
     "dz_goods_mainland_vat": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(OUT_OF_SCOPE|STANDARD_RATED)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dz Goods Mainland Vat"
     },
     "mne_group_revenue_eur": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Mne Group Revenue Eur"
     }
    },
    "type": "object",
    "title": "EntityUpdateRequest"
   },
   "Error": {
    "title": "Error",
    "type": "object",
    "required": [
     "detail"
    ],
    "properties": {
     "detail": {
      "description": "What went wrong. Usually a string; validation errors (422) give a list of {loc, msg, type} objects, and a few routes give an object with a `message` and machine-readable fields.",
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "type": "object"
        }
       },
       {
        "type": "object"
       }
      ]
     },
     "type": {
      "type": "string",
      "description": "Problem type URI (some errors)."
     },
     "title": {
      "type": "string",
      "description": "Short title (some errors)."
     },
     "status": {
      "type": "integer",
      "description": "HTTP status (some errors)."
     },
     "code": {
      "type": "string",
      "description": "Machine-readable code, e.g. `rate_limited`."
     },
     "retry_after": {
      "type": "integer",
      "description": "Seconds to wait (429)."
     }
    }
   },
   "EvidenceBySourceResponse": {
    "properties": {
     "source_type": {
      "$ref": "#/components/schemas/EvidenceSourceType"
     },
     "source_id": {
      "type": "string",
      "format": "uuid",
      "title": "Source Id"
     },
     "total_evidence": {
      "type": "integer",
      "title": "Total Evidence"
     },
     "records": {
      "items": {
       "$ref": "#/components/schemas/EvidenceRecordListResponse"
      },
      "type": "array",
      "title": "Records"
     }
    },
    "type": "object",
    "required": [
     "source_type",
     "source_id",
     "total_evidence",
     "records"
    ],
    "title": "EvidenceBySourceResponse",
    "description": "Evidence records linked to a specific source record (for sidebar)."
   },
   "EvidenceCheckType": {
    "type": "string",
    "enum": [
     "SCHEDULED",
     "MANUAL",
     "ON_ACCESS"
    ],
    "title": "EvidenceCheckType"
   },
   "EvidenceFromDocumentRequest": {
    "properties": {
     "document_id": {
      "type": "string",
      "format": "uuid",
      "title": "Document Id",
      "description": "The library document (GET /documents)"
     },
     "task_instance_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Task Instance Id",
      "description": "A compliance task to attach it to as the task's evidence file (needs compliance_tasks:edit); it is also sealed in the vault, linked to the task"
     },
     "source_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/EvidenceSourceType"
       },
       {
        "type": "null"
       }
      ],
      "description": "What the evidence is for (default COMPLIANCE_TASK with a task, else OTHER)"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id",
      "description": "The record it evidences"
     },
     "retention_policy": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RetentionPolicy"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "type": "object",
    "required": [
     "document_id"
    ],
    "title": "EvidenceFromDocumentRequest",
    "description": "Vault a document already in the entity's library (no re-upload)."
   },
   "EvidenceRecordListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "source_type": {
      "$ref": "#/components/schemas/EvidenceSourceType"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id"
     },
     "origin": {
      "type": "string",
      "title": "Origin",
      "default": "UPLOAD"
     },
     "file_name": {
      "type": "string",
      "title": "File Name"
     },
     "file_hash_sha256": {
      "type": "string",
      "title": "File Hash Sha256"
     },
     "file_size_bytes": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "File Size Bytes"
     },
     "mime_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mime Type"
     },
     "is_immutable": {
      "type": "boolean",
      "title": "Is Immutable"
     },
     "retention_policy": {
      "$ref": "#/components/schemas/RetentionPolicy"
     },
     "retention_expires_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Expires At"
     },
     "source_document_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Name"
     },
     "source_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Title"
     },
     "display_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Display Name"
     },
     "has_source_document": {
      "type": "boolean",
      "title": "Has Source Document",
      "default": false
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "uploaded_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By Name"
     },
     "uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "source_type",
     "file_name",
     "file_hash_sha256",
     "is_immutable",
     "retention_policy",
     "created_at"
    ],
    "title": "EvidenceRecordListResponse"
   },
   "EvidenceRecordResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "source_type": {
      "$ref": "#/components/schemas/EvidenceSourceType"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id"
     },
     "origin": {
      "type": "string",
      "title": "Origin",
      "default": "UPLOAD"
     },
     "file_name": {
      "type": "string",
      "title": "File Name"
     },
     "blob_path": {
      "type": "string",
      "title": "Blob Path"
     },
     "file_hash_sha256": {
      "type": "string",
      "title": "File Hash Sha256"
     },
     "file_size_bytes": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "File Size Bytes"
     },
     "mime_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Mime Type"
     },
     "is_immutable": {
      "type": "boolean",
      "title": "Is Immutable"
     },
     "retention_policy": {
      "$ref": "#/components/schemas/RetentionPolicy"
     },
     "retention_expires_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Expires At"
     },
     "custody_chain": {
      "items": {
       "$ref": "#/components/schemas/CustodyEvent"
      },
      "type": "array",
      "title": "Custody Chain",
      "default": []
     },
     "source_document_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Name"
     },
     "source_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Title"
     },
     "display_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Display Name"
     },
     "source_document_hash": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Hash"
     },
     "source_document_size": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Size"
     },
     "source_document_mime": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Document Mime"
     },
     "has_source_document": {
      "type": "boolean",
      "title": "Has Source Document",
      "default": false
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "uploaded_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By Name"
     },
     "uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "source_type",
     "file_name",
     "blob_path",
     "file_hash_sha256",
     "is_immutable",
     "retention_policy",
     "created_at",
     "updated_at"
    ],
    "title": "EvidenceRecordResponse"
   },
   "EvidenceSourceType": {
    "type": "string",
    "enum": [
     "TAX_RETURN",
     "INVOICE",
     "CONTRACT",
     "ESR_REPORT",
     "PDPL_DPIA",
     "DSR_RESPONSE",
     "BREACH_REPORT",
     "UBO_REGISTER",
     "AML_CDD",
     "REGULATORY_FILING",
     "EXCISE_RETURN",
     "SANCTIONS_SCREENING",
     "WORKFORCE",
     "COMPLIANCE_REPORT",
     "COMPLIANCE_TASK",
     "FREE_ZONE",
     "TRANSFER_PRICING",
     "EXPENSE_CLAIM",
     "AUDIT_RESPONSE",
     "AUDIT_POLICY_DOC",
     "AUDIT_CYCLE",
     "VENDOR_ASSESSMENT",
     "PDPL_TIA",
     "CUSTOMS",
     "ESG",
     "OTHER"
    ],
    "title": "EvidenceSourceType"
   },
   "EvidenceStatus": {
    "type": "string",
    "enum": [
     "NOT_REQUIRED",
     "PENDING",
     "PARTIAL",
     "VALIDATED",
     "REJECTED"
    ],
    "title": "EvidenceStatus",
    "description": "Evidence document status for expense transactions (orthogonal to ReviewStatus)."
   },
   "EvidenceVerifyResponse": {
    "properties": {
     "evidence_id": {
      "type": "string",
      "format": "uuid",
      "title": "Evidence Id"
     },
     "expected_hash": {
      "type": "string",
      "title": "Expected Hash"
     },
     "actual_hash": {
      "type": "string",
      "title": "Actual Hash"
     },
     "is_valid": {
      "type": "boolean",
      "title": "Is Valid"
     },
     "checked_at": {
      "type": "string",
      "format": "date-time",
      "title": "Checked At"
     },
     "check_type": {
      "$ref": "#/components/schemas/EvidenceCheckType"
     }
    },
    "type": "object",
    "required": [
     "evidence_id",
     "expected_hash",
     "actual_hash",
     "is_valid",
     "checked_at",
     "check_type"
    ],
    "title": "EvidenceVerifyResponse"
   },
   "FilingStatusItem": {
    "properties": {
     "calendar_event_id": {
      "type": "string",
      "format": "uuid",
      "title": "Calendar Event Id"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "filing_record_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filing Record Id"
     },
     "filing_reference": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filing Reference"
     },
     "submitted_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Submitted At"
     },
     "days_until_due": {
      "type": "integer",
      "title": "Days Until Due"
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id"
     },
     "linked_return_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Linked Return Status"
     }
    },
    "type": "object",
    "required": [
     "calendar_event_id",
     "title",
     "due_date",
     "status",
     "days_until_due"
    ],
    "title": "FilingStatusItem"
   },
   "FilingStatusResponse": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "items": {
      "items": {
       "$ref": "#/components/schemas/FilingStatusItem"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "overdue_count": {
      "type": "integer",
      "title": "Overdue Count"
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "items",
     "total",
     "overdue_count"
    ],
    "title": "FilingStatusResponse"
   },
   "FrameworkResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "code": {
      "type": "string",
      "title": "Code"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "legal_basis": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Legal Basis"
     },
     "category": {
      "type": "string",
      "title": "Category"
     }
    },
    "type": "object",
    "required": [
     "id",
     "code",
     "name",
     "legal_basis",
     "category"
    ],
    "title": "FrameworkResponse"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "ImpactLevel": {
    "type": "string",
    "enum": [
     "LOW",
     "MEDIUM",
     "HIGH",
     "CRITICAL"
    ],
    "title": "ImpactLevel"
   },
   "ImportResultResponse": {
    "properties": {
     "imported": {
      "type": "integer",
      "title": "Imported"
     },
     "skipped": {
      "type": "integer",
      "title": "Skipped"
     },
     "errors": {
      "items": {
       "$ref": "#/components/schemas/ImportRowError"
      },
      "type": "array",
      "title": "Errors"
     },
     "total_rows": {
      "type": "integer",
      "title": "Total Rows"
     },
     "total_attempted": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Total Attempted"
     },
     "sanctions_alerts": {
      "items": {
       "$ref": "#/components/schemas/app__schemas__templates__SanctionsAlertItem"
      },
      "type": "array",
      "title": "Sanctions Alerts",
      "default": []
     },
     "classification_pending": {
      "type": "boolean",
      "title": "Classification Pending",
      "default": false
     },
     "blocked_rows": {
      "anyOf": [
       {
        "items": {
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Blocked Rows"
     },
     "dry_run": {
      "type": "boolean",
      "title": "Dry Run",
      "default": false
     },
     "duplicate_count": {
      "type": "integer",
      "title": "Duplicate Count",
      "default": 0
     },
     "imported_transaction_ids": {
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "type": "array",
      "title": "Imported Transaction Ids",
      "default": []
     },
     "screening_state": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Screening State"
     },
     "screening_queued": {
      "type": "integer",
      "title": "Screening Queued",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "imported",
     "skipped",
     "errors",
     "total_rows"
    ],
    "title": "ImportResultResponse"
   },
   "ImportRowError": {
    "properties": {
     "row": {
      "type": "integer",
      "title": "Row"
     },
     "reason": {
      "type": "string",
      "title": "Reason"
     }
    },
    "type": "object",
    "required": [
     "row",
     "reason"
    ],
    "title": "ImportRowError"
   },
   "JobStatus": {
    "type": "string",
    "enum": [
     "QUEUED",
     "PROCESSING",
     "COMPLETED",
     "FAILED"
    ],
    "title": "JobStatus"
   },
   "JurisdictionResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "name_arabic": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name Arabic"
     },
     "country": {
      "type": "string",
      "title": "Country"
     },
     "zone_type": {
      "type": "string",
      "title": "Zone Type"
     },
     "is_designated_zone": {
      "type": "boolean",
      "title": "Is Designated Zone",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "name_arabic",
     "country",
     "zone_type"
    ],
    "title": "JurisdictionResponse"
   },
   "KYCDocumentListResponse": {
    "properties": {
     "cdd_id": {
      "type": "string",
      "format": "uuid",
      "title": "Cdd Id"
     },
     "relationship_end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Relationship End Date"
     },
     "retention_years": {
      "type": "integer",
      "title": "Retention Years"
     },
     "documents": {
      "items": {
       "$ref": "#/components/schemas/KYCDocumentResponse"
      },
      "type": "array",
      "title": "Documents",
      "default": []
     },
     "not_stored": {
      "items": {
       "$ref": "#/components/schemas/KYCLegacyDocument"
      },
      "type": "array",
      "title": "Not Stored",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "cdd_id",
     "retention_years"
    ],
    "title": "KYCDocumentListResponse"
   },
   "KYCDocumentResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "cdd_id": {
      "type": "string",
      "format": "uuid",
      "title": "Cdd Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "document_type": {
      "type": "string",
      "title": "Document Type"
     },
     "document_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Number"
     },
     "issue_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Issue Date"
     },
     "expiry_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expiry Date"
     },
     "is_expired": {
      "type": "boolean",
      "title": "Is Expired",
      "default": false
     },
     "file_name": {
      "type": "string",
      "title": "File Name"
     },
     "mime_type": {
      "type": "string",
      "title": "Mime Type"
     },
     "size_bytes": {
      "type": "integer",
      "title": "Size Bytes"
     },
     "file_hash_sha256": {
      "type": "string",
      "title": "File Hash Sha256"
     },
     "stored": {
      "type": "boolean",
      "title": "Stored",
      "default": true
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "uploaded_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By Name"
     },
     "uploaded_at": {
      "type": "string",
      "format": "date-time",
      "title": "Uploaded At"
     },
     "retention_expires_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Expires At"
     },
     "deleted_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted At"
     },
     "deleted_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted By"
     },
     "deleted_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted By Name"
     },
     "deletion_kind": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deletion Kind"
     },
     "deletion_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deletion Reason"
     }
    },
    "type": "object",
    "required": [
     "id",
     "cdd_id",
     "entity_id",
     "document_type",
     "file_name",
     "mime_type",
     "size_bytes",
     "file_hash_sha256",
     "uploaded_at"
    ],
    "title": "KYCDocumentResponse",
    "description": "A KYC document held for a CDD record (the file is stored encrypted)."
   },
   "KYCDocumentUploadResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "cdd_id": {
      "type": "string",
      "format": "uuid",
      "title": "Cdd Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "document_type": {
      "type": "string",
      "title": "Document Type"
     },
     "document_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Number"
     },
     "issue_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Issue Date"
     },
     "expiry_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expiry Date"
     },
     "is_expired": {
      "type": "boolean",
      "title": "Is Expired",
      "default": false
     },
     "file_name": {
      "type": "string",
      "title": "File Name"
     },
     "mime_type": {
      "type": "string",
      "title": "Mime Type"
     },
     "size_bytes": {
      "type": "integer",
      "title": "Size Bytes"
     },
     "file_hash_sha256": {
      "type": "string",
      "title": "File Hash Sha256"
     },
     "stored": {
      "type": "boolean",
      "title": "Stored",
      "default": true
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "uploaded_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By Name"
     },
     "uploaded_at": {
      "type": "string",
      "format": "date-time",
      "title": "Uploaded At"
     },
     "retention_expires_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Expires At"
     },
     "deleted_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted At"
     },
     "deleted_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted By"
     },
     "deleted_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deleted By Name"
     },
     "deletion_kind": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deletion Kind"
     },
     "deletion_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deletion Reason"
     },
     "file_size": {
      "type": "integer",
      "title": "File Size"
     },
     "documents_collected": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Documents Collected"
     }
    },
    "type": "object",
    "required": [
     "id",
     "cdd_id",
     "entity_id",
     "document_type",
     "file_name",
     "mime_type",
     "size_bytes",
     "file_hash_sha256",
     "uploaded_at",
     "file_size"
    ],
    "title": "KYCDocumentUploadResponse"
   },
   "KYCLegacyDocument": {
    "properties": {
     "key": {
      "type": "string",
      "title": "Key"
     },
     "file_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "File Name"
     },
     "document_type": {
      "type": "string",
      "title": "Document Type",
      "default": "OTHER"
     },
     "size_bytes": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Size Bytes"
     },
     "uploaded_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded At"
     },
     "stored": {
      "type": "boolean",
      "title": "Stored",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "key"
    ],
    "title": "KYCLegacyDocument",
    "description": "An upload from before files were stored: only its details were kept.\nShown as \"document not stored — re-upload required\"."
   },
   "LegalStructure": {
    "type": "string",
    "enum": [
     "LLC",
     "SOLE_ESTABLISHMENT",
     "CIVIL_COMPANY",
     "BRANCH_FOREIGN",
     "BRANCH_GCC",
     "REPRESENTATIVE_OFFICE",
     "PJSC",
     "PRJSC",
     "HOLDING_COMPANY",
     "FZE",
     "FZC",
     "FZLLC",
     "FZ_BRANCH",
     "DIFC_COMPANY",
     "DIFC_BRANCH",
     "DIFC_LLP",
     "ADGM_COMPANY",
     "ADGM_BRANCH",
     "ADGM_LLP",
     "RAK_ICC",
     "AJMAN_OFFSHORE",
     "UNINCORPORATED_PARTNERSHIP",
     "FAMILY_FOUNDATION",
     "TRUST",
     "BRANCH",
     "DIFC",
     "ADGM",
     "PSC",
     "OTHER"
    ],
    "title": "LegalStructure"
   },
   "MatchedEntryDetails": {
    "properties": {
     "source": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source"
     },
     "aliases": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Aliases",
      "default": []
     },
     "nationality": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Nationality"
     },
     "dob": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dob"
     },
     "entity_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Entity Type"
     },
     "list_date": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "List Date"
     }
    },
    "type": "object",
    "title": "MatchedEntryDetails",
    "description": "Sanctions entry details surfaced alongside a screening check."
   },
   "ModuleReadinessResponse": {
    "properties": {
     "module": {
      "type": "string",
      "title": "Module"
     },
     "label": {
      "type": "string",
      "title": "Label"
     },
     "icon": {
      "type": "string",
      "title": "Icon"
     },
     "ready": {
      "type": "boolean",
      "title": "Ready"
     },
     "met_count": {
      "type": "integer",
      "title": "Met Count"
     },
     "total_count": {
      "type": "integer",
      "title": "Total Count"
     },
     "items": {
      "items": {
       "$ref": "#/components/schemas/ReadinessItemResponse"
      },
      "type": "array",
      "title": "Items"
     }
    },
    "type": "object",
    "required": [
     "module",
     "label",
     "icon",
     "ready",
     "met_count",
     "total_count",
     "items"
    ],
    "title": "ModuleReadinessResponse"
   },
   "MonthlyEmission": {
    "properties": {
     "month": {
      "type": "integer",
      "title": "Month"
     },
     "year": {
      "type": "integer",
      "title": "Year"
     },
     "co2e_kg": {
      "type": "string",
      "title": "Co2E Kg"
     }
    },
    "type": "object",
    "required": [
     "month",
     "year",
     "co2e_kg"
    ],
    "title": "MonthlyEmission"
   },
   "ObligationListResponse": {
    "properties": {
     "obligations": {
      "items": {
       "$ref": "#/components/schemas/ObligationResponse"
      },
      "type": "array",
      "title": "Obligations"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "kept": {
      "type": "integer",
      "title": "Kept",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "obligations",
     "total"
    ],
    "title": "ObligationListResponse"
   },
   "ObligationResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "contract_id": {
      "type": "string",
      "format": "uuid",
      "title": "Contract Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "obligation_text": {
      "type": "string",
      "title": "Obligation Text"
     },
     "responsible_party": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Responsible Party"
     },
     "obligation_type": {
      "type": "string",
      "title": "Obligation Type"
     },
     "deadline": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Deadline"
     },
     "recurrence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recurrence"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "calendar_entry_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Calendar Entry Id"
     },
     "ai_confidence": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Confidence"
     },
     "cited_clauses": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Cited Clauses"
     },
     "source": {
      "type": "string",
      "title": "Source",
      "default": "AI"
     },
     "created_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "contract_id",
     "entity_id",
     "obligation_text",
     "obligation_type",
     "status"
    ],
    "title": "ObligationResponse"
   },
   "OverdueFilingItem": {
    "properties": {
     "calendar_event_id": {
      "type": "string",
      "format": "uuid",
      "title": "Calendar Event Id"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "days_overdue": {
      "type": "integer",
      "title": "Days Overdue"
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     }
    },
    "type": "object",
    "required": [
     "calendar_event_id",
     "title",
     "due_date",
     "days_overdue"
    ],
    "title": "OverdueFilingItem"
   },
   "PEPCategory": {
    "type": "string",
    "enum": [
     "DOMESTIC",
     "FOREIGN",
     "INTERNATIONAL_ORG",
     "FAMILY_MEMBER",
     "CLOSE_ASSOCIATE"
    ],
    "title": "PEPCategory"
   },
   "PEPReviewStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "CLEARED",
     "CONFIRMED",
     "ESCALATED"
    ],
    "title": "PEPReviewStatus"
   },
   "PEPScreenRequest": {
    "properties": {
     "subject_name": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Subject Name"
     },
     "subject_type": {
      "type": "string",
      "maxLength": 50,
      "title": "Subject Type",
      "default": "CUSTOMER"
     },
     "cdd_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Cdd Id"
     },
     "date_of_birth": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Date Of Birth"
     },
     "country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 80
       },
       {
        "type": "null"
       }
      ],
      "title": "Country"
     }
    },
    "type": "object",
    "required": [
     "subject_name"
    ],
    "title": "PEPScreenRequest"
   },
   "PEPScreeningResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "subject_name": {
      "type": "string",
      "title": "Subject Name"
     },
     "subject_type": {
      "type": "string",
      "title": "Subject Type"
     },
     "pep_status": {
      "type": "string",
      "title": "Pep Status"
     },
     "pep_category": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/PEPCategory"
       },
       {
        "type": "null"
       }
      ]
     },
     "pep_position": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Pep Position"
     },
     "pep_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Pep Country"
     },
     "source_database": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Database"
     },
     "match_confidence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Match Confidence"
     },
     "review_status": {
      "$ref": "#/components/schemas/PEPReviewStatus"
     },
     "match_details": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Match Details"
     },
     "reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By"
     },
     "reviewed_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By Name"
     },
     "reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "subject_name",
     "subject_type",
     "pep_status",
     "review_status",
     "created_at"
    ],
    "title": "PEPScreeningResponse"
   },
   "PaginatedResponse_CDDResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/CDDResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[CDDResponse]"
   },
   "PaginatedResponse_CTReturnResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/CTReturnResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[CTReturnResponse]"
   },
   "PaginatedResponse_ContractListResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/ContractListResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[ContractListResponse]"
   },
   "PaginatedResponse_ESGMetricResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/ESGMetricResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[ESGMetricResponse]"
   },
   "PaginatedResponse_EmissionRecordResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/EmissionRecordResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[EmissionRecordResponse]"
   },
   "PaginatedResponse_EmployeeListResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/EmployeeListResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[EmployeeListResponse]"
   },
   "PaginatedResponse_EntityAlertListResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/EntityAlertListResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[EntityAlertListResponse]"
   },
   "PaginatedResponse_EntityResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/EntityResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[EntityResponse]"
   },
   "PaginatedResponse_EvidenceRecordListResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/EvidenceRecordListResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[EvidenceRecordListResponse]"
   },
   "PaginatedResponse_ScreeningCheckResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/ScreeningCheckResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[ScreeningCheckResponse]"
   },
   "PaginatedResponse_TransactionWithClassificationResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/TransactionWithClassificationResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[TransactionWithClassificationResponse]"
   },
   "PaginatedResponse_VATReturnResponse_": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/VATReturnResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedResponse[VATReturnResponse]"
   },
   "ReadinessItemResponse": {
    "properties": {
     "key": {
      "type": "string",
      "title": "Key"
     },
     "label": {
      "type": "string",
      "title": "Label"
     },
     "met": {
      "type": "boolean",
      "title": "Met"
     },
     "detail": {
      "type": "string",
      "title": "Detail"
     },
     "action": {
      "type": "string",
      "title": "Action"
     },
     "link": {
      "type": "string",
      "title": "Link"
     }
    },
    "type": "object",
    "required": [
     "key",
     "label",
     "met",
     "detail",
     "action",
     "link"
    ],
    "title": "ReadinessItemResponse"
   },
   "RegulatoryUpdateListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "source": {
      "type": "string",
      "title": "Source"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "summary": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Summary"
     },
     "published_date": {
      "type": "string",
      "format": "date",
      "title": "Published Date"
     },
     "effective_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Effective Date"
     },
     "jurisdiction": {
      "type": "string",
      "title": "Jurisdiction"
     },
     "regulation_category": {
      "type": "string",
      "title": "Regulation Category"
     },
     "impact_level": {
      "$ref": "#/components/schemas/ImpactLevel"
     },
     "status": {
      "$ref": "#/components/schemas/UpdateStatus"
     },
     "keywords": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Keywords",
      "default": []
     },
     "affected_entity_types": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Affected Entity Types",
      "default": []
     },
     "affected_industries": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Affected Industries",
      "default": []
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "triage_status": {
      "type": "string",
      "title": "Triage Status",
      "description": "Derived triage label — NOT a DB column.\n\nMATERIAL when the impact is HIGH or CRITICAL (needs action);\nMONITOR for LOW / MEDIUM and any other/unknown value (watch only).",
      "readOnly": true
     }
    },
    "type": "object",
    "required": [
     "id",
     "source",
     "title",
     "published_date",
     "jurisdiction",
     "regulation_category",
     "impact_level",
     "status",
     "created_at",
     "triage_status"
    ],
    "title": "RegulatoryUpdateListResponse"
   },
   "RetentionPolicy": {
    "type": "string",
    "enum": [
     "TAX_7Y",
     "AML_5Y",
     "CORPORATE_10Y",
     "DEFAULT_3Y"
    ],
    "title": "RetentionPolicy"
   },
   "ReturnStatus": {
    "type": "string",
    "enum": [
     "DRAFT",
     "STALE",
     "UNDER_REVIEW",
     "FILED",
     "AMENDED",
     "OVERDUE"
    ],
    "title": "ReturnStatus"
   },
   "RevenueRange": {
    "type": "string",
    "enum": [
     "UNDER_1M",
     "ONE_TO_5M",
     "FIVE_TO_25M",
     "TWENTY_FIVE_TO_100M",
     "ABOVE_100M",
     "UNDER_375K",
     "RANGE_375K_3M",
     "RANGE_3M_375M",
     "ABOVE_375M"
    ],
    "title": "RevenueRange"
   },
   "ReviewQueueSummary": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "pending_count": {
      "type": "integer",
      "title": "Pending Count"
     },
     "total_amount_pending_aed": {
      "type": "string",
      "title": "Total Amount Pending Aed"
     },
     "high_risk_count": {
      "type": "integer",
      "title": "High Risk Count"
     },
     "auto_approved_count": {
      "type": "integer",
      "title": "Auto Approved Count",
      "default": 0
     },
     "flagged_count": {
      "type": "integer",
      "title": "Flagged Count",
      "default": 0
     },
     "total_transactions": {
      "type": "integer",
      "title": "Total Transactions",
      "default": 0
     },
     "unclassified_count": {
      "type": "integer",
      "title": "Unclassified Count",
      "default": 0
     },
     "classified_count": {
      "type": "integer",
      "title": "Classified Count",
      "default": 0
     },
     "approved_count": {
      "type": "integer",
      "title": "Approved Count",
      "default": 0
     },
     "approved_total_count": {
      "type": "integer",
      "title": "Approved Total Count",
      "default": 0
     },
     "auto_approved_by_source": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Auto Approved By Source",
      "default": {}
     },
     "rejected_count": {
      "type": "integer",
      "title": "Rejected Count",
      "default": 0
     },
     "oldest_pending_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Oldest Pending Date"
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "pending_count",
     "total_amount_pending_aed",
     "high_risk_count",
     "oldest_pending_date"
    ],
    "title": "ReviewQueueSummary"
   },
   "ReviewStatus-Input": {
    "type": "string",
    "enum": [
     "PENDING_REVIEW",
     "APPROVED",
     "REJECTED",
     "AUTO_APPROVED"
    ],
    "title": "ReviewStatus"
   },
   "RiskLevel-Input": {
    "type": "string",
    "enum": [
     "LOW",
     "MEDIUM",
     "HIGH",
     "VERY_HIGH",
     "PROHIBITED"
    ],
    "title": "RiskLevel"
   },
   "SanctionsSummaryResponse": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "not_screened": {
      "type": "integer",
      "title": "Not Screened",
      "default": 0
     },
     "pending": {
      "type": "integer",
      "title": "Pending"
     },
     "cleared": {
      "type": "integer",
      "title": "Cleared"
     },
     "matched": {
      "type": "integer",
      "title": "Matched"
     },
     "escalated": {
      "type": "integer",
      "title": "Escalated"
     },
     "lists_last_refreshed_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lists Last Refreshed At"
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "total",
     "pending",
     "cleared",
     "matched",
     "escalated"
    ],
    "title": "SanctionsSummaryResponse"
   },
   "ScopeBreakdown": {
    "properties": {
     "scope": {
      "$ref": "#/components/schemas/EmissionScope"
     },
     "total_co2e_kg": {
      "type": "string",
      "title": "Total Co2E Kg"
     },
     "percentage": {
      "type": "string",
      "title": "Percentage"
     }
    },
    "type": "object",
    "required": [
     "scope",
     "total_co2e_kg",
     "percentage"
    ],
    "title": "ScopeBreakdown"
   },
   "ScreenCounterpartyRequest": {
    "properties": {
     "subject_name": {
      "type": "string",
      "maxLength": 500,
      "minLength": 2,
      "title": "Subject Name"
     },
     "subject_type": {
      "type": "string",
      "enum": [
       "CUSTOMER",
       "VENDOR",
       "UBO",
       "OTHER"
      ],
      "title": "Subject Type",
      "default": "OTHER"
     },
     "subject_dob": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Subject Dob",
      "description": "Subject date of birth (YYYY-MM-DD) for demographic matching"
     },
     "subject_nationality": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 80
       },
       {
        "type": "null"
       }
      ],
      "title": "Subject Nationality",
      "description": "Nationality: a country name or ISO code (India, IN, IND, UAE). Stored and used as the ISO alpha-2 code."
     }
    },
    "type": "object",
    "required": [
     "subject_name"
    ],
    "title": "ScreenCounterpartyRequest"
   },
   "ScreeningCheckResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "subject_name": {
      "type": "string",
      "title": "Subject Name"
     },
     "subject_type": {
      "type": "string",
      "title": "Subject Type"
     },
     "match_score": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Match Score"
     },
     "matched_entry_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Matched Entry Id"
     },
     "matched_entry_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Matched Entry Name"
     },
     "matched_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Matched Name"
     },
     "matched_entry_details": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/MatchedEntryDetails"
       },
       {
        "type": "null"
       }
      ]
     },
     "status": {
      "$ref": "#/components/schemas/ScreeningStatus"
     },
     "clear_basis": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Clear Basis"
     },
     "score_is_similarity": {
      "type": "boolean",
      "title": "Score Is Similarity",
      "default": true
     },
     "reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By"
     },
     "reviewed_by_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By Name"
     },
     "review_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Review Notes"
     },
     "assigned_to": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assigned To"
     },
     "assigned_to_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assigned To Name"
     },
     "assigned_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assigned At"
     },
     "screened_at": {
      "type": "string",
      "format": "date-time",
      "title": "Screened At"
     },
     "reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "subject_name",
     "subject_type",
     "status",
     "screened_at",
     "created_at"
    ],
    "title": "ScreeningCheckResponse"
   },
   "ScreeningStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "CLEARED",
     "MATCHED",
     "ESCALATED"
    ],
    "title": "ScreeningStatus"
   },
   "TaskCatalogResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "framework_code": {
      "type": "string",
      "title": "Framework Code"
     },
     "task_key": {
      "type": "string",
      "title": "Task Key"
     },
     "task_name": {
      "type": "string",
      "title": "Task Name"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "task_type": {
      "$ref": "#/components/schemas/TaskType"
     },
     "is_critical": {
      "type": "boolean",
      "title": "Is Critical"
     },
     "evidence_instructions": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Instructions"
     },
     "display_order": {
      "type": "integer",
      "title": "Display Order"
     },
     "frequency": {
      "$ref": "#/components/schemas/TaskFrequency-Output"
     },
     "due_offset_days": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Due Offset Days"
     }
    },
    "type": "object",
    "required": [
     "id",
     "framework_code",
     "task_key",
     "task_name",
     "description",
     "task_type",
     "is_critical",
     "evidence_instructions",
     "display_order",
     "frequency"
    ],
    "title": "TaskCatalogResponse"
   },
   "TaskFrequency-Output": {
    "type": "string",
    "enum": [
     "ONE_TIME",
     "DAILY",
     "WEEKLY",
     "MONTHLY",
     "QUARTERLY",
     "SEMI_ANNUAL",
     "ANNUAL",
     "ROLLING"
    ],
    "title": "TaskFrequency"
   },
   "TaskInstanceResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "task": {
      "$ref": "#/components/schemas/TaskCatalogResponse"
     },
     "status": {
      "$ref": "#/components/schemas/TaskStatus"
     },
     "period_key": {
      "type": "string",
      "title": "Period Key"
     },
     "period_start": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period Start"
     },
     "period_end": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period End"
     },
     "due_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Due Date"
     },
     "auto_check_result": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Auto Check Result"
     },
     "evidence_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Text"
     },
     "evidence_file_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence File Url"
     },
     "ai_feedback": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Feedback"
     },
     "ai_confidence": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Confidence"
     },
     "ai_verdict": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Verdict"
     },
     "ai_cited_articles": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Cited Articles"
     },
     "ai_recommendations": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ai Recommendations"
     },
     "waiver_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Waiver Reason"
     },
     "human_approval_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Human Approval Notes"
     },
     "reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed By"
     },
     "reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reviewed At"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     },
     "approval": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Approval"
     },
     "waiver_request": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Waiver Request"
     }
    },
    "type": "object",
    "required": [
     "id",
     "task",
     "status",
     "period_key",
     "auto_check_result",
     "evidence_text",
     "evidence_file_url",
     "ai_feedback",
     "ai_verdict",
     "ai_cited_articles",
     "ai_recommendations",
     "waiver_reason",
     "human_approval_notes",
     "reviewed_by",
     "reviewed_at",
     "created_at",
     "updated_at"
    ],
    "title": "TaskInstanceResponse"
   },
   "TaskStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "AUTO_PASSED",
     "AUTO_FAILED",
     "EVIDENCE_SUBMITTED",
     "AI_REVIEWING",
     "AI_PASSED",
     "AI_FAILED",
     "WAIVED",
     "PENDING_HUMAN_APPROVAL",
     "VERIFIED"
    ],
    "title": "TaskStatus"
   },
   "TaskType": {
    "type": "string",
    "enum": [
     "AUTO",
     "EVIDENCE",
     "HYBRID"
    ],
    "title": "TaskType"
   },
   "TaxCategory": {
    "type": "string",
    "enum": [
     "TAXABLE_INCOME",
     "EXEMPT_INCOME",
     "QUALIFYING_FREE_ZONE_INCOME",
     "DEDUCTIBLE_EXPENSE",
     "NON_DEDUCTIBLE_EXPENSE",
     "INTEREST_EXPENSE",
     "ENTERTAINMENT_EXPENSE",
     "STAFF_COST",
     "RENT_EXPENSE",
     "MARKETING_EXPENSE",
     "PROFESSIONAL_FEES",
     "OPERATING_EXPENSE",
     "STANDARD_RATED",
     "ZERO_RATED",
     "EXEMPT_VAT",
     "OUT_OF_SCOPE",
     "COGS",
     "CAPITAL_ASSET",
     "DEPRECIATION",
     "DEFERRED_INCOME",
     "R_AND_D_EXPENSE",
     "UNCLASSIFIED"
    ],
    "title": "TaxCategory",
    "description": "UAE Corporate Tax income/expense categories — FTA-compliant breakdown."
   },
   "TaxTransactionCreateRequest": {
    "properties": {
     "transaction_date": {
      "type": "string",
      "format": "date",
      "title": "Transaction Date"
     },
     "transaction_type": {
      "$ref": "#/components/schemas/TransactionType"
     },
     "description": {
      "type": "string",
      "maxLength": 2000,
      "minLength": 3,
      "title": "Description"
     },
     "vendor_customer": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Customer"
     },
     "vendor_country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 2
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Country",
      "description": "Vendor/customer country (ISO alpha-2 or short name like UAE, KSA). Critical for VAT: UAE=standard-rated, outside UAE=zero-rated/reverse-charge."
     },
     "vendor_trn": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 20
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Trn",
      "description": "Vendor/supplier Tax Registration Number. Required for input VAT recovery (Article 59 VAT Exec Regs). If missing, input VAT may be blocked."
     },
     "amount_aed": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "string"
       }
      ],
      "title": "Amount Aed",
      "description": "Net amount in AED excluding VAT (VAT computed from classification). SIGNED: positive for an INVOICE / DEBIT_NOTE; negative for a CREDIT_NOTE (a reversal that reduces revenue or cost). Must be non-zero."
     },
     "document_type": {
      "$ref": "#/components/schemas/app__models__tax__DocumentType",
      "description": "INVOICE | CREDIT_NOTE | DEBIT_NOTE. A CREDIT_NOTE is a signed reversal (negative amount) on its side (IFRS 15 / UAE VAT Arts 61-62).",
      "default": "INVOICE"
     },
     "counterparty_role": {
      "$ref": "#/components/schemas/CounterpartyRole",
      "description": "CUSTOMER (AR / sales → INCOME) | SUPPLIER (AP / purchase → EXPENSE) | UNKNOWN. Determines whether a credit note reduces revenue or cost.",
      "default": "UNKNOWN"
     },
     "original_currency": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Currency"
     },
     "original_amount": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Amount"
     },
     "exchange_rate": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exchange Rate"
     },
     "account_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Code"
     },
     "account_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Name"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "is_reverse_charge": {
      "type": "boolean",
      "title": "Is Reverse Charge",
      "default": false
     },
     "retention_percentage": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 100.0,
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Percentage",
      "description": "Retention % (e.g. 10.00). If set, VAT is computed on gross = amount / (1 - pct/100)."
     },
     "is_margin_scheme": {
      "type": "boolean",
      "title": "Is Margin Scheme",
      "description": "Profit Margin Scheme: VAT applies only to (sale price - purchase price).",
      "default": false
     },
     "purchase_price_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Purchase Price Aed",
      "description": "Original purchase price for margin scheme goods."
     },
     "foreign_wht_amount": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Amount",
      "description": "Foreign WHT withheld on income paid to this UAE entity (AED)."
     },
     "foreign_wht_certificate_ref": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Certificate Ref",
      "description": "WHT certificate or proof document reference."
     },
     "foreign_wht_country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 2
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Country",
      "description": "Country that withheld tax (ISO alpha-2)."
     },
     "foreign_wht_rate": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Rate",
      "description": "WHT rate applied (e.g. 0.15 = 15%)."
     },
     "rp_loan_purpose": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(OPERATING|DIVIDEND|SHARE_BUYBACK|RP_ACQUISITION)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rp Loan Purpose",
      "description": "Purpose of related party loan (Article 31). Only relevant for INTEREST_EXPENSE."
     },
     "tax_point_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tax Point Date",
      "description": "VAT supply date if different from transaction_date (Article 26 VAT)."
     }
    },
    "type": "object",
    "required": [
     "transaction_date",
     "transaction_type",
     "description",
     "amount_aed"
    ],
    "title": "TaxTransactionCreateRequest"
   },
   "TaxTransactionResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "transaction_date": {
      "type": "string",
      "format": "date",
      "title": "Transaction Date"
     },
     "transaction_type": {
      "$ref": "#/components/schemas/TransactionType"
     },
     "description": {
      "type": "string",
      "title": "Description"
     },
     "vendor_customer": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Customer"
     },
     "vendor_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Country"
     },
     "vendor_trn": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Trn"
     },
     "amount_aed": {
      "type": "string",
      "title": "Amount Aed"
     },
     "original_currency": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Currency"
     },
     "original_amount": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Amount"
     },
     "exchange_rate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exchange Rate"
     },
     "account_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Code"
     },
     "account_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Name"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "is_reverse_charge": {
      "type": "boolean",
      "title": "Is Reverse Charge",
      "default": false
     },
     "retention_percentage": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Percentage"
     },
     "is_margin_scheme": {
      "type": "boolean",
      "title": "Is Margin Scheme",
      "default": false
     },
     "purchase_price_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Purchase Price Aed"
     },
     "receipt_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Receipt Blob Path"
     },
     "accounting_system": {
      "$ref": "#/components/schemas/AccountingSystem"
     },
     "evidence_status": {
      "$ref": "#/components/schemas/EvidenceStatus",
      "default": "NOT_REQUIRED"
     },
     "evidence_required_reasons": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Required Reasons"
     },
     "foreign_wht_amount": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Amount"
     },
     "foreign_wht_certificate_ref": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Certificate Ref"
     },
     "foreign_wht_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Country"
     },
     "foreign_wht_rate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Rate"
     },
     "foreign_wht_ai_confidence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Ai Confidence"
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "is_foreign_pe": {
      "type": "boolean",
      "title": "Is Foreign Pe",
      "default": false
     },
     "reverse_charge_decision": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge Decision"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "transaction_date",
     "transaction_type",
     "description",
     "amount_aed",
     "accounting_system",
     "created_at"
    ],
    "title": "TaxTransactionResponse"
   },
   "TaxTransactionUpdateRequest": {
    "properties": {
     "transaction_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Transaction Date"
     },
     "transaction_type": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TransactionType"
       },
       {
        "type": "null"
       }
      ]
     },
     "description": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000,
        "minLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "vendor_customer": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Customer"
     },
     "vendor_country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 2
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Country"
     },
     "vendor_trn": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 20
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Trn"
     },
     "amount_aed": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Amount Aed"
     },
     "original_currency": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 3
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Currency"
     },
     "original_amount": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Amount"
     },
     "exchange_rate": {
      "anyOf": [
       {
        "type": "number",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exchange Rate"
     },
     "account_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Code"
     },
     "account_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Name"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "is_reverse_charge": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Reverse Charge"
     },
     "retention_percentage": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 100.0,
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Percentage"
     },
     "is_margin_scheme": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Margin Scheme"
     },
     "purchase_price_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Purchase Price Aed"
     },
     "foreign_wht_amount": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Amount"
     },
     "foreign_wht_certificate_ref": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Certificate Ref"
     },
     "foreign_wht_country": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 3,
        "minLength": 2
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Country"
     },
     "foreign_wht_rate": {
      "anyOf": [
       {
        "type": "number",
        "maximum": 1.0,
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Rate"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^(ABU_DHABI|DUBAI|SHARJAH|AJMAN|UMM_AL_QUWAIN|RAS_AL_KHAIMAH|FUJAIRAH)$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "is_foreign_pe": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Foreign Pe"
     }
    },
    "type": "object",
    "title": "TaxTransactionUpdateRequest"
   },
   "TerminationType": {
    "type": "string",
    "enum": [
     "RESIGNATION",
     "DISMISSAL",
     "MUTUAL_AGREEMENT",
     "CONTRACT_END"
    ],
    "title": "TerminationType"
   },
   "TransactionEvidenceResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "transaction_id": {
      "type": "string",
      "format": "uuid",
      "title": "Transaction Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "evidence_record_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Record Id"
     },
     "file_name": {
      "type": "string",
      "title": "File Name"
     },
     "blob_path": {
      "type": "string",
      "title": "Blob Path"
     },
     "file_hash_sha256": {
      "type": "string",
      "title": "File Hash Sha256"
     },
     "mime_type": {
      "type": "string",
      "title": "Mime Type"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "document_type": {
      "type": "string",
      "title": "Document Type"
     },
     "validation_status": {
      "type": "string",
      "title": "Validation Status"
     },
     "validation_result": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Validation Result"
     },
     "validated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Validated At"
     },
     "uploaded_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded By"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "transaction_id",
     "entity_id",
     "file_name",
     "blob_path",
     "file_hash_sha256",
     "mime_type",
     "file_size_bytes",
     "document_type",
     "validation_status",
     "created_at"
    ],
    "title": "TransactionEvidenceResponse"
   },
   "TransactionType": {
    "type": "string",
    "enum": [
     "INCOME",
     "EXPENSE",
     "ADJUSTMENT",
     "ASSET",
     "LIABILITY",
     "EQUITY",
     "OTHER"
    ],
    "title": "TransactionType"
   },
   "TransactionWithClassificationResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "transaction_date": {
      "type": "string",
      "format": "date",
      "title": "Transaction Date"
     },
     "transaction_type": {
      "$ref": "#/components/schemas/TransactionType"
     },
     "description": {
      "type": "string",
      "title": "Description"
     },
     "vendor_customer": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Customer"
     },
     "vendor_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Country"
     },
     "vendor_trn": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Trn"
     },
     "amount_aed": {
      "type": "string",
      "title": "Amount Aed"
     },
     "original_currency": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Currency"
     },
     "original_amount": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Original Amount"
     },
     "exchange_rate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Exchange Rate"
     },
     "account_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Code"
     },
     "account_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Name"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "is_reverse_charge": {
      "type": "boolean",
      "title": "Is Reverse Charge",
      "default": false
     },
     "retention_percentage": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Retention Percentage"
     },
     "is_margin_scheme": {
      "type": "boolean",
      "title": "Is Margin Scheme",
      "default": false
     },
     "purchase_price_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Purchase Price Aed"
     },
     "receipt_blob_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Receipt Blob Path"
     },
     "accounting_system": {
      "$ref": "#/components/schemas/AccountingSystem"
     },
     "evidence_status": {
      "$ref": "#/components/schemas/EvidenceStatus",
      "default": "NOT_REQUIRED"
     },
     "evidence_required_reasons": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Evidence Required Reasons"
     },
     "foreign_wht_amount": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Amount"
     },
     "foreign_wht_certificate_ref": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Certificate Ref"
     },
     "foreign_wht_country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Country"
     },
     "foreign_wht_rate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Rate"
     },
     "foreign_wht_ai_confidence": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Foreign Wht Ai Confidence"
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     },
     "emirate": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Emirate"
     },
     "is_foreign_pe": {
      "type": "boolean",
      "title": "Is Foreign Pe",
      "default": false
     },
     "reverse_charge_decision": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge Decision"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "classification": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/ClassificationResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "vat_locked": {
      "type": "boolean",
      "title": "Vat Locked",
      "default": false
     },
     "ct_locked": {
      "type": "boolean",
      "title": "Ct Locked",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "transaction_date",
     "transaction_type",
     "description",
     "amount_aed",
     "accounting_system",
     "created_at"
    ],
    "title": "TransactionWithClassificationResponse"
   },
   "UpdateStatus": {
    "type": "string",
    "enum": [
     "ACTIVE",
     "SUPERSEDED",
     "ARCHIVED"
    ],
    "title": "UpdateStatus"
   },
   "VATPeriodItem": {
    "properties": {
     "label": {
      "type": "string",
      "title": "Label"
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "in_progress": {
      "type": "boolean",
      "title": "In Progress",
      "default": false
     },
     "status": {
      "type": "string",
      "title": "Status",
      "default": "NOT_STARTED"
     },
     "return_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Return Id"
     },
     "is_open": {
      "type": "boolean",
      "title": "Is Open",
      "default": true
     },
     "is_first_period": {
      "type": "boolean",
      "title": "Is First Period",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "label",
     "period_start",
     "period_end",
     "due_date"
    ],
    "title": "VATPeriodItem"
   },
   "VATPeriodsResponse": {
    "properties": {
     "frequency": {
      "type": "string",
      "title": "Frequency"
     },
     "stagger": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Stagger"
     },
     "period_end_months": {
      "items": {
       "type": "integer"
      },
      "type": "array",
      "title": "Period End Months",
      "default": []
     },
     "periods": {
      "items": {
       "$ref": "#/components/schemas/VATPeriodItem"
      },
      "type": "array",
      "title": "Periods"
     },
     "default_period": {
      "$ref": "#/components/schemas/VATPeriodItem"
     }
    },
    "type": "object",
    "required": [
     "frequency",
     "periods",
     "default_period"
    ],
    "title": "VATPeriodsResponse"
   },
   "VATReturnComputeRequest": {
    "properties": {
     "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End"
     },
     "country": {
      "type": "string",
      "maxLength": 3,
      "minLength": 3,
      "title": "Country",
      "default": "ARE"
     }
    },
    "type": "object",
    "required": [
     "period_start",
     "period_end"
    ],
    "title": "VATReturnComputeRequest",
    "description": "Trigger VAT return computation for a period."
   },
   "VATReturnResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "country": {
      "type": "string",
      "title": "Country"
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "standard_rated_sales": {
      "type": "string",
      "title": "Standard Rated Sales"
     },
     "vat_on_sales": {
      "type": "string",
      "title": "Vat On Sales"
     },
     "zero_rated_sales": {
      "type": "string",
      "title": "Zero Rated Sales"
     },
     "exempt_sales": {
      "type": "string",
      "title": "Exempt Sales"
     },
     "standard_rated_purchases": {
      "type": "string",
      "title": "Standard Rated Purchases"
     },
     "vat_on_purchases": {
      "type": "string",
      "title": "Vat On Purchases"
     },
     "net_vat_due": {
      "type": "string",
      "title": "Net Vat Due"
     },
     "prior_period_credit_aed": {
      "type": "string",
      "title": "Prior Period Credit Aed",
      "default": "0.00"
     },
     "reverse_charge_sales": {
      "type": "string",
      "title": "Reverse Charge Sales",
      "default": "0.00"
     },
     "reverse_charge_vat": {
      "type": "string",
      "title": "Reverse Charge Vat",
      "default": "0.00"
     },
     "reverse_charge_input": {
      "type": "string",
      "title": "Reverse Charge Input",
      "default": "0.00"
     },
     "exempt_input_vat": {
      "type": "string",
      "title": "Exempt Input Vat",
      "default": "0.00"
     },
     "partial_exemption_ratio": {
      "type": "string",
      "title": "Partial Exemption Ratio",
      "default": "1.0000"
     },
     "recoverable_input_vat": {
      "type": "string",
      "title": "Recoverable Input Vat",
      "default": "0.00"
     },
     "bad_debt_relief_vat": {
      "type": "string",
      "title": "Bad Debt Relief Vat",
      "default": "0.00"
     },
     "bad_debt_invoice_count": {
      "type": "integer",
      "title": "Bad Debt Invoice Count",
      "default": 0
     },
     "blocked_input_vat": {
      "type": "string",
      "title": "Blocked Input Vat",
      "default": "0.00"
     },
     "deemed_supply_vat": {
      "type": "string",
      "title": "Deemed Supply Vat",
      "default": "0.00"
     },
     "deemed_supply_count": {
      "type": "integer",
      "title": "Deemed Supply Count",
      "default": 0
     },
     "capital_goods_adjustment": {
      "type": "string",
      "title": "Capital Goods Adjustment",
      "default": "0.00"
     },
     "box_details": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Box Details"
     },
     "is_group_return": {
      "type": "boolean",
      "title": "Is Group Return",
      "default": false
     },
     "vat_group_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Group Id"
     },
     "status": {
      "$ref": "#/components/schemas/ReturnStatus"
     },
     "filed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed At"
     },
     "filed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed By"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "warnings": {
      "items": {
       "type": "object"
      },
      "type": "array",
      "title": "Warnings",
      "default": []
     },
     "computation_notes": {
      "items": {
       "type": "object"
      },
      "type": "array",
      "title": "Computation Notes",
      "default": []
     },
     "recompute_blocked": {
      "type": "boolean",
      "title": "Recompute Blocked",
      "default": false
     },
     "requires_voluntary_disclosure": {
      "type": "boolean",
      "title": "Requires Voluntary Disclosure",
      "default": false
     },
     "filed_figures": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filed Figures"
     },
     "recomputed_figures": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recomputed Figures"
     },
     "recompute_delta": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recompute Delta"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "country",
     "period_start",
     "period_end",
     "due_date",
     "standard_rated_sales",
     "vat_on_sales",
     "zero_rated_sales",
     "exempt_sales",
     "standard_rated_purchases",
     "vat_on_purchases",
     "net_vat_due",
     "status",
     "created_at"
    ],
    "title": "VATReturnResponse"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "WPSComplianceStatus": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "period_year": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period Year"
     },
     "period_month": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period Month"
     },
     "total_wps_employees": {
      "type": "integer",
      "title": "Total Wps Employees"
     },
     "compliant_last_month": {
      "type": "integer",
      "title": "Compliant Last Month"
     },
     "late_count": {
      "type": "integer",
      "title": "Late Count"
     },
     "missed_count": {
      "type": "integer",
      "title": "Missed Count"
     },
     "not_recorded_count": {
      "type": "integer",
      "title": "Not Recorded Count",
      "default": 0
     },
     "compliance_rate_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Compliance Rate Pct"
     },
     "compliant_last_3_months": {
      "type": "integer",
      "title": "Compliant Last 3 Months"
     },
     "enrolled_months_last_3_months": {
      "type": "integer",
      "title": "Enrolled Months Last 3 Months",
      "default": 0
     },
     "late_count_3_months": {
      "type": "integer",
      "title": "Late Count 3 Months",
      "default": 0
     },
     "missed_count_3_months": {
      "type": "integer",
      "title": "Missed Count 3 Months",
      "default": 0
     },
     "compliance_rate_3_months_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Compliance Rate 3 Months Pct"
     },
     "at_risk_employees": {
      "items": {
       "type": "object"
      },
      "type": "array",
      "title": "At Risk Employees",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "total_wps_employees",
     "compliant_last_month",
     "late_count",
     "missed_count",
     "compliant_last_3_months"
    ],
    "title": "WPSComplianceStatus",
    "description": "See app/services/workforce_figures.py for every definition."
   },
   "WPSRecordCreateRequest": {
    "properties": {
     "period_month": {
      "type": "integer",
      "maximum": 12.0,
      "minimum": 1.0,
      "title": "Period Month"
     },
     "period_year": {
      "type": "integer",
      "maximum": 2100.0,
      "minimum": 2000.0,
      "title": "Period Year"
     },
     "due_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Due Date"
     },
     "paid_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Paid Date"
     },
     "salary_paid_aed": {
      "anyOf": [
       {
        "type": "number",
        "minimum": 0.0
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Salary Paid Aed"
     },
     "status": {
      "$ref": "#/components/schemas/WPSStatus",
      "default": "PENDING"
     }
    },
    "type": "object",
    "required": [
     "period_month",
     "period_year"
    ],
    "title": "WPSRecordCreateRequest"
   },
   "WPSRecordResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "title": "Employee Id"
     },
     "period_month": {
      "type": "integer",
      "title": "Period Month"
     },
     "period_year": {
      "type": "integer",
      "title": "Period Year"
     },
     "due_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Due Date"
     },
     "paid_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Paid Date"
     },
     "salary_paid_aed": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Salary Paid Aed"
     },
     "status": {
      "$ref": "#/components/schemas/WPSStatus"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "employee_id",
     "period_month",
     "period_year",
     "status",
     "created_at"
    ],
    "title": "WPSRecordResponse"
   },
   "WPSStatus": {
    "type": "string",
    "enum": [
     "PENDING",
     "COMPLIANT",
     "LATE",
     "MISSED"
    ],
    "title": "WPSStatus"
   },
   "WatchlistSourceStatus": {
    "properties": {
     "source": {
      "type": "string",
      "title": "Source"
     },
     "label": {
      "type": "string",
      "title": "Label"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "is_stale": {
      "type": "boolean",
      "title": "Is Stale"
     },
     "required": {
      "type": "boolean",
      "title": "Required",
      "default": true
     },
     "never_loaded": {
      "type": "boolean",
      "title": "Never Loaded",
      "default": false
     },
     "blocks_screening": {
      "type": "boolean",
      "title": "Blocks Screening",
      "default": false
     },
     "active_entries": {
      "type": "integer",
      "title": "Active Entries"
     },
     "entries_count": {
      "type": "integer",
      "title": "Entries Count",
      "default": 0
     },
     "last_success_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Success At"
     },
     "started_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Started At"
     },
     "completed_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Completed At"
     },
     "last_attempt_failed": {
      "type": "boolean",
      "title": "Last Attempt Failed",
      "default": false
     },
     "error_message": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error Message"
     }
    },
    "type": "object",
    "required": [
     "source",
     "label",
     "status",
     "is_stale",
     "active_entries"
    ],
    "title": "WatchlistSourceStatus"
   },
   "WatchlistStatusResponse": {
    "properties": {
     "overall": {
      "type": "string",
      "title": "Overall"
     },
     "screening_available": {
      "type": "boolean",
      "title": "Screening Available"
     },
     "freshness_max_days": {
      "type": "integer",
      "title": "Freshness Max Days"
     },
     "stale_sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Stale Sources",
      "default": []
     },
     "required_sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Required Sources",
      "default": []
     },
     "optional_sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Optional Sources",
      "default": []
     },
     "never_loaded_required_sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Never Loaded Required Sources",
      "default": []
     },
     "never_loaded_sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Never Loaded Sources",
      "default": []
     },
     "total_active_entries": {
      "type": "integer",
      "title": "Total Active Entries"
     },
     "sources": {
      "additionalProperties": {
       "$ref": "#/components/schemas/WatchlistSourceStatus"
      },
      "type": "object",
      "title": "Sources"
     },
     "checked_at": {
      "type": "string",
      "title": "Checked At"
     }
    },
    "type": "object",
    "required": [
     "overall",
     "screening_available",
     "freshness_max_days",
     "total_active_entries",
     "sources",
     "checked_at"
    ],
    "title": "WatchlistStatusResponse"
   },
   "WorkforceSummaryResponse": {
    "properties": {
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "active": {
      "type": "integer",
      "title": "Active"
     },
     "on_leave": {
      "type": "integer",
      "title": "On Leave"
     },
     "terminated": {
      "type": "integer",
      "title": "Terminated"
     },
     "active_not_wps_enrolled": {
      "type": "integer",
      "title": "Active Not Wps Enrolled"
     },
     "nationalities": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Nationalities",
      "default": []
     },
     "departments": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Departments",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "entity_id",
     "total",
     "active",
     "on_leave",
     "terminated",
     "active_not_wps_enrolled"
    ],
    "title": "WorkforceSummaryResponse",
    "description": "Entity-wide head counts (not affected by list filters or paging)."
   },
   "app__models__aml__RiskLevel": {
    "type": "string",
    "enum": [
     "LOW",
     "MEDIUM",
     "HIGH",
     "VERY_HIGH",
     "PROHIBITED"
    ],
    "title": "RiskLevel"
   },
   "app__models__contract__ContractType": {
    "type": "string",
    "enum": [
     "SERVICE_AGREEMENT",
     "EMPLOYMENT",
     "NDA",
     "LEASE",
     "SUPPLY",
     "LOAN",
     "JOINT_VENTURE",
     "DISTRIBUTION",
     "FRANCHISE",
     "CONSULTING",
     "OTHER",
     "UNKNOWN"
    ],
    "title": "ContractType"
   },
   "app__models__contract__RiskCategory": {
    "type": "string",
    "enum": [
     "LOW",
     "MEDIUM",
     "HIGH",
     "CRITICAL"
    ],
    "title": "RiskCategory"
   },
   "app__models__tax__DocumentType": {
    "type": "string",
    "enum": [
     "INVOICE",
     "CREDIT_NOTE",
     "DEBIT_NOTE"
    ],
    "title": "DocumentType",
    "description": "Source-document nature of a transaction. Drives credit-note direction.\n\nA CREDIT_NOTE reverses a prior document and is recorded as a NEGATIVE amount\non its own economic side (INCOME for a sales/customer credit note, EXPENSE\nfor a purchase/supplier credit note) — IFRS 15 requires revenue to be shown\nnet of returns/credits (never as an expense), and UAE VAT Arts 61-62 require\na tax credit note to reduce the output/input tax in the period it is issued.\nA DEBIT_NOTE is the mirror (a positive increase on the same side)."
   },
   "app__models__tax__ReviewStatus": {
    "type": "string",
    "enum": [
     "PENDING_REVIEW",
     "APPROVED",
     "REJECTED",
     "AUTO_APPROVED"
    ],
    "title": "ReviewStatus"
   },
   "app__models__workforce__ContractType": {
    "type": "string",
    "enum": [
     "LIMITED",
     "UNLIMITED",
     "FULL_TIME",
     "PART_TIME",
     "TEMPORARY",
     "FLEXIBLE"
    ],
    "title": "ContractType",
    "description": "MOHRE work models (FDL 33/2021 Art. 7 and its executive regulation)."
   },
   "app__schemas__calendar__CalendarEntryResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "entity_id": {
      "type": "string",
      "format": "uuid",
      "title": "Entity Id"
     },
     "framework_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Framework Id"
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     },
     "source_id": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Id"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "is_manual": {
      "type": "boolean",
      "title": "Is Manual"
     }
    },
    "type": "object",
    "required": [
     "id",
     "entity_id",
     "title",
     "due_date",
     "status",
     "is_manual"
    ],
    "title": "CalendarEntryResponse"
   },
   "app__schemas__entity__CalendarEntryResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "title": {
      "type": "string",
      "title": "Title"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "title": "Due Date"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "framework": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/FrameworkResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "source_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Type"
     }
    },
    "type": "object",
    "required": [
     "id",
     "title",
     "description",
     "due_date",
     "status"
    ],
    "title": "CalendarEntryResponse"
   },
   "app__schemas__templates__SanctionsAlertItem": {
    "properties": {
     "subject_name": {
      "type": "string",
      "title": "Subject Name"
     },
     "subject_type": {
      "type": "string",
      "title": "Subject Type"
     },
     "match_score": {
      "type": "number",
      "title": "Match Score"
     },
     "matched_entry_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Matched Entry Name"
     },
     "confidence_band": {
      "type": "string",
      "title": "Confidence Band"
     },
     "screening_check_id": {
      "type": "string",
      "format": "uuid",
      "title": "Screening Check Id"
     }
    },
    "type": "object",
    "required": [
     "subject_name",
     "subject_type",
     "match_score",
     "confidence_band",
     "screening_check_id"
    ],
    "title": "SanctionsAlertItem",
    "description": "Inline sanctions screening alert surfaced in import responses."
   }
  },
  "securitySchemes": {
   "ApiKeyAuth": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key",
    "description": "An API key from the API Keys page (format `cos_live_…`)."
   }
  }
 },
 "security": [
  {
   "ApiKeyAuth": []
  }
 ],
 "x-webhook-events": [
  "invoice.validated",
  "invoice.sent",
  "invoice.created",
  "invoice.overdue",
  "tax.ct_return.computed",
  "tax.vat_return.computed",
  "tax.transaction.classified",
  "tax.threshold.crossed",
  "contract.extracted",
  "contract.risk_scored",
  "contract.high_risk",
  "contract.completed",
  "regulatory.alert.created",
  "regulatory.critical_alert",
  "regulatory.effective_date.approaching",
  "employee.created",
  "employee.terminated",
  "sanctions.match_found",
  "sanctions.cleared",
  "sanctions.escalated",
  "sanctions.rescreen_match",
  "aml.cdd.completed",
  "aml.alert.created",
  "aml.sar.created",
  "aml.sar.filed",
  "dsr.received",
  "dpia.approved",
  "task.assigned",
  "task.completed",
  "breach.logged",
  "data_breach.reported",
  "breach.72hr_overdue",
  "pdpl.breach.72hr_overdue",
  "pdpl.breach.deadline_approaching",
  "breach.72hr_deadline_approaching",
  "pdpl.dpia.approved",
  "pdpl.dpia.rejected",
  "pdpl.retention.expired",
  "pdpl.consent.withdrawn",
  "report.generated",
  "risk.insight.created",
  "risk.treatment_overdue",
  "escalation",
  "freezone.license.registered",
  "freezone.license.updated",
  "freezone.substance.assessed",
  "workflow.completed",
  "audit.finding.created",
  "compliance.deadline.approaching",
  "consistency.blocking_mismatch",
  "evidence.gap.detected",
  "evidence.retention.approaching",
  "bank.auto_match.completed",
  "bill.verified",
  "accounting.period.closed",
  "accounting.period.locked",
  "accounting.period.reopened",
  "journal.withdrawn",
  "journal.deleted",
  "anomaly.detected",
  "policy.alert.created",
  "approval.decided",
  "tax.classifications.reviewed",
  "entity.created",
  "entity.profile.updated",
  "frameworks.mapped",
  "excise.return.computed",
  "excise.return.under_review",
  "customs.declaration.created",
  "learning.job.completed",
  "workforce.document_expiring",
  "workforce.document_expired",
  "pdpl.complaint.received",
  "pdpl.complaint.deadline_approaching",
  "pdpl.policy.review_due",
  "freezone.obligation.overdue",
  "tax_group.ct_return.computed",
  "tax_group.member.changed"
 ]
}
