{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://proklepnito.cz/data-export-schema.json",
  "title": "Proklepnito account data export",
  "description": "Authoritative machine-readable register of the 23 JSON entries in the Proklepnito account export ZIP. The schema models the archive as an object whose property names are ZIP entry names; the archive itself is delivered as application/zip, not as this wrapper object.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "profile.json",
    "portfolio.json",
    "counterparties.json",
    "tags.json",
    "alerts.json",
    "saved-prompts.json",
    "notification-preferences.json",
    "notification-digest-deliveries.json",
    "chat-history.json",
    "api-keys.json",
    "webhooks.json",
    "billing.json",
    "account-settings.json",
    "investigations-and-workspace.json",
    "imports-and-verifications.json",
    "scheduled-exports.json",
    "ai-activity.json",
    "mcp-usage.json",
    "webhook-deliveries.json",
    "credits-and-purchases.json",
    "sanctions-dismissals.json",
    "paywall-events.json",
    "email-and-guest-orders.json"
  ],
  "properties": {
    "profile.json": {
      "$ref": "#/$defs/profile"
    },
    "portfolio.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/portfolioItem"
      }
    },
    "counterparties.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/counterpartyItem"
      }
    },
    "tags.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/tagItem"
      }
    },
    "alerts.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/alertItem"
      }
    },
    "saved-prompts.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/savedPromptItem"
      }
    },
    "notification-preferences.json": {
      "$ref": "#/$defs/notificationPreferences"
    },
    "notification-digest-deliveries.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/notificationDigestDeliveryItem"
      }
    },
    "chat-history.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/chatHistoryItem"
      }
    },
    "api-keys.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/apiKeyItem"
      }
    },
    "webhooks.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/webhookItem"
      }
    },
    "billing.json": {
      "$ref": "#/$defs/billing"
    },
    "account-settings.json": {
      "$ref": "#/$defs/accountSettings"
    },
    "investigations-and-workspace.json": {
      "$ref": "#/$defs/investigationsAndWorkspace"
    },
    "imports-and-verifications.json": {
      "$ref": "#/$defs/importsAndVerifications"
    },
    "scheduled-exports.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/scheduledExportItem"
      }
    },
    "ai-activity.json": {
      "$ref": "#/$defs/aiActivity"
    },
    "mcp-usage.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/mcpUsageItem"
      }
    },
    "webhook-deliveries.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/webhookDeliveryItem"
      }
    },
    "credits-and-purchases.json": {
      "$ref": "#/$defs/creditsAndPurchases"
    },
    "sanctions-dismissals.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/sanctionsDismissalItem"
      }
    },
    "paywall-events.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/paywallEventItem"
      }
    },
    "email-and-guest-orders.json": {
      "$ref": "#/$defs/emailAndGuestOrders"
    }
  },
  "x-registerVersion": "2026-07-29",
  "x-api": {
    "method": "GET",
    "endpoint": "/api/v1/account/data-export",
    "authentication": {
      "required": true,
      "scheme": "Bearer",
      "credential": "Proklepnito access token",
      "authorizationScope": "The account is derived from the authenticated token subject; one account can export only its own data."
    },
    "cooldown": {
      "freeTierDays": 30,
      "paidTierDays": 7,
      "approvedSwitchingRequest": "The self-service cooldown does not restrict an approved Data Act switching request arranged through admin@proklepnito.cz."
    },
    "format": {
      "mediaType": "application/zip",
      "fileNamePattern": "proklepnito-export-YYYY-MM-DD.zip",
      "machineReadableEntries": "application/json; charset=utf-8",
      "propertyNaming": "camelCase",
      "identifiers": "UUID strings",
      "timestamps": "ISO 8601 strings with an explicit UTC offset"
    },
    "standards": [
      {
        "name": "JSON",
        "reference": "RFC 8259"
      },
      {
        "name": "JSON Schema",
        "reference": "Draft 2020-12"
      },
      {
        "name": "ZIP",
        "reference": "PKWARE APPNOTE"
      },
      {
        "name": "Date and time",
        "reference": "ISO 8601"
      }
    ],
    "limits": {
      "selection": "The endpoint returns one fixed complete archive; selecting individual categories is not supported.",
      "serverRetention": "The generated archive is returned directly and is not retained as a downloadable server-side artifact.",
      "rateLimitResponse": {
        "status": 429,
        "mediaType": "application/json",
        "fields": ["error", "retryAfterDays"]
      }
    }
  },
  "x-archive": {
    "humanReadableEntries": ["index.html", "README.txt"],
    "machineReadableEntryCount": 23,
    "completeMachineReadableScope": "The 23 JSON entries listed in properties are the complete machine-readable export. index.html is a summary only."
  },
  "$defs": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "nullableUuid": {
      "type": ["string", "null"],
      "format": "uuid"
    },
    "dateTime": {
      "type": "string",
      "format": "date-time"
    },
    "nullableDateTime": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "nullableDate": {
      "type": ["string", "null"],
      "format": "date"
    },
    "nullableString": {
      "type": ["string", "null"]
    },
    "jsonValue": {
      "description": "A user-facing JSON value persisted by the relevant feature. Its inner structure depends on that feature and is preserved verbatim.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/jsonValue"
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/jsonValue"
          }
        }
      ]
    },
    "profile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "email",
        "name",
        "tier",
        "createdAt",
        "emailVerifiedAt",
        "hasPassword",
        "hasGoogleLogin",
        "legalAcceptances"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "name": {
          "type": "string"
        },
        "tier": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "emailVerifiedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "hasPassword": {
          "type": "boolean"
        },
        "hasGoogleLogin": {
          "type": "boolean"
        },
        "legalAcceptances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/legalAcceptanceItem"
          }
        }
      }
    },
    "legalAcceptanceItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "termsVersion",
        "termsAcceptedAt",
        "privacyNoticeVersion",
        "privacyNoticeAcknowledgedAt",
        "channel"
      ],
      "properties": {
        "termsVersion": {
          "type": "string"
        },
        "termsAcceptedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "privacyNoticeVersion": {
          "type": "string"
        },
        "privacyNoticeAcknowledgedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "channel": {
          "type": "string",
          "enum": ["password_registration", "google_registration"]
        }
      }
    },
    "portfolioItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ico",
        "companyName",
        "customVatId",
        "status",
        "addedAt",
        "lastCheckAt",
        "lastChangeAt",
        "tags"
      ],
      "properties": {
        "ico": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "customVatId": {
          "$ref": "#/$defs/nullableString"
        },
        "status": {
          "type": "string"
        },
        "addedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "lastCheckAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "lastChangeAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "counterpartyItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ico",
        "companyName",
        "relationshipType",
        "exposureLimitCzk",
        "currentExposureCzk",
        "exposureAsOf",
        "currentDecisionId",
        "sourceChannel",
        "version",
        "createdAt",
        "updatedAt",
        "decisions"
      ],
      "properties": {
        "ico": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "relationshipType": {
          "type": "string",
          "enum": ["Unknown", "Customer", "Supplier", "Both", "Other"]
        },
        "exposureLimitCzk": {
          "type": ["number", "null"]
        },
        "currentExposureCzk": {
          "type": ["number", "null"]
        },
        "exposureAsOf": {
          "$ref": "#/$defs/nullableDate"
        },
        "currentDecisionId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "sourceChannel": {
          "type": "string",
          "enum": ["ManualUi", "SpreadsheetImport", "RestApi", "Mcp", "AiChat"]
        },
        "version": {
          "type": "integer"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "decisions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/counterpartyDecisionItem"
          }
        }
      }
    },
    "counterpartyDecisionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "outcome",
        "reasonCode",
        "reasonText",
        "conditions",
        "validUntil",
        "actorType",
        "sourceChannel",
        "actorAccountUserId",
        "actorApiKeyId",
        "actorDelegatedEmail",
        "policyVersion",
        "evidenceSchemaVersion",
        "evidence",
        "decidedAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "outcome": {
          "type": "string",
          "enum": ["Approved", "Conditional", "Rejected"]
        },
        "reasonCode": {
          "$ref": "#/$defs/nullableString"
        },
        "reasonText": {
          "$ref": "#/$defs/nullableString"
        },
        "conditions": {
          "$ref": "#/$defs/nullableString"
        },
        "validUntil": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "actorType": {
          "type": "string",
          "enum": ["Account", "ApiKey"]
        },
        "sourceChannel": {
          "type": "string",
          "enum": ["ManualUi", "SpreadsheetImport", "RestApi", "Mcp", "AiChat"]
        },
        "actorAccountUserId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "actorApiKeyId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "actorDelegatedEmail": {
          "$ref": "#/$defs/nullableString"
        },
        "policyVersion": {
          "type": "string"
        },
        "evidenceSchemaVersion": {
          "type": "integer"
        },
        "evidence": {
          "$ref": "#/$defs/jsonValue"
        },
        "decidedAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "tagItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "color", "createdAt", "companyCount"],
      "properties": {
        "name": {
          "type": "string"
        },
        "color": {
          "$ref": "#/$defs/nullableString"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "companyCount": {
          "type": "integer"
        }
      }
    },
    "alertItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "companyIco",
        "alertType",
        "createdAt",
        "isRead",
        "details",
        "review",
        "comments",
        "deliveries"
      ],
      "properties": {
        "companyIco": {
          "$ref": "#/$defs/nullableString"
        },
        "alertType": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "isRead": {
          "type": "boolean"
        },
        "details": {
          "$ref": "#/$defs/jsonValue"
        },
        "review": {
          "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/alertReviewItem" }]
        },
        "comments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/alertCommentItem"
          }
        },
        "deliveries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/alertDeliveryItem"
          }
        }
      }
    },
    "alertReviewItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "assignedUserId",
        "assignedEmail",
        "updatedByUserId",
        "updatedByEmail",
        "updatedAt",
        "resolvedAt",
        "version"
      ],
      "properties": {
        "status": { "type": "string" },
        "assignedUserId": { "$ref": "#/$defs/nullableUuid" },
        "assignedEmail": { "$ref": "#/$defs/nullableString" },
        "updatedByUserId": { "$ref": "#/$defs/uuid" },
        "updatedByEmail": { "$ref": "#/$defs/nullableString" },
        "updatedAt": { "$ref": "#/$defs/dateTime" },
        "resolvedAt": { "$ref": "#/$defs/nullableDateTime" },
        "version": { "type": "integer" }
      }
    },
    "alertCommentItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "body",
        "authorUserId",
        "authorEmail",
        "createdAt",
        "editedAt"
      ],
      "properties": {
        "id": { "$ref": "#/$defs/uuid" },
        "body": { "type": "string" },
        "authorUserId": { "$ref": "#/$defs/uuid" },
        "authorEmail": { "type": "string" },
        "createdAt": { "$ref": "#/$defs/dateTime" },
        "editedAt": { "$ref": "#/$defs/nullableDateTime" }
      }
    },
    "alertDeliveryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "outbox",
        "id",
        "channel",
        "status",
        "createdAt",
        "lastAttemptAt",
        "nextAttemptAt",
        "attemptCount",
        "completedAt",
        "lastFailureCode",
        "emailPayload",
        "preparedPayload"
      ],
      "properties": {
        "outbox": {
          "type": "string",
          "enum": ["automatic-fallback", "generalized"]
        },
        "id": { "$ref": "#/$defs/uuid" },
        "channel": { "type": "string", "enum": ["Email", "Webhook"] },
        "status": { "type": "string" },
        "createdAt": { "$ref": "#/$defs/dateTime" },
        "lastAttemptAt": { "$ref": "#/$defs/nullableDateTime" },
        "nextAttemptAt": { "$ref": "#/$defs/nullableDateTime" },
        "attemptCount": { "type": "integer" },
        "completedAt": { "$ref": "#/$defs/nullableDateTime" },
        "lastFailureCode": { "$ref": "#/$defs/nullableString" },
        "emailPayload": { "$ref": "#/$defs/jsonValue" },
        "preparedPayload": { "$ref": "#/$defs/jsonValue" }
      }
    },
    "savedPromptItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "content",
        "tags",
        "createdAt",
        "updatedAt",
        "usageCount",
        "lastUsedAt"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "tags": {
          "$ref": "#/$defs/nullableString"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "usageCount": {
          "type": "integer"
        },
        "lastUsedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "notificationChannel": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "insolvency",
        "liquidation",
        "registryDeletion",
        "unreliablePayer",
        "accountChanged",
        "directorChanged",
        "insolvencyEnded",
        "reliablePayerAgain",
        "nameChanged",
        "addressChanged",
        "capitalChanged",
        "regulatoryFinding"
      ],
      "properties": {
        "insolvency": {
          "type": "boolean"
        },
        "liquidation": {
          "type": "boolean"
        },
        "registryDeletion": {
          "type": "boolean"
        },
        "unreliablePayer": {
          "type": "boolean"
        },
        "accountChanged": {
          "type": "boolean"
        },
        "directorChanged": {
          "type": "boolean"
        },
        "insolvencyEnded": {
          "type": "boolean"
        },
        "reliablePayerAgain": {
          "type": "boolean"
        },
        "nameChanged": {
          "type": "boolean"
        },
        "addressChanged": {
          "type": "boolean"
        },
        "capitalChanged": {
          "type": "boolean"
        },
        "regulatoryFinding": {
          "type": "boolean"
        }
      }
    },
    "notificationPreferences": {
      "description": "An empty object means that no preferences row exists and application defaults apply.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "maxProperties": 0
        },
        {
          "$ref": "#/$defs/notificationPreferencesFull"
        }
      ]
    },
    "notificationPreferencesFull": {
      "type": "object",
      "additionalProperties": false,
      "required": ["email", "bell", "digest"],
      "properties": {
        "email": {
          "$ref": "#/$defs/notificationChannel"
        },
        "bell": {
          "$ref": "#/$defs/notificationChannel"
        },
        "digest": {
          "type": "object",
          "additionalProperties": false,
          "required": ["frequency", "weekday", "monthDay", "timeZone"],
          "properties": {
            "frequency": {
              "enum": ["Off", "Weekly", "Monthly"]
            },
            "weekday": {
              "enum": [
                "Sunday",
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday"
              ]
            },
            "monthDay": {
              "type": "integer",
              "minimum": 1,
              "maximum": 28
            },
            "timeZone": {
              "const": "Europe/Prague"
            }
          }
        }
      }
    },
    "chatHistoryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "createdAt", "updatedAt", "messages"],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "messages": {
          "$ref": "#/$defs/jsonValue"
        }
      }
    },
    "apiKeyItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "prefix",
        "scope",
        "createdAt",
        "lastUsedAt",
        "revokedAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "prefix": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "lastUsedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "revokedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "webhookItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "url",
        "isActive",
        "createdAt",
        "lastDeliveryAt",
        "lastDeliveryStatus"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "isActive": {
          "type": "boolean"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "lastDeliveryAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "lastDeliveryStatus": {
          "type": "string"
        }
      }
    },
    "billingDetails": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "ico",
        "dic",
        "street",
        "city",
        "zip",
        "country",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "ico": {
          "$ref": "#/$defs/nullableString"
        },
        "dic": {
          "$ref": "#/$defs/nullableString"
        },
        "street": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "zip": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "subscriptionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "tier",
        "period",
        "status",
        "createdAt",
        "activatedAt",
        "currentPeriodEndsAt",
        "cancelledAt",
        "downgradeScheduledTier",
        "amountCzk",
        "currency",
        "pastDueSinceAt",
        "failedRetryCount",
        "promoCode",
        "initialDiscountCzk"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "tier": {
          "type": "string"
        },
        "period": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "activatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "currentPeriodEndsAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "cancelledAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "downgradeScheduledTier": {
          "$ref": "#/$defs/nullableString"
        },
        "amountCzk": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "pastDueSinceAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "failedRetryCount": {
          "type": "integer"
        },
        "promoCode": {
          "$ref": "#/$defs/nullableString"
        },
        "initialDiscountCzk": {
          "type": "integer"
        }
      }
    },
    "subscriptionChargeItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "subscriptionId",
        "invoiceNumber",
        "amountCzk",
        "currency",
        "status",
        "isTestPayment",
        "chargedAt",
        "createdAt",
        "isInitial",
        "billingDetailsSnapshot",
        "refundedAt",
        "refundedAmountCzk",
        "refundReason",
        "refundOperationId",
        "refundOperationAmountCzk",
        "refundOperationStartedAt",
        "refundOperationReason"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "subscriptionId": {
          "$ref": "#/$defs/uuid"
        },
        "invoiceNumber": {
          "$ref": "#/$defs/nullableString"
        },
        "amountCzk": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "isTestPayment": {
          "type": "boolean"
        },
        "chargedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "isInitial": {
          "type": "boolean"
        },
        "billingDetailsSnapshot": {
          "$ref": "#/$defs/jsonValue"
        },
        "refundedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "refundedAmountCzk": {
          "type": ["integer", "null"]
        },
        "refundReason": {
          "$ref": "#/$defs/nullableString"
        },
        "refundOperationId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "refundOperationAmountCzk": {
          "type": ["integer", "null"]
        },
        "refundOperationStartedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "refundOperationReason": {
          "$ref": "#/$defs/nullableString"
        }
      }
    },
    "refundOperationEventItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "sequence",
        "amountCzk",
        "evidenceReference",
        "adminUserId",
        "occurredAt"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "Pending",
            "ProviderConfirmed",
            "ProviderRejected",
            "ManuallyConfirmed",
            "ManuallyRejected"
          ]
        },
        "sequence": {
          "type": "integer"
        },
        "amountCzk": {
          "type": "integer"
        },
        "evidenceReference": {
          "$ref": "#/$defs/nullableString"
        },
        "adminUserId": {
          "$ref": "#/$defs/uuid"
        },
        "occurredAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "refundOperationItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "refundOperationId",
        "chargeId",
        "requestedAmountCzk",
        "amountCzk",
        "reason",
        "adminUserId",
        "createdAt",
        "events"
      ],
      "properties": {
        "refundOperationId": {
          "$ref": "#/$defs/uuid"
        },
        "chargeId": {
          "$ref": "#/$defs/uuid"
        },
        "requestedAmountCzk": {
          "type": ["integer", "null"]
        },
        "amountCzk": {
          "type": "integer"
        },
        "reason": {
          "$ref": "#/$defs/nullableString"
        },
        "adminUserId": {
          "$ref": "#/$defs/uuid"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/refundOperationEventItem"
          }
        }
      }
    },
    "billingCreditTransactionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "amount", "reason", "balanceAfter", "createdAt"],
      "properties": {
        "type": {
          "type": "string"
        },
        "amount": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        },
        "balanceAfter": {
          "type": "integer"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "billingCredits": {
      "type": "object",
      "additionalProperties": false,
      "required": ["topUpBalance", "transactions"],
      "properties": {
        "topUpBalance": {
          "type": "integer"
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/billingCreditTransactionItem"
          }
        }
      }
    },
    "billing": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "billingDetails",
        "subscriptions",
        "charges",
        "refundOperations",
        "credits"
      ],
      "properties": {
        "billingDetails": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/billingDetails"
            }
          ]
        },
        "subscriptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/subscriptionItem"
          }
        },
        "charges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/subscriptionChargeItem"
          }
        },
        "refundOperations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/refundOperationItem"
          }
        },
        "credits": {
          "$ref": "#/$defs/billingCredits"
        }
      }
    },
    "accountPreferences": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "preferredCurrency",
        "onboardingCompletedSteps",
        "onboardingSkippedAt"
      ],
      "properties": {
        "preferredCurrency": {
          "type": "string"
        },
        "onboardingCompletedSteps": {
          "type": "string"
        },
        "onboardingSkippedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "allowedEmailItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["email", "label", "addedAt", "lastUsedAt"],
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "label": {
          "$ref": "#/$defs/nullableString"
        },
        "addedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "lastUsedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "pendingEmailChangeItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["newEmail", "issuedAt", "expiresAt"],
      "properties": {
        "newEmail": {
          "type": "string",
          "format": "email"
        },
        "issuedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "expiresAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "tableSettingItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["tableKey", "settings", "updatedAt"],
      "properties": {
        "tableKey": {
          "type": "string"
        },
        "settings": {
          "$ref": "#/$defs/jsonValue"
        },
        "updatedAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "accountSettings": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "preferences",
        "marketingAttribution",
        "allowedEmails",
        "pendingEmailChanges",
        "tableSettings",
        "savedPortfolioViews",
        "savedCompanyDiscoveryQueries"
      ],
      "properties": {
        "preferences": {
          "$ref": "#/$defs/accountPreferences"
        },
        "marketingAttribution": {
          "oneOf": [
            { "type": "null" },
            { "$ref": "#/$defs/marketingAttribution" }
          ]
        },
        "allowedEmails": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/allowedEmailItem"
          }
        },
        "pendingEmailChanges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/pendingEmailChangeItem"
          }
        },
        "tableSettings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/tableSettingItem"
          }
        },
        "savedPortfolioViews": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/savedPortfolioViewItem"
          }
        },
        "savedCompanyDiscoveryQueries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/savedCompanyDiscoveryQueryItem"
          }
        }
      }
    },
    "marketingAttribution": {
      "type": "object",
      "additionalProperties": false,
      "required": ["source", "medium", "campaign", "content", "term", "capturedAt"],
      "properties": {
        "source": { "$ref": "#/$defs/nullableString" },
        "medium": { "$ref": "#/$defs/nullableString" },
        "campaign": { "$ref": "#/$defs/nullableString" },
        "content": { "$ref": "#/$defs/nullableString" },
        "term": { "$ref": "#/$defs/nullableString" },
        "capturedAt": { "$ref": "#/$defs/dateTime" }
      }
    },
    "savedPortfolioViewItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "definition",
        "schemaVersion",
        "isDefault",
        "visibility",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": { "$ref": "#/$defs/uuid" },
        "name": { "type": "string" },
        "definition": { "$ref": "#/$defs/jsonValue" },
        "schemaVersion": { "type": "integer" },
        "isDefault": { "type": "boolean" },
        "visibility": { "type": "string" },
        "createdAt": { "$ref": "#/$defs/dateTime" },
        "updatedAt": { "$ref": "#/$defs/dateTime" }
      }
    },
    "savedCompanyDiscoveryQueryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "definition",
        "schemaVersion",
        "isDefault",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": { "$ref": "#/$defs/uuid" },
        "name": { "type": "string" },
        "definition": { "$ref": "#/$defs/jsonValue" },
        "schemaVersion": { "type": "integer" },
        "isDefault": { "type": "boolean" },
        "createdAt": { "$ref": "#/$defs/dateTime" },
        "updatedAt": { "$ref": "#/$defs/dateTime" }
      }
    },
    "jobNotificationItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "pending",
        "attemptCount",
        "nextAttemptAt",
        "completedAt",
        "deadLetteredAt",
        "failureCode",
        "emailPayload"
      ],
      "properties": {
        "pending": { "type": "boolean" },
        "attemptCount": { "type": "integer" },
        "nextAttemptAt": { "$ref": "#/$defs/nullableDateTime" },
        "completedAt": { "$ref": "#/$defs/nullableDateTime" },
        "deadLetteredAt": { "$ref": "#/$defs/nullableDateTime" },
        "failureCode": { "$ref": "#/$defs/nullableString" },
        "emailPayload": { "$ref": "#/$defs/jsonValue" }
      }
    },
    "importJobItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "status",
        "totalRows",
        "processedRows",
        "addedRows",
        "skippedRows",
        "failedRows",
        "originalFileName",
        "icos",
        "tagIds",
        "errors",
        "createdAt",
        "completedAt",
        "notification"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "status": {
          "type": "string"
        },
        "totalRows": {
          "type": "integer"
        },
        "processedRows": {
          "type": "integer"
        },
        "addedRows": {
          "type": "integer"
        },
        "skippedRows": {
          "type": "integer"
        },
        "failedRows": {
          "type": "integer"
        },
        "originalFileName": {
          "$ref": "#/$defs/nullableString"
        },
        "icos": {
          "$ref": "#/$defs/jsonValue"
        },
        "tagIds": {
          "$ref": "#/$defs/jsonValue"
        },
        "errors": {
          "$ref": "#/$defs/jsonValue"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "completedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "notification": {
          "$ref": "#/$defs/jobNotificationItem"
        }
      }
    },
    "bulkVerificationJobItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "status",
        "totalRows",
        "processedRows",
        "safeRows",
        "warningRows",
        "dangerousRows",
        "notVatPayerRows",
        "failedRows",
        "originalFileName",
        "payload",
        "errors",
        "createdAt",
        "completedAt",
        "notification"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "status": {
          "type": "string"
        },
        "totalRows": {
          "type": "integer"
        },
        "processedRows": {
          "type": "integer"
        },
        "safeRows": {
          "type": "integer"
        },
        "warningRows": {
          "type": "integer"
        },
        "dangerousRows": {
          "type": "integer"
        },
        "notVatPayerRows": {
          "type": "integer"
        },
        "failedRows": {
          "type": "integer"
        },
        "originalFileName": {
          "$ref": "#/$defs/nullableString"
        },
        "payload": {
          "$ref": "#/$defs/jsonValue"
        },
        "errors": {
          "$ref": "#/$defs/jsonValue"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "completedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "notification": {
          "$ref": "#/$defs/jobNotificationItem"
        }
      }
    },
    "bankAccountVerificationItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "ico",
        "bankAccount",
        "isPublished",
        "isUnreliablePayer",
        "verifiedAt",
        "bulkVerifyJobId"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "ico": {
          "type": "string"
        },
        "bankAccount": {
          "type": "string"
        },
        "isPublished": {
          "type": "boolean"
        },
        "isUnreliablePayer": {
          "type": "boolean"
        },
        "verifiedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "bulkVerifyJobId": {
          "$ref": "#/$defs/nullableUuid"
        }
      }
    },
    "counterpartyImportDraftItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "originalFileName",
        "parsedPayload",
        "mapping",
        "preview",
        "sourceChannel",
        "createdAt",
        "expiresAt",
        "appliedAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "originalFileName": {
          "type": "string"
        },
        "parsedPayload": {
          "$ref": "#/$defs/jsonValue"
        },
        "mapping": {
          "$ref": "#/$defs/jsonValue"
        },
        "preview": {
          "$ref": "#/$defs/jsonValue"
        },
        "sourceChannel": {
          "type": "string",
          "enum": ["ManualUi", "SpreadsheetImport", "RestApi", "Mcp", "AiChat"]
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "expiresAt": {
          "$ref": "#/$defs/dateTime"
        },
        "appliedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "importsAndVerifications": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "counterpartyImportDrafts",
        "importJobs",
        "bulkVerificationJobs",
        "bankAccountVerifications"
      ],
      "properties": {
        "counterpartyImportDrafts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/counterpartyImportDraftItem"
          }
        },
        "importJobs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/importJobItem"
          }
        },
        "bulkVerificationJobs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/bulkVerificationJobItem"
          }
        },
        "bankAccountVerifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/bankAccountVerificationItem"
          }
        }
      }
    },
    "scheduledExportItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "format",
        "cadence",
        "isActive",
        "createdAt",
        "lastRunAt",
        "nextRunAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "format": {
          "type": "string"
        },
        "cadence": {
          "type": "string"
        },
        "isActive": {
          "type": "boolean"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "lastRunAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "nextRunAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "aiUsageItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "modelUsed",
        "inputTokens",
        "outputTokens",
        "cachedInputTokens",
        "chargedCentis",
        "createdAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "modelUsed": {
          "type": "string"
        },
        "inputTokens": {
          "type": "integer"
        },
        "outputTokens": {
          "type": "integer"
        },
        "cachedInputTokens": {
          "type": ["integer", "null"]
        },
        "chargedCentis": {
          "type": "integer"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "chatRunLogItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "conversationId",
        "kind",
        "usedLlm",
        "modelUsed",
        "rounds",
        "toolCallCount",
        "durationMs",
        "status",
        "hallucinationFlagged",
        "trajectory",
        "questionPreview",
        "answerPreview",
        "createdAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "conversationId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "kind": {
          "type": "string"
        },
        "usedLlm": {
          "type": "boolean"
        },
        "modelUsed": {
          "$ref": "#/$defs/nullableString"
        },
        "rounds": {
          "type": "integer"
        },
        "toolCallCount": {
          "type": "integer"
        },
        "durationMs": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "hallucinationFlagged": {
          "type": "boolean"
        },
        "trajectory": {
          "$ref": "#/$defs/jsonValue"
        },
        "questionPreview": {
          "type": "string"
        },
        "answerPreview": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "chatCreditReservationItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "reservedCentis",
        "reservedMonthlyCentis",
        "reservedTopUpCentis",
        "reservedAt",
        "expiresAt",
        "finalizedAt",
        "cancelledAt",
        "finalChargedCentis"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "reservedCentis": {
          "type": "integer"
        },
        "reservedMonthlyCentis": {
          "type": "integer"
        },
        "reservedTopUpCentis": {
          "type": "integer"
        },
        "reservedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "expiresAt": {
          "$ref": "#/$defs/dateTime"
        },
        "finalizedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "cancelledAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "finalChargedCentis": {
          "type": ["integer", "null"]
        }
      }
    },
    "chatFeedbackItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "conversationId",
        "answerId",
        "rating",
        "comment",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "conversationId": {
          "$ref": "#/$defs/uuid"
        },
        "answerId": {
          "$ref": "#/$defs/uuid"
        },
        "rating": {
          "type": "string"
        },
        "comment": {
          "$ref": "#/$defs/nullableString"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "aiActivity": {
      "type": "object",
      "additionalProperties": false,
      "required": ["usage", "creditReservations", "runLogs", "feedback"],
      "properties": {
        "usage": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/aiUsageItem"
          }
        },
        "creditReservations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/chatCreditReservationItem"
          }
        },
        "runLogs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/chatRunLogItem"
          }
        },
        "feedback": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/chatFeedbackItem"
          }
        }
      }
    },
    "mcpUsageItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "apiKeyId",
        "toolName",
        "yearMonth",
        "callCount",
        "lastCalledAt"
      ],
      "properties": {
        "apiKeyId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "toolName": {
          "type": "string"
        },
        "yearMonth": {
          "type": "integer"
        },
        "callCount": {
          "type": "integer"
        },
        "lastCalledAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "webhookDeliveryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "webhookId",
        "webhookName",
        "attemptedAt",
        "success",
        "httpStatusCode",
        "attemptNumber",
        "error",
        "durationMs"
      ],
      "properties": {
        "webhookId": {
          "$ref": "#/$defs/uuid"
        },
        "webhookName": {
          "type": "string"
        },
        "attemptedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "success": {
          "type": "boolean"
        },
        "httpStatusCode": {
          "type": ["integer", "null"]
        },
        "attemptNumber": {
          "type": "integer"
        },
        "error": {
          "$ref": "#/$defs/nullableString"
        },
        "durationMs": {
          "type": "integer"
        }
      }
    },
    "notificationDigestDeliveryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "frequency",
        "periodStart",
        "periodEnd",
        "recipientEmail",
        "subject",
        "htmlBody",
        "textBody",
        "idempotencyKey",
        "createdAt",
        "attemptCount",
        "lastAttemptAt",
        "sentAt",
        "canceledAt",
        "cancellationReason",
        "providerMessageId",
        "lastError"
      ],
      "properties": {
        "id": { "$ref": "#/$defs/uuid" },
        "frequency": { "enum": ["Weekly", "Monthly"] },
        "periodStart": { "$ref": "#/$defs/dateTime" },
        "periodEnd": { "$ref": "#/$defs/dateTime" },
        "recipientEmail": { "type": "string" },
        "subject": { "type": "string" },
        "htmlBody": { "type": "string" },
        "textBody": { "$ref": "#/$defs/nullableString" },
        "idempotencyKey": { "type": "string" },
        "createdAt": { "$ref": "#/$defs/dateTime" },
        "attemptCount": { "type": "integer", "minimum": 0 },
        "lastAttemptAt": { "$ref": "#/$defs/nullableDateTime" },
        "sentAt": { "$ref": "#/$defs/nullableDateTime" },
        "canceledAt": { "$ref": "#/$defs/nullableDateTime" },
        "cancellationReason": { "$ref": "#/$defs/nullableString" },
        "providerMessageId": { "$ref": "#/$defs/nullableString" },
        "lastError": { "$ref": "#/$defs/nullableString" }
      }
    },
    "portableTransactionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "amount",
        "reason",
        "relatedEntityId",
        "balanceAfter",
        "createdAt"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "amount": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        },
        "relatedEntityId": {
          "$ref": "#/$defs/nullableUuid"
        },
        "balanceAfter": {
          "type": "integer"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "aiCreditSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "topUpBalance",
        "topUpCentisPending",
        "lastUpdatedAt",
        "transactions"
      ],
      "properties": {
        "topUpBalance": {
          "type": "integer"
        },
        "topUpCentisPending": {
          "type": "integer"
        },
        "lastUpdatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/portableTransactionItem"
          }
        }
      }
    },
    "ceeCheckSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": ["checksRemaining", "lastUpdatedAt", "transactions"],
      "properties": {
        "checksRemaining": {
          "type": "integer"
        },
        "lastUpdatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/portableTransactionItem"
          }
        }
      }
    },
    "creditTopUpItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "productType",
        "packageSize",
        "amountPaidCzk",
        "status",
        "isTestPayment",
        "createdAt",
        "paidAt",
        "expiresAt",
        "remainingCentis",
        "invoiceNumber",
        "billingDetailsSnapshot"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "productType": {
          "type": "string"
        },
        "packageSize": {
          "type": "integer"
        },
        "amountPaidCzk": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "isTestPayment": {
          "type": "boolean"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "paidAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "expiresAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "remainingCentis": {
          "type": "integer"
        },
        "invoiceNumber": {
          "$ref": "#/$defs/nullableString"
        },
        "billingDetailsSnapshot": {
          "$ref": "#/$defs/jsonValue"
        }
      }
    },
    "promoRedemptionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["code", "percentOff", "subscriptionId", "createdAt"],
      "properties": {
        "code": {
          "type": "string"
        },
        "percentOff": {
          "type": "integer"
        },
        "subscriptionId": {
          "$ref": "#/$defs/uuid"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "creditsAndPurchases": {
      "type": "object",
      "additionalProperties": false,
      "required": ["aiCredits", "ceeChecks", "topUps", "promoRedemptions"],
      "properties": {
        "aiCredits": {
          "$ref": "#/$defs/aiCreditSummary"
        },
        "ceeChecks": {
          "$ref": "#/$defs/ceeCheckSummary",
          "description": "Purchased/consumed CEE check balance and transactions only. Fetched execution-report results and the global CompanyExekuceCache are not part of the account export."
        },
        "topUps": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/creditTopUpItem"
          }
        },
        "promoRedemptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/promoRedemptionItem"
          }
        }
      }
    },
    "sanctionsDismissalItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sanctionMatchId",
        "ico",
        "matchedName",
        "matchKind",
        "confidence",
        "detectedAt",
        "dismissedAt",
        "reason"
      ],
      "properties": {
        "sanctionMatchId": {
          "$ref": "#/$defs/uuid"
        },
        "ico": {
          "type": "string"
        },
        "matchedName": {
          "type": "string"
        },
        "matchKind": {
          "type": "string"
        },
        "confidence": {
          "type": "number"
        },
        "detectedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "dismissedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "reason": {
          "$ref": "#/$defs/nullableString"
        }
      }
    },
    "paywallEventItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["tier", "gate", "detail", "createdAt"],
      "properties": {
        "tier": {
          "type": "string"
        },
        "gate": {
          "type": "string"
        },
        "detail": {
          "$ref": "#/$defs/nullableString"
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "newsletterSubscriptionItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "email",
        "status",
        "subscribedAt",
        "confirmedAt",
        "unsubscribedAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "status": {
          "type": "string",
          "enum": ["pending", "confirmed", "unsubscribed"]
        },
        "subscribedAt": {
          "$ref": "#/$defs/dateTime"
        },
        "confirmedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "unsubscribedAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "guestTaxDocumentDeliveryEventItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["eventType", "source", "occurredAt", "recordedAt"],
      "properties": {
        "eventType": {
          "type": "string",
          "enum": ["Delivered", "Bounced", "Failed", "AlternativeDelivered"]
        },
        "source": {
          "type": "string",
          "enum": ["AdminReconciliation", "ProviderWebhook"]
        },
        "occurredAt": {
          "$ref": "#/$defs/dateTime"
        },
        "recordedAt": {
          "$ref": "#/$defs/dateTime"
        }
      }
    },
    "guestReportOrderItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "ico",
        "companyName",
        "email",
        "amountCzk",
        "includeExekuce",
        "includeKatastr",
        "status",
        "isTestPayment",
        "invoiceNumber",
        "downloadAvailableUntil",
        "financialsPending",
        "financialsUpdatedAt",
        "professionalPurposeConfirmedAt",
        "termsVersion",
        "termsAcceptedAt",
        "privacyNoticeVersion",
        "privacyNoticeAcknowledgedAt",
        "taxDocumentSubmittedAt",
        "taxDocumentDeliveryConfirmedAt",
        "taxDocumentDeliveryEvents",
        "createdAt",
        "paidAt",
        "readyAt"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "ico": {
          "type": "string"
        },
        "companyName": {
          "$ref": "#/$defs/nullableString"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "amountCzk": {
          "type": "integer"
        },
        "includeExekuce": {
          "type": "boolean"
        },
        "includeKatastr": {
          "type": "boolean"
        },
        "status": {
          "type": "string"
        },
        "isTestPayment": {
          "type": "boolean"
        },
        "invoiceNumber": {
          "$ref": "#/$defs/nullableString"
        },
        "downloadAvailableUntil": {
          "$ref": "#/$defs/dateTime"
        },
        "financialsPending": {
          "type": "boolean"
        },
        "financialsUpdatedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "professionalPurposeConfirmedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "termsVersion": {
          "$ref": "#/$defs/nullableString"
        },
        "termsAcceptedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "privacyNoticeVersion": {
          "$ref": "#/$defs/nullableString"
        },
        "privacyNoticeAcknowledgedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "taxDocumentSubmittedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "taxDocumentDeliveryConfirmedAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "taxDocumentDeliveryEvents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/guestTaxDocumentDeliveryEventItem"
          }
        },
        "createdAt": {
          "$ref": "#/$defs/dateTime"
        },
        "paidAt": {
          "$ref": "#/$defs/nullableDateTime"
        },
        "readyAt": {
          "$ref": "#/$defs/nullableDateTime"
        }
      }
    },
    "investigationsAndWorkspace": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "investigations",
        "batchDueDiligenceJobs",
        "accountingIntegrations",
        "companyWidgets",
        "companyWorkspace",
        "preferences"
      ],
      "properties": {
        "investigations": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id", "name", "depth", "asOfDate", "layers", "viewport",
              "version", "createdAt", "updatedAt", "roots", "shares"
            ],
            "properties": {
              "id": { "$ref": "#/$defs/uuid" },
              "name": { "type": "string" },
              "depth": { "type": "integer", "minimum": 1, "maximum": 3 },
              "asOfDate": { "type": ["string", "null"], "format": "date" },
              "layers": {},
              "viewport": {},
              "version": { "type": "integer", "minimum": 1 },
              "createdAt": { "$ref": "#/$defs/dateTime" },
              "updatedAt": { "$ref": "#/$defs/dateTime" },
              "roots": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["kind", "ico", "personName", "birthDate", "sortOrder"],
                  "properties": {
                    "kind": { "type": "string" },
                    "ico": { "$ref": "#/$defs/nullableString" },
                    "personName": { "$ref": "#/$defs/nullableString" },
                    "birthDate": { "type": ["string", "null"], "format": "date" },
                    "sortOrder": { "type": "integer", "minimum": 0 }
                  }
                }
              },
              "shares": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["includeNotes", "isPasscodeProtected", "createdAt", "expiresAt", "revokedAt"],
                  "properties": {
                    "includeNotes": { "type": "boolean" },
                    "isPasscodeProtected": { "type": "boolean" },
                    "createdAt": { "$ref": "#/$defs/dateTime" },
                    "expiresAt": { "$ref": "#/$defs/dateTime" },
                    "revokedAt": { "$ref": "#/$defs/nullableDateTime" }
                  }
                }
              }
            }
          }
        },
        "batchDueDiligenceJobs": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id", "name", "status", "totalRows", "invalidRows", "processedRows",
              "criticalRows", "warningRows", "unknownRows", "payload", "results",
              "createdAt", "startedAt", "completedAt", "failureReason"
            ],
            "properties": {
              "id": { "$ref": "#/$defs/uuid" },
              "name": { "type": "string" },
              "status": { "type": "string" },
              "totalRows": { "type": "integer", "minimum": 1 },
              "invalidRows": { "type": "integer", "minimum": 0 },
              "processedRows": { "type": "integer", "minimum": 0 },
              "criticalRows": { "type": "integer", "minimum": 0 },
              "warningRows": { "type": "integer", "minimum": 0 },
              "unknownRows": { "type": "integer", "minimum": 0 },
              "payload": {},
              "results": {},
              "createdAt": { "$ref": "#/$defs/dateTime" },
              "startedAt": { "$ref": "#/$defs/nullableDateTime" },
              "completedAt": { "$ref": "#/$defs/nullableDateTime" },
              "failureReason": { "$ref": "#/$defs/nullableString" }
            }
          }
        },
        "accountingIntegrations": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "provider", "status", "externalAccountId", "grantedScopes",
              "accessTokenExpiresAt", "connectedAt", "lastSyncAt", "lastContactCount", "updatedAt"
            ],
            "properties": {
              "provider": { "type": "string" },
              "status": { "type": "string" },
              "externalAccountId": { "$ref": "#/$defs/nullableString" },
              "grantedScopes": { "$ref": "#/$defs/nullableString" },
              "accessTokenExpiresAt": { "$ref": "#/$defs/nullableDateTime" },
              "connectedAt": { "$ref": "#/$defs/nullableDateTime" },
              "lastSyncAt": { "$ref": "#/$defs/nullableDateTime" },
              "lastContactCount": { "type": "integer", "minimum": 0 },
              "updatedAt": { "$ref": "#/$defs/dateTime" }
            }
          }
        },
        "companyWidgets": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id", "ico", "allowedOrigins", "theme", "layout", "createdAt", "revokedAt"],
            "properties": {
              "id": { "$ref": "#/$defs/uuid" },
              "ico": { "type": "string" },
              "allowedOrigins": { "type": "array", "items": { "type": "string" } },
              "theme": { "type": "string" },
              "layout": { "type": "string" },
              "createdAt": { "$ref": "#/$defs/dateTime" },
              "revokedAt": { "$ref": "#/$defs/nullableDateTime" }
            }
          }
        },
        "companyWorkspace": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id", "ico", "note", "version", "isFavorite", "lastViewedAt",
              "createdAt", "updatedAt", "noteRevisions"
            ],
            "properties": {
              "id": { "$ref": "#/$defs/uuid" },
              "ico": { "type": "string" },
              "note": { "type": "string" },
              "version": { "type": "integer", "minimum": 0 },
              "isFavorite": { "type": "boolean" },
              "lastViewedAt": { "$ref": "#/$defs/nullableDateTime" },
              "createdAt": { "$ref": "#/$defs/dateTime" },
              "updatedAt": { "$ref": "#/$defs/dateTime" },
              "noteRevisions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["version", "note", "savedAt"],
                  "properties": {
                    "version": { "type": "integer", "minimum": 1 },
                    "note": { "type": "string" },
                    "savedAt": { "$ref": "#/$defs/dateTime" }
                  }
                }
              }
            }
          }
        },
        "preferences": {
          "type": "object",
          "additionalProperties": false,
          "required": ["recentCompaniesEnabled", "updatedAt"],
          "properties": {
            "recentCompaniesEnabled": { "type": "boolean" },
            "updatedAt": { "$ref": "#/$defs/nullableDateTime" }
          }
        }
      }
    },
    "emailAndGuestOrders": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "matchedVerifiedEmail",
        "newsletterSubscriptions",
        "guestReportOrders"
      ],
      "properties": {
        "matchedVerifiedEmail": {
          "type": ["string", "null"],
          "format": "email"
        },
        "newsletterSubscriptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/newsletterSubscriptionItem"
          }
        },
        "guestReportOrders": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/guestReportOrderItem"
          }
        }
      }
    }
  }
}
