{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CrmEntitySchemaUploadRequest",
  "title": "CrmEntitySchemaUploadRequest",
  "type": "object",
  "required": [
    "integrationId",
    "objectType",
    "fields"
  ],
  "properties": {
    "integrationId": {
      "type": "string",
      "description": "The CRM integration ID."
    },
    "objectType": {
      "type": "string",
      "description": "The CRM object type (e.g., Deal, Account, Contact)."
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uniqueName": {
            "type": "string",
            "description": "Unique field name/key."
          },
          "label": {
            "type": "string",
            "description": "Display label for the field."
          },
          "type": {
            "type": "string",
            "enum": [
              "STRING",
              "NUMBER",
              "DATE",
              "DATETIME",
              "BOOLEAN",
              "REFERENCE",
              "CURRENCY",
              "PICKLIST"
            ],
            "description": "Data type of the field."
          },
          "isRequired": {
            "type": "boolean",
            "description": "Whether the field is required."
          },
          "referenceObjectType": {
            "type": "string",
            "description": "For REFERENCE type fields, the object type being referenced."
          }
        },
        "required": [
          "uniqueName",
          "label",
          "type"
        ]
      },
      "description": "List of field definitions for the CRM object schema."
    }
  }
}