{
    "openapi": "3.0.3",
    "info": {
        "title": "Menuristo API",
        "version": "1.0.0",
        "description": "API REST per collegare Menuristo a gestionali, casse (POS), sistemi di prenotazione e contabilità. Ogni token appartiene a un solo ristorante e vede solo i suoi dati. Documentazione completa: https://www.menuristo.it/docs/api",
        "contact": {
            "name": "Menuristo",
            "url": "https://www.menuristo.it/docs/api"
        }
    },
    "servers": [
        {
            "url": "https://www.menuristo.it/api/v1",
            "description": "Produzione"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Ristorante",
            "description": "Dati, orari e piano del ristorante del token."
        },
        {
            "name": "Menu",
            "description": "Menu, categorie, piatti e allergeni."
        },
        {
            "name": "Prenotazioni",
            "description": "Richiedono il modulo Prenotazioni nel piano del ristorante."
        }
    ],
    "paths": {
        "/restaurant": {
            "get": {
                "tags": [
                    "Ristorante"
                ],
                "operationId": "getRestaurant",
                "summary": "Dati del ristorante",
                "description": "Informazioni, orari di apertura e stato del modulo Prenotazioni.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Restaurant"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/allergens": {
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "listAllergens",
                "summary": "Elenco allergeni",
                "description": "I 14 allergeni di legge con gli id da usare in allergen_ids.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Allergen"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/menus": {
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "listMenus",
                "summary": "Elenco menu",
                "description": "",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Menu"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "Solo menu pubblicati (true) o nascosti (false)."
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "categories",
                                "categories.dishes"
                            ]
                        },
                        "description": "Includi categorie ed eventualmente piatti."
                    }
                ]
            },
            "post": {
                "tags": [
                    "Menu"
                ],
                "operationId": "createMenu",
                "summary": "Crea un menu",
                "description": "Richiede un token con permesso di scrittura.",
                "responses": {
                    "201": {
                        "description": "Creato",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Menu"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/MenuInput"
                                    },
                                    {
                                        "required": [
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/menus/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/Id"
                }
            ],
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "getMenu",
                "summary": "Dettaglio menu",
                "description": "Il menu con tutte le categorie e i piatti.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Menu"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Menu"
                ],
                "operationId": "updateMenu",
                "summary": "Modifica un menu",
                "description": "Richiede un token con permesso di scrittura.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Menu"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/MenuInput"
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Menu"
                ],
                "operationId": "deleteMenu",
                "summary": "Elimina un menu",
                "description": "Elimina anche categorie e piatti del menu. Richiede un token con permesso di scrittura.",
                "responses": {
                    "204": {
                        "description": "Eliminato"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "listCategories",
                "summary": "Elenco categorie",
                "description": "",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Category"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "name": "menu_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Solo le categorie di questo menu."
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "dishes"
                            ]
                        },
                        "description": "Includi i piatti."
                    }
                ]
            },
            "post": {
                "tags": [
                    "Menu"
                ],
                "operationId": "createCategory",
                "summary": "Crea una categoria",
                "description": "Richiede un token con permesso di scrittura.",
                "responses": {
                    "201": {
                        "description": "Creato",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/CategoryInput"
                                    },
                                    {
                                        "required": [
                                            "menu_id",
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/categories/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/Id"
                }
            ],
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "getCategory",
                "summary": "Dettaglio categoria",
                "description": "",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Menu"
                ],
                "operationId": "updateCategory",
                "summary": "Modifica una categoria",
                "description": "menu_id non è modificabile. Richiede un token con permesso di scrittura.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CategoryInput"
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Menu"
                ],
                "operationId": "deleteCategory",
                "summary": "Elimina una categoria",
                "description": "Elimina anche i piatti della categoria. Richiede un token con permesso di scrittura.",
                "responses": {
                    "204": {
                        "description": "Eliminato"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/dishes": {
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "listDishes",
                "summary": "Elenco piatti",
                "description": "",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Dish"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "name": "menu_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Solo i piatti di questo menu."
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Solo i piatti di questa categoria."
                    },
                    {
                        "name": "is_available",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "Solo disponibili (true) o esauriti (false)."
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Cerca nel nome."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Solo piatti modificati da questo momento (sincronizzazione incrementale)."
                    }
                ]
            },
            "post": {
                "tags": [
                    "Menu"
                ],
                "operationId": "createDish",
                "summary": "Crea un piatto",
                "description": "Richiede un token con permesso di scrittura.",
                "responses": {
                    "201": {
                        "description": "Creato",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Dish"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/DishInput"
                                    },
                                    {
                                        "required": [
                                            "category_id",
                                            "name",
                                            "price"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Menu"
                ],
                "operationId": "batchUpdateDishes",
                "summary": "Aggiorna più piatti insieme",
                "description": "Prezzo e disponibilità di fino a 100 piatti in una richiesta, tutto o niente. Richiede un token con permesso di scrittura.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Dish"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/DishBatchInput"
                                    },
                                    {
                                        "required": [
                                            "dishes"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/dishes/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/Id"
                }
            ],
            "get": {
                "tags": [
                    "Menu"
                ],
                "operationId": "getDish",
                "summary": "Dettaglio piatto",
                "description": "",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Dish"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Menu"
                ],
                "operationId": "updateDish",
                "summary": "Modifica un piatto",
                "description": "Invia solo i campi da cambiare. allergen_ids sostituisce l'elenco completo. Richiede un token con permesso di scrittura.",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Dish"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DishInput"
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Menu"
                ],
                "operationId": "deleteDish",
                "summary": "Elimina un piatto",
                "description": "Richiede un token con permesso di scrittura.",
                "responses": {
                    "204": {
                        "description": "Eliminato"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/bookings": {
            "get": {
                "tags": [
                    "Prenotazioni"
                ],
                "operationId": "listBookings",
                "summary": "Elenco prenotazioni",
                "description": "Richiede il modulo Prenotazioni attivo (altrimenti 403 plan_required).",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Booking"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Page"
                    },
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Solo il giorno indicato (AAAA-MM-GG)."
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Dal giorno (compreso)."
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Al giorno (compreso)."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "pending,confirmed"
                        },
                        "description": "Uno o più stati separati da virgola."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Solo prenotazioni modificate da questo momento."
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "starts_at",
                                "-starts_at",
                                "updated_at",
                                "-updated_at"
                            ],
                            "default": "starts_at"
                        },
                        "description": "Ordinamento; il segno meno inverte."
                    }
                ]
            },
            "post": {
                "tags": [
                    "Prenotazioni"
                ],
                "operationId": "createBooking",
                "summary": "Crea una prenotazione",
                "description": "Prenotazione presa al telefono o al banco. Con la sala piena risponde 409, a meno di check_availability: false. Richiede un token con permesso di scrittura. Richiede il modulo Prenotazioni attivo (altrimenti 403 plan_required).",
                "responses": {
                    "201": {
                        "description": "Creato",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Booking"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/BookingInput"
                                    },
                                    {
                                        "required": [
                                            "starts_at",
                                            "party_size",
                                            "customer_name",
                                            "customer_phone"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/bookings/{id}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/Id"
                }
            ],
            "get": {
                "tags": [
                    "Prenotazioni"
                ],
                "operationId": "getBooking",
                "summary": "Dettaglio prenotazione",
                "description": "Richiede il modulo Prenotazioni attivo (altrimenti 403 plan_required).",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Booking"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/bookings/{id}/status": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/Id"
                }
            ],
            "patch": {
                "tags": [
                    "Prenotazioni"
                ],
                "operationId": "updateBookingStatus",
                "summary": "Cambia lo stato",
                "description": "Conferma, rifiuta, annulla o segna arrivati, non presentati o conclusa. Il cliente riceve l'email quando serve. Richiede un token con permesso di scrittura. Richiede il modulo Prenotazioni attivo (altrimenti 403 plan_required).",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Booking"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/BookingStatusInput"
                                    },
                                    {
                                        "required": [
                                            "status"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Token creato nel pannello, sezione Integrazioni."
            }
        },
        "parameters": {
            "Id": {
                "name": "id",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "integer"
                }
            },
            "Page": {
                "name": "page",
                "in": "query",
                "required": false,
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                }
            },
            "PerPage": {
                "name": "per_page",
                "in": "query",
                "required": false,
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25
                }
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "Token mancante, non valido o revocato.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "unauthenticated",
                                "message": "Token mancante, non valido o revocato.",
                                "details": {}
                            }
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Permesso mancante (insufficient_permissions), piano senza modulo (plan_required), ristorante sospeso (restaurant_suspended) o API non attive (api_disabled).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "insufficient_permissions",
                                "message": "Permesso mancante (insufficient_permissions), piano senza modulo (plan_required), ristorante sospeso (restaurant_suspended) o API non attive (api_disabled).",
                                "details": {}
                            }
                        }
                    }
                }
            },
            "NotFound": {
                "description": "Risorsa non trovata o di un altro ristorante.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "not_found",
                                "message": "Risorsa non trovata o di un altro ristorante.",
                                "details": {}
                            }
                        }
                    }
                }
            },
            "Conflict": {
                "description": "La richiesta è valida ma non applicabile ora, ad esempio sala piena.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "conflict",
                                "message": "La richiesta è valida ma non applicabile ora, ad esempio sala piena.",
                                "details": {}
                            }
                        }
                    }
                }
            },
            "ValidationFailed": {
                "description": "I dati inviati non sono validi: details.fields elenca gli errori per campo.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "validation_failed",
                                "message": "I dati inviati non sono validi: details.fields elenca gli errori per campo.",
                                "details": {}
                            }
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Troppe richieste: rispetta l'intestazione Retry-After.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "rate_limited",
                                "message": "Troppe richieste: rispetta l'intestazione Retry-After.",
                                "details": {}
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "unauthenticated",
                                    "insufficient_permissions",
                                    "plan_required",
                                    "restaurant_suspended",
                                    "api_disabled",
                                    "forbidden",
                                    "not_found",
                                    "method_not_allowed",
                                    "conflict",
                                    "validation_failed",
                                    "rate_limited",
                                    "server_error"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "details": {
                                "type": "object",
                                "additionalProperties": true
                            }
                        }
                    }
                }
            },
            "PaginationLinks": {
                "type": "object",
                "properties": {
                    "first": {
                        "type": "string",
                        "nullable": true
                    },
                    "last": {
                        "type": "string",
                        "nullable": true
                    },
                    "prev": {
                        "type": "string",
                        "nullable": true
                    },
                    "next": {
                        "type": "string",
                        "nullable": true
                    }
                }
            },
            "PaginationMeta": {
                "type": "object",
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "integer",
                        "nullable": true
                    },
                    "to": {
                        "type": "integer",
                        "nullable": true
                    }
                }
            },
            "Restaurant": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "short_description": {
                        "type": "string",
                        "nullable": true
                    },
                    "tagline": {
                        "type": "string",
                        "nullable": true
                    },
                    "address": {
                        "type": "string",
                        "nullable": true
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true
                    },
                    "cover_charge": {
                        "type": "number",
                        "nullable": true,
                        "example": 2.5
                    },
                    "logo_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "cover_image_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "google_review_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "menu_languages": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "it",
                            "en"
                        ]
                    },
                    "timezone": {
                        "type": "string",
                        "example": "Europe/Rome"
                    },
                    "opening_hours": {
                        "type": "object",
                        "properties": {
                            "days": {
                                "type": "object",
                                "properties": {
                                    "monday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "tuesday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "wednesday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "thursday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "friday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "saturday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    },
                                    "sunday": {
                                        "type": "object",
                                        "properties": {
                                            "closed": {
                                                "type": "boolean"
                                            },
                                            "morning": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "12:00-15:00"
                                            },
                                            "afternoon": {
                                                "type": "string",
                                                "nullable": true,
                                                "example": "19:00-23:00"
                                            }
                                        }
                                    }
                                }
                            },
                            "notes": {
                                "type": "string",
                                "nullable": true
                            }
                        }
                    },
                    "public_url": {
                        "type": "string"
                    },
                    "bookings": {
                        "type": "object",
                        "properties": {
                            "plan_active": {
                                "type": "boolean"
                            },
                            "tier": {
                                "type": "string",
                                "nullable": true,
                                "enum": [
                                    "essential",
                                    "complete",
                                    null
                                ]
                            },
                            "is_trial": {
                                "type": "boolean"
                            },
                            "expires_at": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            },
                            "online_enabled": {
                                "type": "boolean"
                            },
                            "booking_url": {
                                "type": "string",
                                "nullable": true
                            }
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Allergen": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string",
                        "example": "Glutine"
                    }
                }
            },
            "Menu": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "is_active": {
                        "type": "boolean",
                        "description": "Pubblicato e visibile ai clienti."
                    },
                    "template": {
                        "type": "string",
                        "enum": [
                            "classic",
                            "modern",
                            "minimalist",
                            "elegant",
                            "bold",
                            "asiatico",
                            "trattoria",
                            "nordic",
                            "terrazza",
                            "pizzeria",
                            "lavagna",
                            "osteria",
                            "cocktail",
                            "pasticceria",
                            "rivista",
                            "gourmet"
                        ]
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "public_url": {
                        "type": "string"
                    },
                    "categories_count": {
                        "type": "integer"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Category"
                        },
                        "description": "Presente nel dettaglio o con include."
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "MenuInput": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "is_active": {
                        "type": "boolean",
                        "default": true
                    },
                    "template": {
                        "type": "string",
                        "enum": [
                            "classic",
                            "modern",
                            "minimalist",
                            "elegant",
                            "bold",
                            "asiatico",
                            "trattoria",
                            "nordic",
                            "terrazza",
                            "pizzeria",
                            "lavagna",
                            "osteria",
                            "cocktail",
                            "pasticceria",
                            "rivista",
                            "gourmet"
                        ],
                        "default": "classic"
                    },
                    "sort_order": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Posizione (1 = primo). Gli altri scalano."
                    }
                }
            },
            "Category": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "menu_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "secondary_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "description": {
                        "type": "string",
                        "nullable": true
                    },
                    "image_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "dishes_count": {
                        "type": "integer"
                    },
                    "dishes": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Dish"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "CategoryInput": {
                "type": "object",
                "properties": {
                    "menu_id": {
                        "type": "integer",
                        "description": "Solo in creazione."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "secondary_name": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 255
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 1000
                    },
                    "image_url": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "sort_order": {
                        "type": "integer",
                        "minimum": 1
                    }
                }
            },
            "Dish": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "category_id": {
                        "type": "integer"
                    },
                    "menu_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "secondary_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "description": {
                        "type": "string",
                        "nullable": true
                    },
                    "price": {
                        "type": "number",
                        "example": 12.5
                    },
                    "currency": {
                        "type": "string",
                        "example": "EUR"
                    },
                    "is_available": {
                        "type": "boolean",
                        "description": "false = esaurito."
                    },
                    "is_recommended": {
                        "type": "boolean",
                        "description": "Consigliato dallo chef."
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "vegano",
                            "piccante"
                        ]
                    },
                    "allergens": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Allergen"
                        }
                    },
                    "image_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "translations": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        },
                        "example": {
                            "en": {
                                "name": "Tomato bruschetta"
                            }
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "DishInput": {
                "type": "object",
                "properties": {
                    "category_id": {
                        "type": "integer",
                        "description": "Cambiandolo il piatto si sposta in fondo alla nuova categoria."
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "secondary_name": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 255
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 1000
                    },
                    "price": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 9999.99,
                        "multipleOf": 0.01
                    },
                    "is_available": {
                        "type": "boolean",
                        "default": true
                    },
                    "is_recommended": {
                        "type": "boolean",
                        "default": false
                    },
                    "tags": {
                        "type": "array",
                        "nullable": true,
                        "maxItems": 20,
                        "items": {
                            "type": "string",
                            "maxLength": 50
                        }
                    },
                    "allergen_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Elenco completo degli allergeni (sostituisce quello attuale)."
                    },
                    "image_url": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "sort_order": {
                        "type": "integer",
                        "minimum": 1
                    }
                }
            },
            "DishBatchInput": {
                "type": "object",
                "properties": {
                    "dishes": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 100,
                        "items": {
                            "type": "object",
                            "required": [
                                "id"
                            ],
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "price": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 9999.99
                                },
                                "is_available": {
                                    "type": "boolean"
                                },
                                "is_recommended": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            },
            "Booking": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "reference": {
                        "type": "string",
                        "example": "K7P2QX"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "declined",
                            "cancelled",
                            "seated",
                            "no_show",
                            "completed"
                        ]
                    },
                    "status_label": {
                        "type": "string",
                        "example": "Confermata"
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "online",
                            "phone",
                            "walk_in"
                        ]
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ends_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "duration_minutes": {
                        "type": "integer"
                    },
                    "party_size": {
                        "type": "integer"
                    },
                    "customer": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "nullable": true
                            },
                            "email": {
                                "type": "string",
                                "nullable": true
                            },
                            "phone": {
                                "type": "string",
                                "nullable": true
                            },
                            "marketing_consent": {
                                "type": "boolean"
                            }
                        }
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true
                    },
                    "tables": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "confirmed_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "cancelled_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "anonymized_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "BookingInput": {
                "type": "object",
                "properties": {
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-11-20T20:30:00+01:00"
                    },
                    "party_size": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500
                    },
                    "customer_name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "customer_phone": {
                        "type": "string",
                        "maxLength": 30
                    },
                    "customer_email": {
                        "type": "string",
                        "format": "email",
                        "nullable": true
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 500
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "phone",
                            "walk_in"
                        ],
                        "default": "phone"
                    },
                    "check_availability": {
                        "type": "boolean",
                        "default": true,
                        "description": "false per inserirla anche con la sala piena."
                    },
                    "notify_guest": {
                        "type": "boolean",
                        "default": true,
                        "description": "Invia l'email di conferma se c'è customer_email."
                    }
                }
            },
            "BookingStatusInput": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "confirmed",
                            "declined",
                            "cancelled",
                            "seated",
                            "no_show",
                            "completed"
                        ]
                    },
                    "notify_guest": {
                        "type": "boolean",
                        "default": true
                    }
                }
            },
            "WebhookEvent": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "evt_01JC9Z0Y5S8M2W3T1N6QK4H7RB"
                    },
                    "event": {
                        "type": "string",
                        "enum": [
                            "ping",
                            "booking.created",
                            "booking.updated",
                            "booking.cancelled",
                            "dish.created",
                            "dish.updated",
                            "dish.deleted"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "restaurant_id": {
                        "type": "integer"
                    },
                    "api_version": {
                        "type": "string",
                        "example": "v1"
                    },
                    "data": {
                        "type": "object",
                        "description": "Booking o Dish, come nelle risposte dell'API. dish.deleted contiene solo id, category_id e name."
                    }
                }
            }
        }
    },
    "x-webhooks": {
        "booking.created": {
            "post": {
                "summary": "Nuova prenotazione",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        },
        "booking.updated": {
            "post": {
                "summary": "Prenotazione modificata o cambiata di stato",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        },
        "booking.cancelled": {
            "post": {
                "summary": "Prenotazione annullata o rifiutata",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        },
        "dish.created": {
            "post": {
                "summary": "Piatto aggiunto",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        },
        "dish.updated": {
            "post": {
                "summary": "Piatto modificato (prezzo, disponibilità, testi)",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        },
        "dish.deleted": {
            "post": {
                "summary": "Piatto eliminato",
                "description": "Firmato con l'intestazione X-Menuristo-Signature: t=<timestamp>,v1=<HMAC-SHA256 di \"<timestamp>.<body>\">.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rispondi con un codice 2xx entro 10 secondi."
                    }
                }
            }
        }
    }
}