2317 lines
74 KiB
Go
2317 lines
74 KiB
Go
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {
|
|
"name": "Engenharia SaveInMed",
|
|
"email": "devops@saveinmed.com"
|
|
},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/api/v1/auth/login": {
|
|
"post": {
|
|
"description": "Autentica usuário e retorna token JWT.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Autenticação"
|
|
],
|
|
"summary": "Login",
|
|
"parameters": [
|
|
{
|
|
"description": "Credenciais",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.loginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.authResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/auth/register": {
|
|
"post": {
|
|
"description": "Cria um usuário e opcionalmente uma empresa, retornando token JWT.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Autenticação"
|
|
],
|
|
"summary": "Cadastro de usuário",
|
|
"parameters": [
|
|
{
|
|
"description": "Dados do usuário e empresa",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.registerAuthRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.authResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/cart": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Carrinho"
|
|
],
|
|
"summary": "Obter carrinho",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.CartSummary"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Carrinho"
|
|
],
|
|
"summary": "Adicionar item ao carrinho",
|
|
"parameters": [
|
|
{
|
|
"description": "Item do carrinho",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.addCartItemRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.CartSummary"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/cart/{id}": {
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"tags": [
|
|
"Carrinho"
|
|
],
|
|
"summary": "Remover item do carrinho",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Cart item ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.CartSummary"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/companies": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Lista empresas",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Cadastra farmácia, distribuidora ou administrador com CNPJ e licença sanitária.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Registro de empresas",
|
|
"parameters": [
|
|
{
|
|
"description": "Dados da empresa",
|
|
"name": "company",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.registerCompanyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/companies/me": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Obter minha empresa",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/companies/{id}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Obter empresa",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Remover empresa",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": ""
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Atualizar empresa",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Campos para atualização",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.updateCompanyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/companies/{id}/rating": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Obter avaliação da empresa",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.CompanyRating"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/companies/{id}/verify": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"tags": [
|
|
"Empresas"
|
|
],
|
|
"summary": "Verificar empresa",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Company ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Company"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/dashboard/admin": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Dashboard"
|
|
],
|
|
"summary": "Dashboard do administrador",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.AdminDashboard"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/dashboard/seller": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Dashboard"
|
|
],
|
|
"summary": "Dashboard do vendedor",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Seller ID",
|
|
"name": "seller_id",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.SellerDashboard"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/inventory": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Estoque"
|
|
],
|
|
"summary": "Listar estoque",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Dias para expiração",
|
|
"name": "expires_in_days",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.InventoryItem"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/inventory/adjust": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Estoque"
|
|
],
|
|
"summary": "Ajustar estoque",
|
|
"parameters": [
|
|
{
|
|
"description": "Ajuste de estoque",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.inventoryAdjustRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.InventoryItem"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/orders": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pedidos"
|
|
],
|
|
"summary": "Listar pedidos",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Order"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pedidos"
|
|
],
|
|
"summary": "Criação de pedido com split",
|
|
"parameters": [
|
|
{
|
|
"description": "Pedido",
|
|
"name": "order",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.createOrderRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Order"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/orders/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pedidos"
|
|
],
|
|
"summary": "Consulta pedido",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Order ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Order"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"tags": [
|
|
"Pedidos"
|
|
],
|
|
"summary": "Remover pedido",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Order ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": ""
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/orders/{id}/payment": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pagamentos"
|
|
],
|
|
"summary": "Cria preferência de pagamento Mercado Pago com split nativo",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Order ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.PaymentPreference"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/orders/{id}/status": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pedidos"
|
|
],
|
|
"summary": "Atualiza status do pedido",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Order ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Novo status",
|
|
"name": "status",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.updateStatusRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/payments/webhook": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Pagamentos"
|
|
],
|
|
"summary": "Recebe notificações do Mercado Pago",
|
|
"parameters": [
|
|
{
|
|
"description": "Evento do gateway",
|
|
"name": "notification",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.PaymentWebhookEvent"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.PaymentSplitResult"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/products": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Produtos"
|
|
],
|
|
"summary": "Lista catálogo com lote e validade",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Product"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Produtos"
|
|
],
|
|
"summary": "Cadastro de produto com rastreabilidade de lote",
|
|
"parameters": [
|
|
{
|
|
"description": "Produto",
|
|
"name": "product",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.registerProductRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Product"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/products/{id}": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Produtos"
|
|
],
|
|
"summary": "Obter produto",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Product ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Product"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"Produtos"
|
|
],
|
|
"summary": "Remover produto",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Product ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": ""
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Produtos"
|
|
],
|
|
"summary": "Atualizar produto",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Product ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Campos para atualização",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.updateProductRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Product"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/reviews": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Avaliações"
|
|
],
|
|
"summary": "Criar avaliação",
|
|
"parameters": [
|
|
{
|
|
"description": "Dados da avaliação",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.createReviewRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Review"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/shipments": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Logistica"
|
|
],
|
|
"summary": "Gera guia de postagem/transporte",
|
|
"parameters": [
|
|
{
|
|
"description": "Dados de envio",
|
|
"name": "shipment",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.createShipmentRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Shipment"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/shipments/{order_id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Logistica"
|
|
],
|
|
"summary": "Rastreia entrega",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Order ID",
|
|
"name": "order_id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Shipment"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/users": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Usuários"
|
|
],
|
|
"summary": "Listar usuários",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "Página",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Tamanho da página",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filtro por empresa",
|
|
"name": "company_id",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.UserPage"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Usuários"
|
|
],
|
|
"summary": "Criar usuário",
|
|
"parameters": [
|
|
{
|
|
"description": "Novo usuário",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.createUserRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.User"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/users/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Usuários"
|
|
],
|
|
"summary": "Obter usuário",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.User"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Usuários"
|
|
],
|
|
"summary": "Atualizar usuário",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Campos para atualização",
|
|
"name": "payload",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_http_handler.updateUserRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.User"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"tags": [
|
|
"Usuários"
|
|
],
|
|
"summary": "Excluir usuário",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"github_com_saveinmed_backend-go_internal_domain.AdminDashboard": {
|
|
"type": "object",
|
|
"properties": {
|
|
"gmv_cents": {
|
|
"type": "integer"
|
|
},
|
|
"new_companies": {
|
|
"type": "integer"
|
|
},
|
|
"window_start_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.CartItem": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"buyer_id": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"product_name": {
|
|
"type": "string"
|
|
},
|
|
"quantity": {
|
|
"type": "integer"
|
|
},
|
|
"unit_cents": {
|
|
"type": "integer"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.CartSummary": {
|
|
"type": "object",
|
|
"properties": {
|
|
"discount_cents": {
|
|
"type": "integer"
|
|
},
|
|
"discount_reason": {
|
|
"type": "string"
|
|
},
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.CartItem"
|
|
}
|
|
},
|
|
"subtotal_cents": {
|
|
"type": "integer"
|
|
},
|
|
"total_cents": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.Company": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cnpj": {
|
|
"type": "string"
|
|
},
|
|
"corporate_name": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"license_number": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"description": "pharmacy, distributor, admin",
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.CompanyRating": {
|
|
"type": "object",
|
|
"properties": {
|
|
"average_score": {
|
|
"type": "number"
|
|
},
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"total_reviews": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.InventoryItem": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"price_cents": {
|
|
"type": "integer"
|
|
},
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"quantity": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.Order": {
|
|
"type": "object",
|
|
"properties": {
|
|
"buyer_id": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.OrderItem"
|
|
}
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"shipping": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.ShippingAddress"
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.OrderStatus"
|
|
},
|
|
"total_cents": {
|
|
"type": "integer"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.OrderItem": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"quantity": {
|
|
"type": "integer"
|
|
},
|
|
"unit_cents": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.OrderStatus": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Pendente",
|
|
"Pago",
|
|
"Faturado",
|
|
"Entregue"
|
|
],
|
|
"x-enum-varnames": [
|
|
"OrderStatusPending",
|
|
"OrderStatusPaid",
|
|
"OrderStatusInvoiced",
|
|
"OrderStatusDelivered"
|
|
]
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.PaymentPreference": {
|
|
"type": "object",
|
|
"properties": {
|
|
"commission_pct": {
|
|
"type": "number"
|
|
},
|
|
"gateway": {
|
|
"type": "string"
|
|
},
|
|
"marketplace_fee": {
|
|
"type": "integer"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"payment_url": {
|
|
"type": "string"
|
|
},
|
|
"seller_receivable": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.PaymentSplitResult": {
|
|
"type": "object",
|
|
"properties": {
|
|
"marketplace_fee": {
|
|
"type": "integer"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"payment_id": {
|
|
"type": "string"
|
|
},
|
|
"seller_receivable": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"total_paid_amount": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.PaymentWebhookEvent": {
|
|
"type": "object",
|
|
"properties": {
|
|
"marketplace_fee": {
|
|
"type": "integer"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"payment_id": {
|
|
"type": "string"
|
|
},
|
|
"seller_amount": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"total_paid_amount": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.Product": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"price_cents": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"stock": {
|
|
"type": "integer"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.Review": {
|
|
"type": "object",
|
|
"properties": {
|
|
"buyer_id": {
|
|
"type": "string"
|
|
},
|
|
"comment": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"rating": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.SellerDashboard": {
|
|
"type": "object",
|
|
"properties": {
|
|
"low_stock_alerts": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.Product"
|
|
}
|
|
},
|
|
"orders_count": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"top_products": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.TopProduct"
|
|
}
|
|
},
|
|
"total_sales_cents": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.Shipment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"carrier": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"external_tracking": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"tracking_code": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.ShippingAddress": {
|
|
"type": "object",
|
|
"properties": {
|
|
"city": {
|
|
"type": "string"
|
|
},
|
|
"complement": {
|
|
"type": "string"
|
|
},
|
|
"country": {
|
|
"type": "string"
|
|
},
|
|
"district": {
|
|
"type": "string"
|
|
},
|
|
"number": {
|
|
"type": "string"
|
|
},
|
|
"recipient_name": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"street": {
|
|
"type": "string"
|
|
},
|
|
"zip_code": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.TopProduct": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"revenue_cents": {
|
|
"type": "integer"
|
|
},
|
|
"total_quantity": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_saveinmed_backend-go_internal_domain.UserPage": {
|
|
"type": "object",
|
|
"properties": {
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"page_size": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
},
|
|
"users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.addCartItemRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"quantity": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.authResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.createOrderRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"buyer_id": {
|
|
"type": "string"
|
|
},
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.OrderItem"
|
|
}
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"shipping": {
|
|
"$ref": "#/definitions/github_com_saveinmed_backend-go_internal_domain.ShippingAddress"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.createReviewRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"comment": {
|
|
"type": "string"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"rating": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.createShipmentRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"carrier": {
|
|
"type": "string"
|
|
},
|
|
"external_tracking": {
|
|
"type": "string"
|
|
},
|
|
"order_id": {
|
|
"type": "string"
|
|
},
|
|
"tracking_code": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.createUserRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.inventoryAdjustRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"delta": {
|
|
"type": "integer"
|
|
},
|
|
"product_id": {
|
|
"type": "string"
|
|
},
|
|
"reason": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.loginRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.registerAuthRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company": {
|
|
"$ref": "#/definitions/internal_http_handler.registerCompanyTarget"
|
|
},
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.registerCompanyRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cnpj": {
|
|
"type": "string"
|
|
},
|
|
"corporate_name": {
|
|
"type": "string"
|
|
},
|
|
"license_number": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.registerCompanyTarget": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cnpj": {
|
|
"type": "string"
|
|
},
|
|
"corporate_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"license_number": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.registerProductRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"price_cents": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"stock": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.updateCompanyRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cnpj": {
|
|
"type": "string"
|
|
},
|
|
"corporate_name": {
|
|
"type": "string"
|
|
},
|
|
"is_verified": {
|
|
"type": "boolean"
|
|
},
|
|
"license_number": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.updateProductRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"batch": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"price_cents": {
|
|
"type": "integer"
|
|
},
|
|
"seller_id": {
|
|
"type": "string"
|
|
},
|
|
"stock": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.updateStatusRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_http_handler.updateUserRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_id": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"BearerAuth": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "",
|
|
BasePath: "/",
|
|
Schemes: []string{"http"},
|
|
Title: "SaveInMed Performance Core API",
|
|
Description: "API REST B2B para marketplace farmacêutico com split de pagamento e rastreabilidade.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|