{
    "openapi": "3.1.0",
    "info": {
        "title": "Da Mauro Pizzéria – publikus API",
        "version": "1.0.0",
        "description": "Étlap, nyitvatartás, árajánlat és agentic rendelés (fizetés átvételkor). A quote és az order ugyanazt az árazást használja.",
        "contact": {
            "name": "Da Mauro",
            "url": "https://damauro.jarmukeramia.hu/"
        }
    },
    "servers": [
        {
            "url": "https://damauro.jarmukeramia.hu",
            "description": "Élő webshop"
        }
    ],
    "tags": [
        {
            "name": "catalog",
            "description": "Étlap és nyitvatartás"
        },
        {
            "name": "commerce",
            "description": "Árajánlat és rendelés"
        }
    ],
    "paths": {
        "/api/menu.php": {
            "get": {
                "tags": [
                    "catalog"
                ],
                "summary": "Teljes étlap + élő order_policy",
                "operationId": "getMenu",
                "parameters": [
                    {
                        "name": "fresh",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        },
                        "description": "Cache kihagyása"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Étlap JSON (restaurant, order_policy, items, daily_menus)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/hours.php": {
            "get": {
                "tags": [
                    "catalog"
                ],
                "summary": "Nyitvatartás és rendelési slotok",
                "operationId": "getHours",
                "responses": {
                    "200": {
                        "description": "Nyitvatartás + érvényes időpontok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/quote.php": {
            "post": {
                "tags": [
                    "commerce"
                ],
                "summary": "Kosár-validáció és végösszeg",
                "operationId": "createQuote",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "product_id": {
                                                    "type": "integer"
                                                },
                                                "quantity": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "daily_menu_id": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    },
                                    "cart": {
                                        "type": "array",
                                        "description": "Alias az items-re"
                                    },
                                    "delivery_type": {
                                        "type": "string",
                                        "enum": [
                                            "delivery",
                                            "pickup"
                                        ]
                                    },
                                    "address_zip": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "items": [
                                    {
                                        "product_id": 1,
                                        "quantity": 1
                                    }
                                ],
                                "delivery_type": "delivery",
                                "address_zip": "6000"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "success + quote (tételek, díj, total)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/order.php": {
            "post": {
                "tags": [
                    "commerce"
                ],
                "summary": "Rendelés leadása (agent: API-kulcs + idempotencia)",
                "operationId": "createOrder",
                "parameters": [
                    {
                        "name": "X-Api-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Agent API kulcs (kötelező agent hívásnál)"
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Kötelező agent rendelésnél"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rendelés létrehozva vagy idempotens ismétlés",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/order-status.php": {
            "get": {
                "tags": [
                    "commerce"
                ],
                "summary": "Rendelés státusz view tokennel",
                "operationId": "getOrderStatus",
                "parameters": [
                    {
                        "name": "order",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Státusz JSON",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "externalDocs": {
        "description": "Ember-olvasható API leírás",
        "url": "https://damauro.jarmukeramia.hu/api_info.php"
    }
}