{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commsharbor/json-schema/commsharbor-deal-schema.json",
  "title": "Deal",
  "description": "An opportunity moving through a pipeline. Money is stored in minor units to avoid float rounding.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commsharbor-organizations-api-openapi.yml#/components/schemas/Deal",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Deal ID."
    },
    "title": {
      "type": "string",
      "description": "What the deal is."
    },
    "pipeline_id": {
      "type": "string",
      "description": "Pipeline the deal lives in."
    },
    "stage_id": {
      "type": "string",
      "description": "Current stage."
    },
    "status": {
      "type": "string",
      "description": "Where it stands."
    },
    "value_minor": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Value in the currency's minor unit — cents, not dollars."
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 4217 code for `value_minor`."
    },
    "contact_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Main contact on the deal."
    },
    "company_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Company on the deal."
    },
    "created_at": {
      "type": "string",
      "description": "Creation time (UTC)."
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "Last change (UTC)."
    },
    "url": {
      "type": "string",
      "description": "Absolute URL of this deal."
    }
  },
  "required": [
    "id",
    "title",
    "pipeline_id",
    "stage_id",
    "status",
    "value_minor",
    "currency",
    "contact_id",
    "company_id",
    "created_at",
    "updated_at",
    "url"
  ]
}