Skip to content

Instantly share code, notes, and snippets.

@kkajero
Created October 13, 2021 23:27
Show Gist options
  • Save kkajero/86df7b21efb468f59109657cc96ebd25 to your computer and use it in GitHub Desktop.
Save kkajero/86df7b21efb468f59109657cc96ebd25 to your computer and use it in GitHub Desktop.
Meun schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Availability": {
"properties": {
"friday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"monday": {
"description": "Availability time strings must be in the format \"09:00 - 17:30\"",
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"saturday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"sunday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"thursday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"tuesday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
},
"wednesday": {
"items": { "type": "string" },
"type": ["array", "null"],
"minItems": 1
}
},
"type": "object",
"required": []
},
"BaselineMenu": {
"properties": {
"availability": { "$ref": "#/definitions/Availability" },
"categories": {
"items": { "$ref": "#/definitions/MenuCategory" },
"type": "array"
},
"name": { "type": "string", "minLength": 1 },
"reference": {
"description": "The identifier the POS uses for this menu",
"type": "string"
},
"type": { "$ref": "#/definitions/MenuType" }
},
"type": "object",
"required": ["availability", "categories", "name", "reference", "type"]
},
"MenuCategory": {
"properties": {
"description": { "type": "string" },
"items": {
"items": { "$ref": "#/definitions/MenuItem" },
"type": "array"
},
"name": { "type": "string", "minLength": 1 }
},
"type": "object",
"required": ["name", "description", "items"]
},
"MenuImage": {
"properties": { "url": { "type": "string" } },
"type": "object",
"required": ["url"]
},
"MenuIncludes": {
"properties": {
"description": { "type": "string" },
"modifiers": {
"items": { "$ref": "#/definitions/MenuModifier" },
"type": "array"
},
"name": { "type": "string", "minLength": 1 },
"plu": { "type": "string" },
"out_of_stock": { "type": "boolean" }
},
"type": "object",
"required": ["description", "modifiers", "name", "plu"]
},
"MenuIngredient": {
"properties": { "name": { "type": "string", "minLength": 1 } },
"type": "object",
"required": ["name"]
},
"MenuItem": {
"properties": {
"description": { "type": "string" },
"gallery": {
"items": { "$ref": "#/definitions/MenuImage" },
"type": "array"
},
"includes": {
"items": { "$ref": "#/definitions/MenuIncludes" },
"type": "array"
},
"ingredients": {
"items": { "$ref": "#/definitions/MenuIngredient" },
"type": "array"
},
"modifiers": {
"items": { "$ref": "#/definitions/MenuModifier" },
"type": "array"
},
"portions": {
"items": { "$ref": "#/definitions/MenuPortion" },
"type": "array"
},
"name": { "type": "string", "minLength": 1 },
"plu": {
"description": "Price Look Up Unit (similar to SKU, stock keeping unit)\na unique product/item reference typically specific to each merchant,\nie: not globally unique",
"type": "string"
},
"out_of_stock": { "type": "boolean" },
"is_alcoholic": {
"type": "boolean"
},
"spiciness": {
"$ref": "#/definitions/Spiciness"
},
"dietary_restrictions": {
"items": { "$ref": "#/definitions/DietaryRestriction" },
"type": "array"
},
"allergens": {
"items": { "$ref": "#/definitions/Allergen" },
"type": "array"
},
"additives": {
"items": { "$ref": "#/definitions/Additive" },
"type": "array"
},
"price": {
"description": "An item's price in cents / pennies",
"type": "number",
"minimum": 0
},
"reference": { "type": "string" },
"swap": { "$ref": "#/definitions/Swap" },
"tax_category": { "$ref": "#/definitions/TaxCategory" }
},
"type": "object",
"required": [
"name",
"description",
"plu",
"modifiers",
"includes",
"price",
"ingredients"
]
},
"MenuPortion": {
"properties": {
"description": { "type": "string" },
"modifiers": {
"items": { "$ref": "#/definitions/MenuModifier" },
"type": "array"
},
"name": { "type": "string", "minLength": 1 },
"plu": {
"description": "Price Look Up Unit (similar to SKU, stock keeping unit)\na unique product/item reference typically specific to each merchant,\nie: not globally unique",
"type": "string"
},
"out_of_stock": { "type": "boolean" },
"price": {
"description": "An item's price in cents / pennies",
"type": "number",
"minimum": 0
},
"reference": { "type": "string" }
},
"type": "object",
"required": [
"name",
"description",
"plu",
"modifiers",
"reference",
"price"
]
},
"MenuModifier": {
"properties": {
"description": { "type": "string" },
"name": { "type": "string", "minLength": 1 },
"options": {
"items": { "$ref": "#/definitions/MenuItem" },
"type": "array"
},
"pick": {
"anyOf": [
{ "$ref": "#/definitions/PickExactly" },
{ "$ref": "#/definitions/PickRange" },
{ "$ref": "#/definitions/PickUnlimited" }
]
}
},
"type": "object",
"required": ["description", "name", "options", "pick"]
},
"MenuType": {
"enum": ["COLLECTION", "DELIVERY", "EAT_IN"],
"type": "string"
},
"Spiciness": {
"enum": ["UNKNOWN", "MILD", "MEDIUM", "HOT", "VERY_HOT"],
"type": "string"
},
"DietaryRestriction": {
"enum": ["NONE", "VEGETARIAN", "VEGAN"],
"type": "string"
},
"Allergen": {
"enum": [ "UNSPECIFIED", "CEREAL_UNSPECIFIED", "CEREAL_WHEAT", "CEREAL_RYE", "CEREAL_BARLEY", "CEREAL_OATS", "CEREAL_SPELT", "CEREAL_KAMUT", "CRUSTACEANS", "EGGS", "FISH", "PEANUTS", "SOYBEANS", "MILK", "NUTS_UNSPECIFIED", "NUTS_ALMONDS", "NUTS_HAZELNUTS", "NUTS_WALNUTS", "NUTS_CASHEWS", "NUTS_PECAN", "NUTS_BRAZIL", "NUTS_PISTACHIO", "NUTS_MACADAMIA", "NUTS_QUEENSLAND", "CELERY", "MUSTARD", "SESAME_SEEDS", "SULPHUR_DIOXIDE_SULPHITES", "LUPIN", "MOLLUSCS" ],
"type": "string"
},
"Additive": {
"enum": [ "UNSPECIFIED", "COLORANT_UNSPECIFIED", "COLORANT_ADVERSE_EFFECT", "PRESERVATIVES_UNSPECIFIED", "PRESERVATIVES_NITRITE_CURING_SALT", "PRESERVATIVES_NITRATE", "PRESERVATIVES_NITRATE_CURING_SALT_AND_NITRATE", "ANTIOXIDANT", "FLAVOURE_ENHANCER", "SULFITES", "BLACKENED", "WAXED", "PHOSPHATE", "SWEETENER_UNSPECIFIED", "SWEETENER_PHENYLALANINE", "SWEETENER_LAXATIVE", "CAFFEINE_UNSPECIFIED", "CAFFEINE_HIGH_CAFFEINE", "CAFFEINE_CAFFEINE", "QUININE", "GENETICALLY_MODIFIED", "ACIDIFIERS", "STABILISERS", "PROTEIN_UNSPECIFIED", "PROTEIN_MILK_PROTEIN", "PROTEIN_STARCH", "PROTEIN_EGG_WHITE" ],
"type": "string"
},
"PickExactly": {
"properties": {
"exactly": { "type": "number" },
"pick_same_option": { "type": "boolean" }
},
"type": "object",
"required": ["exactly", "pick_same_option"]
},
"PickRange": {
"properties": {
"pick_same_option": { "type": "boolean" },
"range": {
"properties": {
"from": { "type": "number" },
"to": { "type": "number" }
},
"type": "object"
}
},
"type": "object",
"required": ["pick_same_option", "range"]
},
"PickUnlimited": {
"properties": { "pick_same_option": { "type": "boolean" } },
"type": "object",
"required": ["pick_same_option"]
},
"Swap": {
"properties": {
"name": { "type": "string" },
"options": {
"items": { "$ref": "#/definitions/SwapOption" },
"type": "array"
}
},
"type": "object",
"required": ["name", "options"]
},
"SwapOption": {
"properties": {
"name": { "type": "string", "minLength": 1 },
"out_of_stock": { "type": "boolean" },
"plu": { "type": "string" },
"price": { "type": "number", "minimum": 0 },
"reference": { "type": "string" },
"tax_category": { "$ref": "#/definitions/TaxCategory" }
},
"type": "object",
"required": ["name", "plu", "price", "reference"]
},
"TaxCategory": { "type": "string", "enum": ["ALCOHOL", "NO_TAX", "SUGARED_DRINK"] }
},
"type": "object",
"properties": {
"menus": {
"items": { "$ref": "#/definitions/BaselineMenu" },
"type": "array",
"required": ["availability", "categories", "name", "reference", "type"],
"minItems": 1
},
"restaurants": {
"items": { "type": "string" },
"type": "array",
"minItems": 1
}
},
"required": ["restaurants", "menus"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment