{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/feedback1-ai/json-schema/feedback1-ai-deal-response-schema.json",
  "title": "DealResponse",
  "description": "Deal response for Public API",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/feedback1-ai-deals-api-openapi.yml#/components/schemas/DealResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Value"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency"
    },
    "stage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stage"
    },
    "probability": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Probability"
    },
    "expected_close_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Close Date"
    },
    "lost_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lost Reason"
    },
    "account_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Account Id"
    },
    "account": {
      "anyOf": [
        {
          "$ref": "#/$defs/DealAccountInfo"
        },
        {
          "type": "null"
        }
      ]
    },
    "contact_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Contact Id"
    },
    "contact": {
      "anyOf": [
        {
          "$ref": "#/$defs/DealContactInfo"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "DealAccountInfo": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "DealAccountInfo",
      "description": "Account info in deal response"
    },
    "DealContactInfo": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "DealContactInfo",
      "description": "Contact info in deal response"
    }
  }
}