{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "product_grid",
  "description": "Ürün ızgarası; `layout:\"carousel\"` ise yatay karusel (hizmet kartı: `meta` süre, `cta_label` düğme).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "version",
    "items"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "product_grid"
      ]
    },
    "version": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "tone": {
      "type": "string",
      "enum": [
        "neutral",
        "success",
        "warning",
        "danger",
        "brand"
      ]
    },
    "brand_color": {
      "type": "string",
      "enum": [
        "mavi",
        "turuncu",
        "mor",
        "pembe",
        "altin",
        "yesil",
        "turkuaz"
      ]
    },
    "layout": {
      "type": "string",
      "enum": [
        "grid",
        "carousel"
      ]
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 30,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
            "description": "seçenek/öğe değeri; istemci bunu `inki_component_action.values` içinde geri gönderir"
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1
          },
          "price": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "amount": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              },
              "currency": {
                "type": "string",
                "enum": [
                  "TRY",
                  "INK",
                  "USD",
                  "EUR"
                ]
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "description": "tutar; biçimlendirmeyi (₺, ondalık ayracı) istemci yapar"
          },
          "subtitle": {
            "type": "string",
            "maxLength": 120
          },
          "meta": {
            "type": "string",
            "maxLength": 40
          },
          "image": {
            "type": "string",
            "pattern": "^(https://[^\\s\\x00-\\x1f\\x7f]{1,2040}|[A-Za-z0-9_.:-]{8,256})$",
            "x-inki-medya": "photo",
            "description": "Telegram sözleşmesi: file_id ya da https URL (sunucu egress ile indirip yeniden barındırır)"
          },
          "brand_color": {
            "type": "string",
            "enum": [
              "mavi",
              "turuncu",
              "mor",
              "pembe",
              "altin",
              "yesil",
              "turkuaz"
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99,
            "description": "sepetteki adet"
          },
          "badge": {
            "type": "string",
            "maxLength": 30
          },
          "unavailable": {
            "type": "boolean"
          },
          "cta_label": {
            "type": "string",
            "maxLength": 30
          }
        },
        "required": [
          "value",
          "name"
        ]
      }
    }
  },
  "x-inki-eylem": [
    {
      "action": "select",
      "values": {
        "value": "items[].value"
      }
    }
  ]
}
