{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cervejabarata-com-br/json-schema/cervejabarata-com-br-deals-response-schema.json",
  "title": "DealsResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cervejabarata-com-br-openapi.json#/components/schemas/DealsResponse",
  "type": "object",
  "properties": {
    "city": {
      "type": "string"
    },
    "city_url": {
      "type": "string"
    },
    "as_of": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "deals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PublicDeal"
      },
      "description": "Bars' prices, cheapest per litre first; with `category`, only that kind. `count` is its length"
    },
    "source": {
      "type": "string",
      "description": "Attribution: Cerveja Barata (cervejabarata.com.br), ODbL"
    },
    "shops": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PublicDeal"
      },
      "description": "Supermarkets' and depósitos' prices, to take away, cheapest per litre first, at most 5, never mixed with `deals`; absent when `category` is given"
    },
    "local_time": {
      "type": "string",
      "description": "The city's time (cheapest only)"
    }
  },
  "required": [
    "city",
    "city_url",
    "as_of",
    "count",
    "deals",
    "source"
  ],
  "$defs": {
    "PublicDeal": {
      "type": "object",
      "properties": {
        "venue": {
          "type": "string"
        },
        "neighbourhood": {
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "type": "string",
          "description": "The place's page on cervejabarata.com.br, to link when you quote the price"
        },
        "category": {
          "type": "string",
          "enum": [
            "bar",
            "mercado",
            "deposito"
          ],
          "description": "The price's category: bar (to drink there), mercado (supermarket or corner shop) or deposito (drinks shop), the last two to take away"
        },
        "drink_on_site": {
          "type": "boolean",
          "description": "True for a price to drink there (a bar's), false for one to take away (a shop's)"
        },
        "beer": {
          "type": "string"
        },
        "brand": {
          "type": [
            "string",
            "null"
          ]
        },
        "serving": {
          "type": "string",
          "description": "e.g. \"Garrafa 600 ml\" or \"Balde: 5 × Long neck 330 ml\""
        },
        "format": {
          "type": "string"
        },
        "price_brl": {
          "type": "number"
        },
        "price_per_litre_brl": {
          "type": "number",
          "description": "Absent for open bars"
        },
        "open_bar_minutes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "price_label": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "regular",
            "happy_hour",
            "promo",
            "combo",
            "open_bar"
          ]
        },
        "when": {
          "type": [
            "string",
            "null"
          ],
          "description": "Happy hours and timed promos, e.g. \"seg–sex 17h–20h\""
        },
        "service_charge_pct": {
          "type": [
            "integer",
            "null"
          ]
        },
        "couvert_brl": {
          "type": [
            "number",
            "null"
          ]
        },
        "conditions": {
          "type": [
            "string",
            "null"
          ]
        },
        "verified_on": {
          "type": "string",
          "description": "City-local date of the last check"
        },
        "possibly_out_of_date": {
          "type": "boolean",
          "description": "True when last checked more than 90 days ago. Bars' prices leave the lists after 180 days and shops' after 14, so it is always false for a shop"
        },
        "confirmations": {
          "type": "integer"
        },
        "distance_m": {
          "type": "integer",
          "description": "Only from /cheapest with lat and lng"
        }
      },
      "required": [
        "venue",
        "neighbourhood",
        "url",
        "category",
        "drink_on_site",
        "beer",
        "brand",
        "serving",
        "format",
        "price_brl",
        "price_label",
        "kind",
        "when",
        "service_charge_pct",
        "couvert_brl",
        "conditions",
        "verified_on",
        "possibly_out_of_date",
        "confirmations"
      ]
    }
  }
}