{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hilling.app/catalog.schema.json",
  "title": "Hilling public catalog v1",
  "type": "object",
  "required": [
    "schemaVersion",
    "revision",
    "updatedAt",
    "source",
    "freshnessSeconds",
    "stage",
    "moneyDueToday",
    "shipping",
    "maxCasesPerReservation",
    "limitations",
    "variants"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "revision": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string",
      "format": "date"
    },
    "source": {
      "const": "https://hilling.app/product-guide"
    },
    "freshnessSeconds": {
      "const": 300
    },
    "stage": {
      "const": "launch_reservations"
    },
    "moneyDueToday": {
      "type": "object",
      "required": [
        "amountMinor",
        "currency",
        "precision"
      ],
      "properties": {
        "amountMinor": {
          "type": "integer",
          "minimum": 0
        },
        "currency": {
          "const": "USD"
        },
        "precision": {
          "const": 2
        },
        "final": {
          "const": false
        },
        "shippingIncluded": {
          "const": false
        }
      },
      "additionalProperties": false
    },
    "shipping": {
      "type": "object",
      "required": [
        "region",
        "date",
        "cost"
      ],
      "additionalProperties": false,
      "properties": {
        "region": {
          "const": "US-CA"
        },
        "date": {
          "type": "null"
        },
        "cost": {
          "type": "null"
        }
      }
    },
    "maxCasesPerReservation": {
      "const": 4
    },
    "limitations": {
      "type": "object",
      "required": [
        "nutritionPanel",
        "allergenCrossContact",
        "shelfLifeDays",
        "labReport"
      ],
      "additionalProperties": {
        "type": "null"
      }
    },
    "variants": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6,
      "items": {
        "type": "object",
        "required": [
          "id",
          "sku",
          "name",
          "url",
          "availability",
          "recipeStatus",
          "ingredients",
          "bottleVolume",
          "bottlesPerCase",
          "packaging",
          "estimatedCasePrice"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "sku": {
            "const": "hilling-case-12"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "availability": {
            "const": "reservation_only"
          },
          "recipeStatus": {
            "enum": [
              "original_recipe",
              "development_recipe"
            ]
          },
          "ingredients": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "bottleVolume": {
            "type": "object",
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": false,
            "properties": {
              "value": {
                "const": 3
              },
              "unit": {
                "const": "US_fl_oz"
              }
            }
          },
          "bottlesPerCase": {
            "const": 12
          },
          "packaging": {
            "const": "glass"
          },
          "estimatedCasePrice": {
            "type": "object",
            "required": [
              "amountMinor",
              "currency",
              "precision"
            ],
            "properties": {
              "amountMinor": {
                "type": "integer",
                "minimum": 0
              },
              "currency": {
                "const": "USD"
              },
              "precision": {
                "const": 2
              },
              "final": {
                "const": false
              },
              "shippingIncluded": {
                "const": false
              }
            },
            "additionalProperties": false
          }
        }
      }
    }
  },
  "additionalProperties": false
}
