{
  "$comment": "VORSCHAU – halbe Fassung. Musterarbeit von GL Tools. Das ist die halbe Fassung. Das ganze Produkt bekommst du nach Bezahlung – oder angepasst an deinen Betrieb als Auftrag. https://www.gltools.de/beispiele/shop-fuer-ki-assistenten-demo/",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shop.example.de/feeds/agent_feed.schema.json",
  "title": "Agent Product Feed 1.0",
  "description": "Maschinenlesbarer Produktkatalog fuer KI-Einkaufsassistenten. Eigenes Format dieses Shops; Preise brutto als Dezimalstring, Verfuegbarkeit zum Erzeugungszeitpunkt, Live-Stand ueber availability_endpoint. Der Kauf wird immer im Shop-Checkout abgeschlossen (checkout.url).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "shop",
    "products"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0",
      "description": "Version dieses Schemas"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Erzeugungszeitpunkt (UTC, ISO 8601)"
    },
    "shop": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "url",
        "currency",
        "checkout_policy"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "pattern": "^https://"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "Standardwaehrung, ISO 4217"
        },
        "checkout_policy": {
          "type": "string",
          "description": "Wie ein Agent den Kauf ausloest (Text)"
        }
      }
    },
    "products": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/product"
      }
    }
  },
  "$defs": {
    "money": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{2}$",
          "description": "Bruttobetrag mit genau zwei Nachkommastellen als String - keine Gleitkommazahl, damit kein Agent Rundungsfehler einbaut"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "ISO 4217"
        }
      }
    }
  }
}
