{
  "openapi": "3.1.0",
  "info": {
    "title": "Fred & Theo — informações públicas",
    "version": "1.0.0",
    "description": "Consulta de informações oficiais e preparação de links para o WhatsApp. Não envia mensagens nem confirma pedidos."
  },
  "servers": [
    {
      "url": "https://fredetheo.com.br"
    }
  ],
  "security": [],
  "paths": {
    "/api/business": {
      "get": {
        "operationId": "getBusinessInfo",
        "summary": "Consultar marca, contatos, atendimento e perguntas frequentes",
        "responses": {
          "200": {
            "description": "Resposta pública.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "description",
                    "website",
                    "products",
                    "areaServed",
                    "contact",
                    "ordering",
                    "faq"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "website": {
                      "type": "string",
                      "format": "uri"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "areaServed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "telephone": {
                          "type": "string"
                        },
                        "whatsapp": {
                          "type": "string",
                          "format": "uri"
                        },
                        "instagram": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "ordering": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "checkoutAvailable": {
                          "type": "boolean",
                          "const": false
                        },
                        "confirmationRequired": {
                          "type": "boolean",
                          "const": true
                        },
                        "conditions": {
                          "type": "string"
                        }
                      }
                    },
                    "faq": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "question",
                          "answer"
                        ],
                        "properties": {
                          "question": {
                            "type": "string"
                          },
                          "answer": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Informações temporariamente indisponíveis."
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Verificar disponibilidade da interface pública",
        "responses": {
          "200": {
            "description": "Resposta pública.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "service",
                    "version"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "ok"
                    },
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Informações temporariamente indisponíveis."
          }
        }
      }
    },
    "/api/whatsapp-link": {
      "get": {
        "operationId": "prepareWhatsappLink",
        "summary": "Preparar link de consulta sem enviar mensagem",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "menu",
                "gift",
                "event",
                "ingredients"
              ],
              "default": "menu"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resposta pública.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "topic",
                    "orderPlaced",
                    "instructions"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "topic": {
                      "type": "string",
                      "enum": [
                        "menu",
                        "gift",
                        "event",
                        "ingredients"
                      ]
                    },
                    "orderPlaced": {
                      "type": "boolean",
                      "const": false
                    },
                    "instructions": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Tema inválido."
          }
        }
      }
    }
  }
}
