{
    "swagger": "2.0",
    "info": {
        "description": "Backend REST API do Vitrinim — Plataforma de catálogo e vitrine digital.",
        "title": "Vitrinim API",
        "contact": {
            "name": "Suporte Vitrinim",
            "email": "contato@vitrinim.com.br"
        },
        "license": {
            "name": "MIT"
        },
        "version": "1.0"
    },
    "host": "localhost:8080",
    "basePath": "/",
    "paths": {
        "/api/v1/admin/coupons": {
            "get": {
                "description": "Lists all existing discount coupons with their statuses and usage counts",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "admin-coupons"
                ],
                "summary": "[Admin] List all coupons",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Chave mestra de administrador",
                        "name": "X-Admin-Key",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de cupons",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.Coupon"
                            }
                        }
                    },
                    "401": {
                        "description": "Chave de administrador inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a new coupon (percentage or fixed discount, permanent or with expiration date)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "admin-coupons"
                ],
                "summary": "[Admin] Create a new discount coupon",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Chave mestra de administrador",
                        "name": "X-Admin-Key",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Parâmetros do novo cupom",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.CreateCouponRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Cupom criado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Coupon"
                        }
                    },
                    "400": {
                        "description": "Parâmetros inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Chave de administrador inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/admin/coupons/{uuid}": {
            "delete": {
                "description": "Permanently removes a coupon from the system",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "admin-coupons"
                ],
                "summary": "[Admin] Delete a coupon",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Chave mestra de administrador",
                        "name": "X-Admin-Key",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "UUID do cupom",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cupom excluído com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "UUID inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Chave de administrador inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Cupom não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/admin/coupons/{uuid}/archive": {
            "patch": {
                "description": "Safely archives a coupon, blocking future redemptions while preserving customer audit history",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "admin-coupons"
                ],
                "summary": "[Admin] Archive a coupon (Soft Delete)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Chave mestra de administrador",
                        "name": "X-Admin-Key",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "UUID do cupom",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cupom arquivado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "UUID inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Chave de administrador inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Cupom não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/admin/coupons/{uuid}/toggle": {
            "patch": {
                "description": "Activates or deactivates an existing coupon by its UUID",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "admin-coupons"
                ],
                "summary": "[Admin] Toggle coupon active status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Chave mestra de administrador",
                        "name": "X-Admin-Key",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "UUID do cupom",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cupom com status atualizado",
                        "schema": {
                            "$ref": "#/definitions/models.Coupon"
                        }
                    },
                    "400": {
                        "description": "UUID inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Chave de administrador inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Cupom não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/account": {
            "delete": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Exclui permanentemente todos os dados da conta do lojista, cancela cobranças e assinaturas no Asaas e armazena feedback anonimizado.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Exclusão definitiva de conta do lojista (LGPD Art. 18, VI)",
                "parameters": [
                    {
                        "description": "Confirmação com senha e pesquisa de churn",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.DeleteAccountRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/forgot-password": {
            "post": {
                "description": "Generates a temporary readable password, updates password hash, and sends to merchant email",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Password recovery",
                "parameters": [
                    {
                        "description": "Merchant registered email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ForgotPasswordRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "E-mail obrigatório ou corpo inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Nenhuma conta encontrada com este e-mail",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/login": {
            "post": {
                "description": "Validates credentials via bcrypt and sets HttpOnly session cookie",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Authenticate merchant",
                "parameters": [
                    {
                        "description": "Login credentials",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.LoginRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "400": {
                        "description": "Corpo da requisição inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "E-mail ou senha incorretos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "E-mail não verificado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/logout": {
            "post": {
                "description": "Revokes authentication by clearing the HttpOnly session cookie",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Logout merchant",
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/api/v1/auth/me": {
            "get": {
                "description": "Returns authenticated merchant profile and access expiration directly from database",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Get current authenticated merchant",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MeResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado ou sessão expirada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Lojista não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/register": {
            "post": {
                "description": "Creates a new merchant account and sets HttpOnly session cookie",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Register merchant",
                "parameters": [
                    {
                        "description": "Merchant registration data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.RegisterRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created"
                    },
                    "400": {
                        "description": "Dados inválidos ou senha fraca",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "E-mail ou slug já em uso",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/resend-otp": {
            "post": {
                "description": "Generates a new 6-digit OTP code and magic link and resends by email",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Resend verification email",
                "parameters": [
                    {
                        "description": "Merchant email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ResendOTPRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "E-mail obrigatório ou conta já verificada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Conta não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "Aguarde o cooldown para novo envio",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/verify-otp": {
            "post": {
                "description": "Validates the 6-digit OTP code sent by email, marks account as verified, and sets session cookie",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Verify email via 6-digit OTP",
                "parameters": [
                    {
                        "description": "Verification code and email",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.VerifyOTPRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "Código ou e-mail inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Código incorreto",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "410": {
                        "description": "Código expirado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "Limite de tentativas excedido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/verify-token": {
            "post": {
                "description": "Validates the Magic Link token received by email, marks account as verified, and sets session cookie",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Verify email via Magic Link token",
                "parameters": [
                    {
                        "description": "Magic link token",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.VerifyTokenRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "Token inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "410": {
                        "description": "Token expirado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/categories": {
            "get": {
                "description": "Lists categories with associated product counts and standard 20 per page pagination",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "List store categories",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Page number (default: 1)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Items per page (default: 20, max: 100)",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Return all categories without pagination (for tab bars)",
                        "name": "all",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter by category name",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Filter by active status",
                        "name": "is_active",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista paginada de categorias",
                        "schema": {
                            "$ref": "#/definitions/models.CategoryListResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a new product category for the authenticated merchant",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Create a new category",
                "parameters": [
                    {
                        "description": "Dados da categoria",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.CreateCategoryRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Categoria criada com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Category"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/categories/reorder": {
            "patch": {
                "description": "Updates the display order of categories tabs",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Reorder categories display order",
                "parameters": [
                    {
                        "description": "Lista ordenada de IDs",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ReorderCategoriesRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ordem atualizada com sucesso",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/categories/{id}": {
            "get": {
                "description": "Returns details of a specific category belonging to the merchant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Get a category by ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Category UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalhes da categoria",
                        "schema": {
                            "$ref": "#/definitions/models.Category"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Categoria não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Updates name, description, emoji and active status of a category",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Update an existing category",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Category UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Dados atualizados",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateCategoryRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Categoria atualizada com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Category"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Categoria não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Deletes a category. Associated products are kept with null category",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Delete a category",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Category UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Categoria excluída com sucesso",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Categoria não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/categories/{id}/toggle-active": {
            "patch": {
                "description": "Activates or deactivates category visibility on the storefront",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "categories"
                ],
                "summary": "Toggle category active status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Category UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Novo status de visibilidade",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Erro ao alterar visibilidade",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/coupons/validate": {
            "post": {
                "description": "Validates coupon validity, limits, expiration, and computes simulated discount for a plan",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "coupons"
                ],
                "summary": "Validate a coupon code",
                "parameters": [
                    {
                        "description": "Dados do cupom e plano",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ValidateCouponRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cupom validado com cálculo de desconto",
                        "schema": {
                            "$ref": "#/definitions/models.ValidateCouponResponse"
                        }
                    },
                    "400": {
                        "description": "Cupom inválido ou expirado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/dev/unhit-sales-goal": {
            "post": {
                "description": "Remove pedidos gerados pelo dev tools e garante que a meta do mês fique em andamento (não batida)",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Dev"
                ],
                "summary": "Desbater meta (remover pedidos fake de teste)",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/goals/annual": {
            "get": {
                "description": "Retorna o consolidado do ano e a grade dos 12 meses com progresso e status",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Get annual sales goal planning",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Ano do planejamento (padrão: ano atual)",
                        "name": "year",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Planejamento anual",
                        "schema": {
                            "$ref": "#/definitions/models.AnnualPlanningResponse"
                        }
                    },
                    "400": {
                        "description": "Ano inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Define ou atualiza a meta consolidada do ano com distribuição igual ou personalizada",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Create or update annual sales goal",
                "parameters": [
                    {
                        "description": "Dados do planejamento anual",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpsertAnnualGoalRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Planejamento anual atualizado",
                        "schema": {
                            "$ref": "#/definitions/models.AnnualPlanningResponse"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/goals/current-month": {
            "get": {
                "description": "Retorna o progresso, ritmo diário e estado de celebração da meta do mês atual",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Get current month sales goal",
                "responses": {
                    "200": {
                        "description": "Métricas e progresso do mês atual",
                        "schema": {
                            "$ref": "#/definitions/models.SalesGoalSummary"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/goals/month": {
            "get": {
                "description": "Retorna o resumo detalhado da meta de um mês e ano específicos",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Get sales goal for a specific month",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Ano da meta (ex: 2026)",
                        "name": "year",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Mês da meta (1 a 12)",
                        "name": "month",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Métricas do mês consultado",
                        "schema": {
                            "$ref": "#/definitions/models.SalesGoalSummary"
                        }
                    },
                    "400": {
                        "description": "Parâmetros inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Define ou ajusta a meta de um mês específico com validação de faturamento já conquistado",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Create or update monthly sales goal",
                "parameters": [
                    {
                        "description": "Dados da meta mensal",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpsertMonthGoalRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Meta atualizada com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.SalesGoalSummary"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Meta inferior ao faturamento atual",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/goals/{uuid}/celebrate": {
            "post": {
                "description": "Registra que o lojista já visualizou a celebração da meta batida",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "goals"
                ],
                "summary": "Mark goal celebration as seen",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID da meta",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Confirmação de celebração",
                        "schema": {
                            "$ref": "#/definitions/models.MarkGoalCelebratedResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Meta não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/metrics/plans": {
            "get": {
                "description": "Returns aggregated statistics on active subscribers, total sales and revenue per plan",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "metrics"
                ],
                "summary": "Get commercial plans metrics",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.PlanMetricsResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders": {
            "get": {
                "description": "Returns paginated orders for the authenticated merchant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "List merchant orders",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by status (pending, in_progress, completed, cancelled)",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by customer name, phone or order number",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter orders created from date (YYYY-MM-DD)",
                        "name": "start_date",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter orders created up to date (YYYY-MM-DD)",
                        "name": "end_date",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page number (default: 1)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Items per page (default: 20, max: 1000)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de pedidos",
                        "schema": {
                            "$ref": "#/definitions/models.OrderListResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders/manual": {
            "post": {
                "description": "Records an in-person or direct counter sale from the merchant dashboard",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Create manual counter order",
                "parameters": [
                    {
                        "description": "Manual order payload",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.CreateManualOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Pedido manual criado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Order"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders/metrics": {
            "get": {
                "description": "Returns aggregated counters for the sidebar badge and dashboard KPIs",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Get order metrics",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Data inicial para filtrar métricas (YYYY-MM-DD)",
                        "name": "start_date",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Data final para filtrar métricas (YYYY-MM-DD)",
                        "name": "end_date",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Métricas de pedidos",
                        "schema": {
                            "$ref": "#/definitions/models.OrderMetricsResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders/{id}": {
            "get": {
                "description": "Returns complete order details with line items for the merchant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Get merchant order details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Order UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalhes completos do pedido",
                        "schema": {
                            "$ref": "#/definitions/models.Order"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Pedido não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders/{id}/shipping": {
            "patch": {
                "description": "Sets negotiated shipping fee and recalculates order total",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Update order shipping",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Order UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Shipping fee in cents",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateOrderShippingRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pedido com frete e total atualizados",
                        "schema": {
                            "$ref": "#/definitions/models.Order"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Pedido não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/orders/{id}/status": {
            "patch": {
                "description": "Transitions order status (in_progress, completed, cancelled) and controls inventory",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "orders"
                ],
                "summary": "Update order status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Order UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "New status payload",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateOrderStatusRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status atualizado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "Transição de status inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Pedido não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/plans": {
            "get": {
                "description": "Returns active commercial plans with intelligent ETag caching (RFC 7232)",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "plans"
                ],
                "summary": "Get commercial plans",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.PlansResponse"
                        }
                    },
                    "304": {
                        "description": "Not Modified",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products": {
            "get": {
                "description": "Returns paginated products filtered by category, search query, or status",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "List products",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Filter by category UUID",
                        "name": "category_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search by product name, description or SKU",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Filter by active status",
                        "name": "is_active",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page number (default: 1)",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Items per page (default: 20, max: 100)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista paginada de produtos",
                        "schema": {
                            "$ref": "#/definitions/models.ProductListResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a new product with optional custom variants and promotional pricing",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Create a new product",
                "parameters": [
                    {
                        "description": "Dados do produto",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.CreateProductRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Produto cadastrado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Product"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products/low-stock": {
            "get": {
                "description": "Returns products that have reached or dropped below their minimum stock threshold",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Get low stock products",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Maximum items to return (default: 20)",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Produtos com estoque baixo",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.Product"
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products/reorder": {
            "patch": {
                "description": "Updates sequence display order of products",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Reorder products",
                "parameters": [
                    {
                        "description": "Lista ordenada de IDs",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ReorderProductsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ordem dos produtos atualizada",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products/{id}": {
            "get": {
                "description": "Returns product details and its custom variants",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Get product by ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Product UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalhes do produto e variantes",
                        "schema": {
                            "$ref": "#/definitions/models.Product"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Produto não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Updates product details and synchronizes custom variants",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Update an existing product",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Product UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Dados atualizados",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateProductRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Produto atualizado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Product"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Produto não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Deletes a product and its associated variants",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Delete a product",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Product UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Produto excluído com sucesso",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Produto não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products/{id}/stock": {
            "patch": {
                "description": "Quickly updates available stock quantity for inventory control",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Update product stock quantity",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Product UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Nova quantidade",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateStockRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Estoque atualizado com sucesso",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Produto não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/products/{id}/toggle-active": {
            "patch": {
                "description": "Enables or pauses product visibility on digital storefront",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "products"
                ],
                "summary": "Toggle product active status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Product UUID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Novo status de visibilidade",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Produto não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/profile": {
            "get": {
                "description": "Returns complete profile information of authenticated merchant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "profile"
                ],
                "summary": "Get authenticated merchant profile",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.ProfileResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado ou sessão expirada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Lojista não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Updates store name, slug, email, telephone, and optionally updates password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "profile"
                ],
                "summary": "Update authenticated merchant profile",
                "parameters": [
                    {
                        "description": "Profile update data",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateProfileRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.ProfileResponse"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos ou senha fraca",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Senha atual incorreta ou não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "E-mail ou slug já em uso",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/profile/cancel-email-change": {
            "post": {
                "description": "Descarta o e-mail pendente de confirmação mantendo o e-mail atual do lojista",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "Cancela a alteração pendente de e-mail",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/profile/confirm-email-change": {
            "post": {
                "description": "Valida o código de 6 dígitos numéricos ou token de segurança e efetiva a migração para o novo e-mail",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "Confirmação da troca de e-mail do lojista",
                "parameters": [
                    {
                        "description": "Dados de confirmação",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.ConfirmEmailChangeRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.ProfileResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/profile/resend-email-change": {
            "post": {
                "description": "Gera novo OTP respeitando o cooldown de 60 segundos",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "Reenvia o código de confirmação para o novo e-mail pendente",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "Too Many Requests",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/public/orders/{uuid}": {
            "get": {
                "description": "Retrieves public order status and details using the Magic Link UUID",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "public-orders"
                ],
                "summary": "Get public order by UUID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Order UUID",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalhes do pedido",
                        "schema": {
                            "$ref": "#/definitions/models.Order"
                        }
                    },
                    "404": {
                        "description": "Pedido não encontrado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/public/stores/{slug}": {
            "get": {
                "description": "Returns active public storefront details by unique slug for consumer visitors",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "public-store"
                ],
                "summary": "Get public store storefront by slug",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug público da loja (ex: 'doces-da-maria')",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dados públicos da vitrine",
                        "schema": {
                            "$ref": "#/definitions/models.PublicStoreResponse"
                        }
                    },
                    "404": {
                        "description": "Loja não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/public/stores/{slug}/orders": {
            "post": {
                "description": "Creates a new customer order on the public storefront",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "public-orders"
                ],
                "summary": "Create public order",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Store Slug",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Order payload",
                        "name": "order",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.CreatePublicOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Pedido registrado com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.PublicOrderCreatedResponse"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Vitrine pausada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Vitrine não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/public/stores/{slug}/orders/track": {
            "post": {
                "description": "Securely tracks an order by order number and the last 4 digits of the phone number (zero password)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "public-orders"
                ],
                "summary": "Track order securely",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Store Slug",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Tracking query",
                        "name": "query",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.TrackOrderRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Detalhes do pedido localizado",
                        "schema": {
                            "$ref": "#/definitions/models.Order"
                        }
                    },
                    "400": {
                        "description": "Parâmetros inválidos",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Pedido não localizado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/public/stores/{slug}/visit": {
            "post": {
                "description": "Lightweight tracking endpoint for storefront visits",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "public-store"
                ],
                "summary": "Record public store pageview",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Store Slug",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Visit metadata",
                        "name": "body",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.RecordVisitRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Visita registrada com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.RecordVisitResponse"
                        }
                    },
                    "400": {
                        "description": "Requisição inválida",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Loja não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/store/analytics": {
            "get": {
                "description": "Returns aggregated store visits, orders and conversion metrics for charts and KPIs",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Get store performance analytics",
                "parameters": [
                    {
                        "type": "string",
                        "default": "week",
                        "description": "Period ('week', 'month', 'custom')",
                        "name": "period",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start Date in YYYY-MM-DD format (for custom period)",
                        "name": "start_date",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End Date in YYYY-MM-DD format (for custom period)",
                        "name": "end_date",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Métricas da vitrine agregadas",
                        "schema": {
                            "$ref": "#/definitions/models.StoreAnalyticsResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/store/analytics/categories": {
            "get": {
                "description": "Returns revenue and volume distribution across product categories with optional date filtering",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Get category sales mix",
                "parameters": [
                    {
                        "type": "string",
                        "default": "all",
                        "description": "Period ('all', 'week', 'month', 'custom')",
                        "name": "period",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start Date in YYYY-MM-DD format (for custom period)",
                        "name": "start_date",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End Date in YYYY-MM-DD format (for custom period)",
                        "name": "end_date",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Mix de vendas por categoria",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.CategorySalesResponseItem"
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/store/analytics/top-products": {
            "get": {
                "description": "Returns ranking of top selling products in the store with optional date filtering",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Get top selling products",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Maximum items to return (default: 5)",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Period preset: all (default), week, month, custom",
                        "name": "period",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Start date for custom period (YYYY-MM-DD)",
                        "name": "start_date",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "End date for custom period (YYYY-MM-DD)",
                        "name": "end_date",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Top produtos mais vendidos",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.TopProductResponseItem"
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/store/customizer-data": {
            "get": {
                "description": "Returns store, categories, and sample active products in a single call for the store customizer view",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Get centralized customizer preview data",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.StoreCustomizerDataResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/store/me": {
            "get": {
                "description": "Returns current authenticated merchant's store details for the customizer view",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Get merchant store details",
                "responses": {
                    "200": {
                        "description": "Dados da loja do comerciante autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.Store"
                        }
                    },
                    "401": {
                        "description": "Sessão inválida ou expirada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Updates store presentation, banner, logo, slug and publish status",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "store"
                ],
                "summary": "Update merchant store customizer details",
                "parameters": [
                    {
                        "description": "Dados de personalização da loja",
                        "name": "input",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateStoreInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Loja atualizada com sucesso",
                        "schema": {
                            "$ref": "#/definitions/models.Store"
                        }
                    },
                    "400": {
                        "description": "Dados inválidos ou slug já em uso",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Sessão inválida ou expirada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/subscriptions/checkout": {
            "post": {
                "description": "Generates an Asaas checkout link locked to the merchant UUID via externalReference",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "subscriptions"
                ],
                "summary": "Create checkout session",
                "parameters": [
                    {
                        "description": "Dados do plano desejado",
                        "name": "payload",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.CheckoutRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "URL do checkout gerada",
                        "schema": {
                            "$ref": "#/definitions/models.CheckoutResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/subscriptions/current": {
            "get": {
                "description": "Returns the active subscription plan and expiration for the authenticated merchant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "subscriptions"
                ],
                "summary": "Get current merchant subscription",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.CurrentSubscriptionResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/subscriptions/current/coupon": {
            "post": {
                "description": "Applies a promotional or retention coupon to the merchant's current active subscription, updating recurrent price",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "subscriptions"
                ],
                "summary": "Apply coupon to active subscription",
                "parameters": [
                    {
                        "description": "Código do cupom",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ApplyCouponRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Assinatura atualizada com o desconto",
                        "schema": {
                            "$ref": "#/definitions/models.Subscription"
                        }
                    },
                    "400": {
                        "description": "Cupom inválido ou expirado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/subscriptions/history": {
            "get": {
                "description": "Returns the history of plans, dates, values and Asaas invoice links",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "subscriptions"
                ],
                "summary": "Get merchant subscription and invoices history",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.SubscriptionsHistoryResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/subscriptions/{uuid}/cancel": {
            "post": {
                "description": "Cancels an active subscription",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "subscriptions"
                ],
                "summary": "Cancel merchant subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subscription UUID",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.MessageResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Assinatura não encontrada",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/upload/image": {
            "post": {
                "description": "Uploads an image file to merchant storage ({merchant_id}/{folder}/) and returns public URL",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "upload"
                ],
                "summary": "Upload image to merchant storage folder",
                "parameters": [
                    {
                        "type": "file",
                        "description": "Image file (JPEG, PNG, WEBP, GIF, max 5MB)",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Subpasta de destino ('store', 'products'; padrão: 'products')",
                        "name": "folder",
                        "in": "query"
                    }
                ],
                "responses": {
                    "201": {
                        "description": "URL da imagem salva",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Arquivo inválido ou ausente",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro ao processar arquivo",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/webhooks/asaas": {
            "post": {
                "description": "Receives asynchronous payment and subscription lifecycle events from Asaas gateway",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "webhooks"
                ],
                "summary": "Process Asaas Webhooks",
                "responses": {
                    "200": {
                        "description": "Status de recebimento",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Payload inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Token do webhook inválido",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Erro interno do servidor",
                        "schema": {
                            "$ref": "#/definitions/models.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.ApplyCouponRequest": {
            "type": "object",
            "required": [
                "code"
            ],
            "properties": {
                "code": {
                    "type": "string"
                }
            }
        },
        "models.AnnualPlanningResponse": {
            "type": "object",
            "properties": {
                "annual_goal": {
                    "$ref": "#/definitions/models.SalesGoalSummary"
                },
                "annual_percentage": {
                    "type": "integer"
                },
                "monthly_goals": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.SalesGoalSummary"
                    }
                },
                "total_actual_cents": {
                    "type": "integer"
                },
                "total_target_cents": {
                    "type": "integer"
                },
                "year": {
                    "type": "integer"
                }
            }
        },
        "models.Category": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "display_order": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "merchant_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "product_count": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.CategoryListResponse": {
            "type": "object",
            "properties": {
                "categories": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Category"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "page": {
                    "type": "integer"
                },
                "total_count": {
                    "type": "integer"
                },
                "total_pages": {
                    "type": "integer"
                }
            }
        },
        "models.CategorySalesResponseItem": {
            "type": "object",
            "properties": {
                "bg_light": {
                    "type": "string"
                },
                "color": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "items_sold": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "orders_count": {
                    "type": "integer"
                },
                "percentage": {
                    "type": "integer"
                },
                "revenue": {
                    "type": "number"
                },
                "revenue_cents": {
                    "type": "integer"
                }
            }
        },
        "models.CheckoutRequest": {
            "type": "object",
            "properties": {
                "coupon_code": {
                    "type": "string"
                },
                "plan_id": {
                    "type": "string"
                }
            }
        },
        "models.CheckoutResponse": {
            "type": "object",
            "properties": {
                "checkout_url": {
                    "type": "string"
                },
                "plan_id": {
                    "type": "string"
                }
            }
        },
        "models.ConfirmEmailChangeRequest": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "token": {
                    "type": "string"
                }
            }
        },
        "models.Coupon": {
            "type": "object",
            "properties": {
                "allow_recreated_accounts": {
                    "description": "se false, bloqueia lojistas com histórico em account_cancellations",
                    "type": "boolean"
                },
                "code": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "discount_type": {
                    "description": "'percentage' ou 'fixed'",
                    "type": "string"
                },
                "discount_value": {
                    "description": "percentual (ex: 20 = 20%) ou valor fixo em centavos (ex: 1000 = R$ 10,00)",
                    "type": "integer"
                },
                "expires_at": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "is_archived": {
                    "type": "boolean"
                },
                "is_permanent": {
                    "type": "boolean"
                },
                "max_uses": {
                    "type": "integer"
                },
                "max_uses_per_user": {
                    "type": "integer"
                },
                "target_audience": {
                    "description": "'all', 'new_customers_only', 'returning_only'",
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "uses_count": {
                    "type": "integer"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.CreateCategoryRequest": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "description": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "models.CreateCouponRequest": {
            "type": "object",
            "properties": {
                "allow_recreated_accounts": {
                    "type": "boolean"
                },
                "code": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "discount_type": {
                    "description": "'percentage' ou 'fixed'",
                    "type": "string"
                },
                "discount_value": {
                    "description": "20 para 20%, ou 1000 para R$ 10,00",
                    "type": "integer"
                },
                "expires_at": {
                    "type": "string"
                },
                "is_permanent": {
                    "type": "boolean"
                },
                "max_uses": {
                    "type": "integer"
                },
                "max_uses_per_user": {
                    "type": "integer"
                },
                "target_audience": {
                    "type": "string"
                }
            }
        },
        "models.CreateManualOrderRequest": {
            "type": "object",
            "required": [
                "customer_name",
                "customer_phone",
                "delivery_type",
                "items",
                "payment_method",
                "status"
            ],
            "properties": {
                "change_for_cents": {
                    "type": "integer"
                },
                "customer_email": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "customer_phone": {
                    "type": "string"
                },
                "delivery_address": {
                    "type": "string"
                },
                "delivery_city": {
                    "type": "string"
                },
                "delivery_complement": {
                    "type": "string"
                },
                "delivery_neighborhood": {
                    "type": "string"
                },
                "delivery_number": {
                    "type": "string"
                },
                "delivery_postal_code": {
                    "type": "string"
                },
                "delivery_reference": {
                    "type": "string"
                },
                "delivery_state": {
                    "type": "string"
                },
                "delivery_street": {
                    "type": "string"
                },
                "delivery_type": {
                    "type": "string",
                    "enum": [
                        "delivery",
                        "pickup"
                    ]
                },
                "installment_cents": {
                    "type": "integer"
                },
                "installments": {
                    "type": "integer"
                },
                "items": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/models.CreatePublicOrderItemInput"
                    }
                },
                "notes": {
                    "type": "string"
                },
                "payment_method": {
                    "type": "string",
                    "enum": [
                        "pix",
                        "card",
                        "cash",
                        "other"
                    ]
                },
                "shipping_cents": {
                    "type": "integer",
                    "minimum": 0
                },
                "status": {
                    "enum": [
                        "in_progress",
                        "completed"
                    ],
                    "allOf": [
                        {
                            "$ref": "#/definitions/models.OrderStatus"
                        }
                    ]
                }
            }
        },
        "models.CreateProductRequest": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "allow_installments": {
                    "type": "boolean"
                },
                "category_id": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "free_installments": {
                    "type": "integer"
                },
                "has_variants": {
                    "type": "boolean"
                },
                "images": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "max_installments": {
                    "type": "integer"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "min_stock_alert": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "options": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductOption"
                    }
                },
                "price_cents": {
                    "type": "integer"
                },
                "promotional_price_cents": {
                    "type": "integer"
                },
                "sku": {
                    "type": "string"
                },
                "stock_quantity": {
                    "type": "integer"
                },
                "track_stock": {
                    "type": "boolean"
                },
                "variants": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductVariantInput"
                    }
                }
            }
        },
        "models.CreatePublicOrderItemInput": {
            "type": "object",
            "required": [
                "product_id",
                "quantity"
            ],
            "properties": {
                "product_id": {
                    "type": "string"
                },
                "quantity": {
                    "type": "integer",
                    "minimum": 1
                },
                "variant_id": {
                    "type": "string"
                }
            }
        },
        "models.CreatePublicOrderRequest": {
            "type": "object",
            "required": [
                "customer_name",
                "customer_phone",
                "delivery_type",
                "items",
                "payment_method"
            ],
            "properties": {
                "change_for_cents": {
                    "type": "integer"
                },
                "customer_email": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "customer_phone": {
                    "type": "string"
                },
                "delivery_address": {
                    "type": "string"
                },
                "delivery_city": {
                    "type": "string"
                },
                "delivery_complement": {
                    "type": "string"
                },
                "delivery_neighborhood": {
                    "type": "string"
                },
                "delivery_number": {
                    "type": "string"
                },
                "delivery_postal_code": {
                    "type": "string"
                },
                "delivery_reference": {
                    "type": "string"
                },
                "delivery_state": {
                    "type": "string"
                },
                "delivery_street": {
                    "type": "string"
                },
                "delivery_type": {
                    "type": "string",
                    "enum": [
                        "delivery",
                        "pickup"
                    ]
                },
                "expected_subtotal_cents": {
                    "type": "integer"
                },
                "installment_cents": {
                    "type": "integer"
                },
                "installments": {
                    "type": "integer"
                },
                "items": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/models.CreatePublicOrderItemInput"
                    }
                },
                "notes": {
                    "type": "string"
                },
                "payment_method": {
                    "type": "string",
                    "enum": [
                        "pix",
                        "card",
                        "cash",
                        "other"
                    ]
                }
            }
        },
        "models.CurrentSubscriptionResponse": {
            "type": "object",
            "properties": {
                "has_active": {
                    "type": "boolean"
                },
                "has_history": {
                    "type": "boolean"
                },
                "has_pending": {
                    "type": "boolean"
                },
                "pending_subscription": {
                    "$ref": "#/definitions/models.Subscription"
                },
                "subscription": {
                    "$ref": "#/definitions/models.Subscription"
                }
            }
        },
        "models.DailyMetricItem": {
            "type": "object",
            "properties": {
                "date": {
                    "type": "string"
                },
                "day_label": {
                    "type": "string"
                },
                "height_orders": {
                    "type": "integer"
                },
                "height_visits": {
                    "type": "integer"
                },
                "highlight": {
                    "type": "boolean"
                },
                "orders_count": {
                    "type": "integer"
                },
                "revenue_cents": {
                    "type": "integer"
                },
                "unique_visitors": {
                    "type": "integer"
                },
                "visits": {
                    "type": "integer"
                }
            }
        },
        "models.DaySchedule": {
            "type": "object",
            "properties": {
                "close_time": {
                    "description": "\"18:00\"",
                    "type": "string"
                },
                "day": {
                    "description": "\"seg\", \"ter\", \"qua\", \"qui\", \"sex\", \"sab\", \"dom\"",
                    "type": "string"
                },
                "is_open": {
                    "description": "se o estabelecimento funciona neste dia",
                    "type": "boolean"
                },
                "label": {
                    "description": "\"Segunda-feira\", etc.",
                    "type": "string"
                },
                "open_time": {
                    "description": "\"08:00\"",
                    "type": "string"
                }
            }
        },
        "models.DeleteAccountRequest": {
            "type": "object",
            "properties": {
                "feedback_text": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                },
                "rating": {
                    "type": "number"
                },
                "reason_category": {
                    "type": "string"
                }
            }
        },
        "models.ErrorResponse": {
            "type": "object",
            "properties": {
                "error": {
                    "type": "string"
                }
            }
        },
        "models.ForgotPasswordRequest": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                }
            }
        },
        "models.LoginRequest": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                }
            }
        },
        "models.MarkGoalCelebratedResponse": {
            "type": "object",
            "properties": {
                "celebrated_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "models.MeResponse": {
            "type": "object",
            "properties": {
                "access_until": {
                    "type": "string"
                },
                "client_uuid": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "email_verified": {
                    "type": "boolean"
                },
                "email_verified_at": {
                    "type": "string"
                },
                "merchant_uuid": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "pending_email": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                },
                "store": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreItem"
                    }
                },
                "store_name": {
                    "type": "string"
                },
                "subscription": {
                    "$ref": "#/definitions/models.CurrentSubscriptionResponse"
                }
            }
        },
        "models.MessageResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        },
        "models.Order": {
            "type": "object",
            "properties": {
                "cancellation_reason": {
                    "type": "string"
                },
                "cancelled_at": {
                    "type": "string"
                },
                "change_for_cents": {
                    "type": "integer"
                },
                "completed_at": {
                    "type": "string"
                },
                "confirmed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "customer_email": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "customer_phone": {
                    "type": "string"
                },
                "delivery_address": {
                    "type": "string"
                },
                "delivery_city": {
                    "type": "string"
                },
                "delivery_complement": {
                    "type": "string"
                },
                "delivery_neighborhood": {
                    "type": "string"
                },
                "delivery_number": {
                    "type": "string"
                },
                "delivery_postal_code": {
                    "type": "string"
                },
                "delivery_reference": {
                    "type": "string"
                },
                "delivery_state": {
                    "type": "string"
                },
                "delivery_street": {
                    "type": "string"
                },
                "delivery_type": {
                    "type": "string"
                },
                "discount_cents": {
                    "type": "integer"
                },
                "installment_cents": {
                    "type": "integer"
                },
                "installments": {
                    "type": "integer"
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.OrderItem"
                    }
                },
                "merchant_id": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "order_number": {
                    "type": "integer"
                },
                "payment_method": {
                    "type": "string"
                },
                "shipping_cents": {
                    "type": "integer"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/models.OrderStatus"
                },
                "subtotal_cents": {
                    "type": "integer"
                },
                "total_cents": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.OrderItem": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "image_url": {
                    "type": "string"
                },
                "order_id": {
                    "type": "string"
                },
                "product_id": {
                    "type": "string"
                },
                "product_name": {
                    "type": "string"
                },
                "quantity": {
                    "type": "integer"
                },
                "subtotal_cents": {
                    "type": "integer"
                },
                "unit_price_cents": {
                    "type": "integer"
                },
                "uuid": {
                    "type": "string"
                },
                "variant_id": {
                    "type": "string"
                },
                "variant_name": {
                    "type": "string"
                }
            }
        },
        "models.OrderListResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer"
                },
                "orders": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Order"
                    }
                },
                "page": {
                    "type": "integer"
                },
                "total_count": {
                    "type": "integer"
                },
                "total_pages": {
                    "type": "integer"
                }
            }
        },
        "models.OrderMetricsResponse": {
            "type": "object",
            "properties": {
                "completed_today_count": {
                    "type": "integer"
                },
                "in_progress_count": {
                    "type": "integer"
                },
                "orders_growth_percent": {
                    "type": "number"
                },
                "pending_count": {
                    "type": "integer"
                },
                "revenue_cents_month": {
                    "type": "integer"
                },
                "revenue_cents_prev_month": {
                    "type": "integer"
                },
                "revenue_growth_percent": {
                    "type": "number"
                },
                "total_orders_month": {
                    "type": "integer"
                },
                "total_orders_prev_month": {
                    "type": "integer"
                }
            }
        },
        "models.OrderStatus": {
            "type": "string",
            "enum": [
                "pending",
                "in_progress",
                "completed",
                "cancelled"
            ],
            "x-enum-varnames": [
                "OrderStatusPending",
                "OrderStatusInProgress",
                "OrderStatusCompleted",
                "OrderStatusCancelled"
            ]
        },
        "models.Plan": {
            "type": "object",
            "properties": {
                "asaas_id": {
                    "type": "string"
                },
                "badge": {
                    "type": "string"
                },
                "billing_cycle": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "display_order": {
                    "type": "integer"
                },
                "duration_days": {
                    "type": "integer"
                },
                "features": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "payment_url": {
                    "type": "string"
                },
                "price_cents": {
                    "type": "integer"
                },
                "price_formatted": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.PlanMetric": {
            "type": "object",
            "properties": {
                "active_subscribers": {
                    "type": "integer"
                },
                "monthly_revenue_cents": {
                    "type": "integer"
                },
                "plan_id": {
                    "type": "string"
                },
                "plan_name": {
                    "type": "string"
                },
                "revenue_formatted": {
                    "type": "string"
                },
                "total_subscribers": {
                    "type": "integer"
                }
            }
        },
        "models.PlanMetricsResponse": {
            "type": "object",
            "properties": {
                "metrics": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.PlanMetric"
                    }
                },
                "total_active_clients": {
                    "type": "integer"
                },
                "total_revenue_cents": {
                    "type": "integer"
                },
                "total_revenue_formatted": {
                    "type": "string"
                }
            }
        },
        "models.PlansResponse": {
            "type": "object",
            "properties": {
                "plans": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Plan"
                    }
                }
            }
        },
        "models.Product": {
            "type": "object",
            "properties": {
                "allow_installments": {
                    "type": "boolean"
                },
                "category_id": {
                    "type": "string"
                },
                "category_name": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "display_order": {
                    "type": "integer"
                },
                "free_installments": {
                    "type": "integer"
                },
                "has_variants": {
                    "type": "boolean"
                },
                "images": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "is_active": {
                    "type": "boolean"
                },
                "max_installments": {
                    "type": "integer"
                },
                "merchant_id": {
                    "type": "string"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "min_stock_alert": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "options": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductOption"
                    }
                },
                "price_cents": {
                    "type": "integer"
                },
                "promotional_price_cents": {
                    "type": "integer"
                },
                "sku": {
                    "type": "string"
                },
                "stock_quantity": {
                    "type": "integer"
                },
                "track_stock": {
                    "type": "boolean"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                },
                "variants": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductVariant"
                    }
                }
            }
        },
        "models.ProductListResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer"
                },
                "page": {
                    "type": "integer"
                },
                "products": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Product"
                    }
                },
                "total_count": {
                    "type": "integer"
                },
                "total_pages": {
                    "type": "integer"
                }
            }
        },
        "models.ProductOption": {
            "type": "object",
            "properties": {
                "color_map": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "position": {
                    "type": "integer"
                },
                "values": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "models.ProductVariant": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "display_order": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "merchant_id": {
                    "type": "string"
                },
                "min_stock_alert": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "option1": {
                    "type": "string"
                },
                "option2": {
                    "type": "string"
                },
                "option3": {
                    "type": "string"
                },
                "price_cents": {
                    "type": "integer"
                },
                "product_id": {
                    "type": "string"
                },
                "promotional_price_cents": {
                    "type": "integer"
                },
                "sku": {
                    "type": "string"
                },
                "stock_quantity": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.ProductVariantInput": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "display_order": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "min_stock_alert": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "option1": {
                    "type": "string"
                },
                "option2": {
                    "type": "string"
                },
                "option3": {
                    "type": "string"
                },
                "price_cents": {
                    "type": "integer"
                },
                "promotional_price_cents": {
                    "type": "integer"
                },
                "sku": {
                    "type": "string"
                },
                "stock_quantity": {
                    "type": "integer"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.ProfileResponse": {
            "type": "object",
            "properties": {
                "access_until": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "email_verified": {
                    "type": "boolean"
                },
                "email_verified_at": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "pending_email": {
                    "type": "string"
                },
                "segment": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                },
                "store": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreItem"
                    }
                },
                "store_name": {
                    "type": "string"
                },
                "telephone": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.PublicOrderCreatedResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                },
                "order_number": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                },
                "store_name": {
                    "type": "string"
                },
                "store_phone": {
                    "type": "string"
                },
                "tracking_url": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.PublicStoreResponse": {
            "type": "object",
            "properties": {
                "about_text": {
                    "type": "string"
                },
                "accepted_payment_methods": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "allow_installments": {
                    "type": "boolean"
                },
                "announcement_text": {
                    "type": "string"
                },
                "banners": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "business_hours": {
                    "type": "string"
                },
                "business_hours_schedule": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.DaySchedule"
                    }
                },
                "cash_discount_percent": {
                    "type": "number"
                },
                "categories": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Category"
                    }
                },
                "description": {
                    "type": "string"
                },
                "free_installments": {
                    "type": "integer"
                },
                "is_published": {
                    "type": "boolean"
                },
                "logo": {
                    "type": "string"
                },
                "max_installments": {
                    "type": "integer"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "primary_color": {
                    "type": "string"
                },
                "products": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Product"
                    }
                },
                "secondary_color": {
                    "type": "string"
                },
                "sections": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreSection"
                    }
                },
                "segment": {
                    "type": "string"
                },
                "show_announcement": {
                    "type": "boolean"
                },
                "show_business_hours": {
                    "type": "boolean"
                },
                "slug": {
                    "type": "string"
                },
                "social_links": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.SocialLink"
                    }
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.RecordVisitRequest": {
            "type": "object",
            "properties": {
                "is_unique": {
                    "type": "boolean"
                }
            }
        },
        "models.RecordVisitResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                }
            }
        },
        "models.RegisterRequest": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "password": {
                    "type": "string"
                },
                "segment": {
                    "type": "string"
                },
                "slug": {
                    "description": "suportado para compatibilidade",
                    "type": "string"
                },
                "store": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreItem"
                    }
                },
                "store_name": {
                    "description": "suportado para compatibilidade",
                    "type": "string"
                },
                "telephone": {
                    "type": "string"
                }
            }
        },
        "models.ReorderCategoriesRequest": {
            "type": "object",
            "required": [
                "category_ids"
            ],
            "properties": {
                "category_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "models.ReorderProductsRequest": {
            "type": "object",
            "required": [
                "product_ids"
            ],
            "properties": {
                "product_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "models.ResendOTPRequest": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                }
            }
        },
        "models.SalesGoalStatus": {
            "type": "string",
            "enum": [
                "no_goal",
                "planned",
                "in_progress",
                "achieved",
                "missed"
            ],
            "x-enum-varnames": [
                "SalesGoalStatusNoGoal",
                "SalesGoalStatusPlanned",
                "SalesGoalStatusInProgress",
                "SalesGoalStatusAchieved",
                "SalesGoalStatusMissed"
            ]
        },
        "models.SalesGoalSummary": {
            "type": "object",
            "properties": {
                "actual_cents": {
                    "type": "integer"
                },
                "celebrated_at": {
                    "type": "string"
                },
                "current_daily_average_cents": {
                    "type": "integer"
                },
                "daily_run_rate_cents": {
                    "type": "integer"
                },
                "days_remaining": {
                    "type": "integer"
                },
                "month": {
                    "type": "integer"
                },
                "month_name": {
                    "type": "string"
                },
                "percentage": {
                    "type": "integer"
                },
                "period_type": {
                    "type": "string"
                },
                "projected_cents": {
                    "type": "integer"
                },
                "remaining_cents": {
                    "type": "integer"
                },
                "should_celebrate": {
                    "type": "boolean"
                },
                "status": {
                    "$ref": "#/definitions/models.SalesGoalStatus"
                },
                "target_cents": {
                    "type": "integer"
                },
                "uuid": {
                    "type": "string"
                },
                "year": {
                    "type": "integer"
                }
            }
        },
        "models.SocialLink": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "identificador único (ex: \"link-1\")",
                    "type": "string"
                },
                "platform": {
                    "description": "\"instagram\", \"facebook\", \"tiktok\", \"youtube\", \"whatsapp\", \"twitter\", \"website\", etc.",
                    "type": "string"
                },
                "url": {
                    "description": "URL de destino",
                    "type": "string"
                }
            }
        },
        "models.Store": {
            "type": "object",
            "properties": {
                "about_text": {
                    "type": "string"
                },
                "accepted_payment_methods": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "allow_installments": {
                    "type": "boolean"
                },
                "announcement_text": {
                    "type": "string"
                },
                "banners": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "business_hours": {
                    "type": "string"
                },
                "business_hours_schedule": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.DaySchedule"
                    }
                },
                "cash_discount_percent": {
                    "type": "number"
                },
                "created_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "free_installments": {
                    "type": "integer"
                },
                "is_published": {
                    "type": "boolean"
                },
                "logo": {
                    "type": "string"
                },
                "max_installments": {
                    "type": "integer"
                },
                "merchant_id": {
                    "type": "string"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "primary_color": {
                    "type": "string"
                },
                "secondary_color": {
                    "type": "string"
                },
                "sections": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreSection"
                    }
                },
                "segment": {
                    "type": "string"
                },
                "show_announcement": {
                    "type": "boolean"
                },
                "show_business_hours": {
                    "type": "boolean"
                },
                "slug": {
                    "type": "string"
                },
                "social_links": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.SocialLink"
                    }
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.StoreAnalyticsResponse": {
            "type": "object",
            "properties": {
                "conversion_rate": {
                    "type": "number"
                },
                "daily_metrics": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.DailyMetricItem"
                    }
                },
                "end_date": {
                    "type": "string"
                },
                "period": {
                    "type": "string"
                },
                "start_date": {
                    "type": "string"
                },
                "total_orders_month": {
                    "type": "integer"
                },
                "total_period_orders": {
                    "type": "integer"
                },
                "total_period_revenue_cents": {
                    "type": "integer"
                },
                "total_period_visits": {
                    "type": "integer"
                },
                "total_visits_month": {
                    "type": "integer"
                },
                "total_visits_prev_month": {
                    "type": "integer"
                },
                "unique_visitors_month": {
                    "type": "integer"
                },
                "visits_growth_percent": {
                    "type": "number"
                }
            }
        },
        "models.StoreCustomizerDataResponse": {
            "type": "object",
            "properties": {
                "categories": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Category"
                    }
                },
                "products": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Product"
                    }
                },
                "store": {
                    "$ref": "#/definitions/models.Store"
                }
            }
        },
        "models.StoreItem": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                }
            }
        },
        "models.StoreSection": {
            "type": "object",
            "properties": {
                "content": {
                    "description": "Conteúdo em texto rico / HTML (com suporte a tópicos/listas)",
                    "type": "string"
                },
                "display_position": {
                    "description": "\"before_products\" ou \"after_products\" (padrão \"after_products\")",
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "image_position": {
                    "description": "\"left\" ou \"right\" (padrão \"right\")",
                    "type": "string"
                },
                "image_url": {
                    "description": "Imagem opcional da seção",
                    "type": "string"
                },
                "is_active": {
                    "description": "Se a seção está ativa/visível",
                    "type": "boolean"
                },
                "order": {
                    "description": "Ordem de exibição",
                    "type": "integer"
                },
                "title": {
                    "description": "Título customizado (ex: \"Sobre a Loja\", \"Nossa História\")",
                    "type": "string"
                },
                "type": {
                    "description": "ex: \"about\", \"custom\"",
                    "type": "string"
                }
            }
        },
        "models.Subscription": {
            "type": "object",
            "properties": {
                "asaas_payment_id": {
                    "type": "string"
                },
                "asaas_subscription_id": {
                    "type": "string"
                },
                "billing_cycle": {
                    "type": "string"
                },
                "billing_type": {
                    "type": "string"
                },
                "cancelled_at": {
                    "type": "string"
                },
                "coupon_code": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "discount_cents": {
                    "type": "integer"
                },
                "discount_formatted": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "invoice_number": {
                    "type": "string"
                },
                "invoice_url": {
                    "type": "string"
                },
                "merchant_uuid": {
                    "type": "string"
                },
                "original_price_cents": {
                    "type": "integer"
                },
                "original_price_formatted": {
                    "type": "string"
                },
                "plan_id": {
                    "type": "string"
                },
                "plan_name": {
                    "type": "string"
                },
                "price_cents": {
                    "type": "integer"
                },
                "price_formatted": {
                    "type": "string"
                },
                "raw_payload": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "starts_at": {
                    "type": "string"
                },
                "status": {
                    "description": "'active', 'trial', 'cancelled', 'expired'",
                    "type": "string"
                },
                "status_reason": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "uuid": {
                    "type": "string"
                }
            }
        },
        "models.SubscriptionsHistoryResponse": {
            "type": "object",
            "properties": {
                "subscriptions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Subscription"
                    }
                }
            }
        },
        "models.TopProductResponseItem": {
            "type": "object",
            "properties": {
                "category": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "image_url": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "percentage": {
                    "type": "integer"
                },
                "revenue": {
                    "type": "number"
                },
                "revenue_cents": {
                    "type": "integer"
                },
                "sold_count": {
                    "type": "integer"
                }
            }
        },
        "models.TrackOrderRequest": {
            "type": "object",
            "required": [
                "order_number",
                "phone_last4"
            ],
            "properties": {
                "order_number": {
                    "type": "integer"
                },
                "phone_last4": {
                    "type": "string"
                }
            }
        },
        "models.UpdateCategoryRequest": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "description": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "models.UpdateOrderShippingRequest": {
            "type": "object",
            "properties": {
                "shipping_cents": {
                    "type": "integer",
                    "minimum": 0
                }
            }
        },
        "models.UpdateOrderStatusRequest": {
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "cancellation_reason": {
                    "type": "string"
                },
                "status": {
                    "enum": [
                        "in_progress",
                        "completed",
                        "cancelled"
                    ],
                    "allOf": [
                        {
                            "$ref": "#/definitions/models.OrderStatus"
                        }
                    ]
                }
            }
        },
        "models.UpdateProductRequest": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "allow_installments": {
                    "type": "boolean"
                },
                "category_id": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "free_installments": {
                    "type": "integer"
                },
                "has_variants": {
                    "type": "boolean"
                },
                "images": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "is_active": {
                    "type": "boolean"
                },
                "max_installments": {
                    "type": "integer"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "min_stock_alert": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "options": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductOption"
                    }
                },
                "price_cents": {
                    "type": "integer"
                },
                "promotional_price_cents": {
                    "type": "integer"
                },
                "sku": {
                    "type": "string"
                },
                "stock_quantity": {
                    "type": "integer"
                },
                "track_stock": {
                    "type": "boolean"
                },
                "variants": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.ProductVariantInput"
                    }
                }
            }
        },
        "models.UpdateProfileRequest": {
            "type": "object",
            "properties": {
                "current_password": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "new_password": {
                    "type": "string"
                },
                "segment": {
                    "type": "string"
                },
                "slug": {
                    "type": "string"
                },
                "store": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreItem"
                    }
                },
                "store_name": {
                    "type": "string"
                },
                "telephone": {
                    "type": "string"
                }
            }
        },
        "models.UpdateStockRequest": {
            "type": "object",
            "properties": {
                "stock_quantity": {
                    "type": "integer"
                },
                "variants": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.VariantStockAdjustment"
                    }
                }
            }
        },
        "models.UpdateStoreInput": {
            "type": "object",
            "properties": {
                "about_text": {
                    "type": "string"
                },
                "accepted_payment_methods": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "allow_installments": {
                    "type": "boolean"
                },
                "announcement_text": {
                    "type": "string"
                },
                "banners": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "business_hours": {
                    "type": "string"
                },
                "business_hours_schedule": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.DaySchedule"
                    }
                },
                "cash_discount_percent": {
                    "type": "number"
                },
                "description": {
                    "type": "string"
                },
                "free_installments": {
                    "type": "integer"
                },
                "is_published": {
                    "type": "boolean"
                },
                "logo": {
                    "type": "string"
                },
                "max_installments": {
                    "type": "integer"
                },
                "min_installment_cents": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "primary_color": {
                    "type": "string"
                },
                "secondary_color": {
                    "type": "string"
                },
                "sections": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StoreSection"
                    }
                },
                "segment": {
                    "type": "string"
                },
                "show_announcement": {
                    "type": "boolean"
                },
                "show_business_hours": {
                    "type": "boolean"
                },
                "slug": {
                    "type": "string"
                },
                "social_links": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.SocialLink"
                    }
                }
            }
        },
        "models.UpsertAnnualGoalRequest": {
            "type": "object",
            "required": [
                "target_cents",
                "year"
            ],
            "properties": {
                "custom_monthly_targets": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "distribute_equally": {
                    "type": "boolean"
                },
                "target_cents": {
                    "type": "integer",
                    "minimum": 100
                },
                "year": {
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 2020
                }
            }
        },
        "models.UpsertMonthGoalRequest": {
            "type": "object",
            "required": [
                "month",
                "target_cents",
                "year"
            ],
            "properties": {
                "month": {
                    "type": "integer",
                    "maximum": 12,
                    "minimum": 1
                },
                "target_cents": {
                    "type": "integer",
                    "minimum": 100
                },
                "year": {
                    "type": "integer",
                    "maximum": 2100,
                    "minimum": 2020
                }
            }
        },
        "models.ValidateCouponRequest": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "plan_id": {
                    "type": "string"
                }
            }
        },
        "models.ValidateCouponResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "discount_cents": {
                    "type": "integer"
                },
                "discount_type": {
                    "type": "string"
                },
                "discount_value": {
                    "type": "integer"
                },
                "final_price_cents": {
                    "type": "integer"
                },
                "formatted_discount": {
                    "type": "string"
                },
                "formatted_final": {
                    "type": "string"
                },
                "formatted_original": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "original_price_cents": {
                    "type": "integer"
                },
                "valid": {
                    "type": "boolean"
                }
            }
        },
        "models.VariantStockAdjustment": {
            "type": "object",
            "properties": {
                "stock_quantity": {
                    "type": "integer"
                },
                "variant_uuid": {
                    "type": "string"
                }
            }
        },
        "models.VerifyOTPRequest": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                }
            }
        },
        "models.VerifyTokenRequest": {
            "type": "object",
            "properties": {
                "token": {
                    "type": "string"
                }
            }
        }
    }
}