photum/backend/docs/swagger.json
NANDO9322 78c284c28a feat: Implementado a API de backend inicial e a interface de usuário de frontend para autenticação, gerenciamento de usuários e cadastro profissional.
implementação de listagem de usuários admin, padronização de roles e melhorias nos cadastros
Backend:
- Adicionados endpoints administrativos [ListUsers](cci:1://file:///c:/Projetos/photum/backend/internal/auth/service.go:268:0-270:1) e [GetUser](cci:1://file:///c:/Projetos/photum/backend/internal/auth/handler.go:475:0-514:1).
- Padronizadas as constantes de [UserRole](cci:1://file:///c:/Projetos/photum/backend/internal/auth/service.go:202:0-216:1) (`SUPERADMIN`, `BUSINESS_OWNER`, etc.) para alinhar com o frontend.
- Atualizada a função [EnsureDemoUsers](cci:1://file:///c:/Projetos/photum/backend/internal/auth/service.go:230:0-266:1) para migrar usuários existentes para as novas roles.
- Documentação Swagger regenerada.
Frontend:
- Adicionado busca automática de CEP no formulário de Cadastro Profissional (AwesomeAPI).
- Adicionado texto de ajuda e ordenação (priorizando "Não Cadastrado") no select de Empresas.
2025-12-15 11:17:34 -03:00

2732 lines
No EOL
86 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "Backend authentication service for Photum.",
"title": "Photum Backend API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/",
"paths": {
"/api/admin/users": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "List all users (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "List all users",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user with specific role (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Create user (Admin)",
"parameters": [
{
"description": "Create User Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.registerRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/users/pending": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "List users with ativo=false",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "List pending users",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/users/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get user details by ID (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Get user by ID",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"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": []
}
],
"description": "Delete user (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Delete user",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/users/{id}/approve": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Set user ativo=true",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Approve user",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/users/{id}/role": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update user role (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Update user role",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Role Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.updateRoleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/anos-formaturas": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"anos_formaturas"
],
"summary": "List all graduation years",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/anos_formaturas.AnoFormaturaResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"anos_formaturas"
],
"summary": "Create a new graduation year",
"parameters": [
{
"description": "Ano Semestre",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/anos_formaturas.CreateAnoFormaturaRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/anos_formaturas.AnoFormaturaResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/anos-formaturas/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"anos_formaturas"
],
"summary": "Update a graduation year",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Ano Semestre",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/anos_formaturas.CreateAnoFormaturaRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/anos_formaturas.AnoFormaturaResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"anos_formaturas"
],
"summary": "Delete a graduation year",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/api/cadastro-fot": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cadastro_fot"
],
"summary": "List all FOT records",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/cadastro_fot.CadastroFotResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cadastro_fot"
],
"summary": "Create a new FOT record",
"parameters": [
{
"description": "FOT Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/cadastro_fot.CreateInput"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/cadastro_fot.CadastroFotResponse"
}
}
}
}
},
"/api/cadastro-fot/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cadastro_fot"
],
"summary": "Get FOT record by ID",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cadastro_fot.CadastroFotResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cadastro_fot"
],
"summary": "Update FOT record",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/cadastro_fot.CreateInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cadastro_fot.CadastroFotResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cadastro_fot"
],
"summary": "Delete FOT record",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/api/cursos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cursos"
],
"summary": "List all courses",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/cursos.CursoResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cursos"
],
"summary": "Create a new course",
"parameters": [
{
"description": "Curso Name",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/cursos.CreateCursoRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/cursos.CursoResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/cursos/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cursos"
],
"summary": "Update a course",
"parameters": [
{
"type": "string",
"description": "Curso ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Curso Name",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/cursos.CreateCursoRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cursos.CursoResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"cursos"
],
"summary": "Delete a course",
"parameters": [
{
"type": "string",
"description": "Curso ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/api/empresas": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"empresas"
],
"summary": "List all companies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/empresas.EmpresaResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"empresas"
],
"summary": "Create a new company",
"parameters": [
{
"description": "Empresa Name",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/empresas.CreateEmpresaRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/empresas.EmpresaResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/empresas/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"empresas"
],
"summary": "Update a company",
"parameters": [
{
"type": "string",
"description": "Empresa ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Empresa Name",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/empresas.CreateEmpresaRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/empresas.EmpresaResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"empresas"
],
"summary": "Delete a company",
"parameters": [
{
"type": "string",
"description": "Empresa ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/api/funcoes": {
"get": {
"description": "List all professional functions",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"funcoes"
],
"summary": "List functions",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/funcoes.FuncaoResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new professional function",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"funcoes"
],
"summary": "Create a new function",
"parameters": [
{
"description": "Create Function Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/funcoes.CreateFuncaoRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/funcoes.FuncaoResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/funcoes/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update a professional function by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"funcoes"
],
"summary": "Update function",
"parameters": [
{
"type": "string",
"description": "Function ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Function Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/funcoes.CreateFuncaoRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/funcoes.FuncaoResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a professional function by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"funcoes"
],
"summary": "Delete function",
"parameters": [
{
"type": "string",
"description": "Function ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/profissionais": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "List all profissionais",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profissionais"
],
"summary": "List profissionais",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/profissionais.ProfissionalResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new profissional record",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profissionais"
],
"summary": "Create a new profissional",
"parameters": [
{
"description": "Create Profissional Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/profissionais.CreateProfissionalInput"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/profissionais.ProfissionalResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/profissionais/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a profissional by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profissionais"
],
"summary": "Get profissional by ID",
"parameters": [
{
"type": "string",
"description": "Profissional ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/profissionais.ProfissionalResponse"
}
},
"400": {
"description": "Bad Request",
"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"
}
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update a profissional by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profissionais"
],
"summary": "Update profissional",
"parameters": [
{
"type": "string",
"description": "Profissional ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Profissional Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/profissionais.UpdateProfissionalInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/profissionais.ProfissionalResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a profissional by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profissionais"
],
"summary": "Delete profissional",
"parameters": [
{
"type": "string",
"description": "Profissional ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/tipos-eventos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "List all event types",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/tipos_eventos.EventoResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "Create a new event type",
"parameters": [
{
"description": "Nome",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tipos_eventos.CreateEventoRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/tipos_eventos.EventoResponse"
}
}
}
}
},
"/api/tipos-eventos/precos": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "Set price for an event function",
"parameters": [
{
"description": "Price Input",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tipos_eventos.PriceInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/tipos-eventos/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "Update an event type",
"parameters": [
{
"type": "string",
"description": "Event ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Event Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tipos_eventos.CreateEventoRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tipos_eventos.EventoResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "Delete an event type",
"parameters": [
{
"type": "string",
"description": "Event ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/api/tipos-eventos/{id}/precos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_eventos"
],
"summary": "List prices for an event",
"parameters": [
{
"type": "string",
"description": "Event ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/tipos_eventos.PrecoResponse"
}
}
}
}
}
},
"/api/tipos-servicos": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_servicos"
],
"summary": "List all service types",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/tipos_servicos.TipoServicoResponse"
}
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_servicos"
],
"summary": "Create a new service type",
"parameters": [
{
"description": "Nome",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tipos_servicos.CreateTipoServicoRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/tipos_servicos.TipoServicoResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/tipos-servicos/{id}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_servicos"
],
"summary": "Update a service type",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Nome",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/tipos_servicos.CreateTipoServicoRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tipos_servicos.TipoServicoResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"tipos_servicos"
],
"summary": "Delete a service type",
"parameters": [
{
"type": "string",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/auth/login": {
"post": {
"description": "Login with email and password",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Login",
"parameters": [
{
"description": "Login Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.loginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/auth.loginResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/logout": {
"post": {
"description": "Revoke refresh token and clear cookie",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Logout user",
"parameters": [
{
"description": "Refresh Token",
"name": "refresh_token",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/refresh": {
"post": {
"description": "Get a new access token using a valid refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Refresh access token",
"parameters": [
{
"description": "Refresh Token",
"name": "refresh_token",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/auth/register": {
"post": {
"description": "Register a new user with email, password, name, phone and role",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Register a new user",
"parameters": [
{
"description": "Register Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.registerRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"anos_formaturas.AnoFormaturaResponse": {
"type": "object",
"properties": {
"ano_semestre": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
"anos_formaturas.CreateAnoFormaturaRequest": {
"type": "object",
"required": [
"ano_semestre"
],
"properties": {
"ano_semestre": {
"type": "string",
"example": "2029.1"
}
}
},
"auth.loginRequest": {
"type": "object",
"required": [
"email",
"senha"
],
"properties": {
"email": {
"type": "string",
"example": "admin@photum.com"
},
"senha": {
"type": "string",
"minLength": 6,
"example": "123456"
}
}
},
"auth.loginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"profissional": {},
"user": {
"$ref": "#/definitions/auth.userResponse"
}
}
},
"auth.registerRequest": {
"type": "object",
"required": [
"email",
"nome",
"role",
"senha"
],
"properties": {
"email": {
"type": "string"
},
"nome": {
"type": "string"
},
"role": {
"description": "Role is now required",
"type": "string"
},
"senha": {
"type": "string",
"minLength": 6
},
"telefone": {
"type": "string"
}
}
},
"auth.updateRoleRequest": {
"type": "object",
"required": [
"role"
],
"properties": {
"role": {
"type": "string"
}
}
},
"auth.userResponse": {
"type": "object",
"properties": {
"ativo": {
"type": "boolean"
},
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"cadastro_fot.CadastroFotResponse": {
"type": "object",
"properties": {
"ano_formatura_id": {
"type": "string"
},
"ano_formatura_label": {
"type": "string"
},
"cidade": {
"type": "string"
},
"curso_id": {
"type": "string"
},
"curso_nome": {
"type": "string"
},
"empresa_id": {
"type": "string"
},
"empresa_nome": {
"type": "string"
},
"estado": {
"type": "string"
},
"fot": {
"type": "integer"
},
"gastos_captacao": {
"type": "number"
},
"id": {
"type": "string"
},
"instituicao": {
"type": "string"
},
"observacoes": {
"type": "string"
},
"pre_venda": {
"type": "boolean"
}
}
},
"cadastro_fot.CreateInput": {
"type": "object",
"properties": {
"ano_formatura_id": {
"type": "string"
},
"cidade": {
"type": "string"
},
"curso_id": {
"type": "string"
},
"empresa_id": {
"type": "string"
},
"estado": {
"type": "string"
},
"fot": {
"type": "integer"
},
"gastos_captacao": {
"type": "number"
},
"instituicao": {
"type": "string"
},
"observacoes": {
"type": "string"
},
"pre_venda": {
"type": "boolean"
}
}
},
"cursos.CreateCursoRequest": {
"type": "object",
"required": [
"nome"
],
"properties": {
"nome": {
"type": "string"
}
}
},
"cursos.CursoResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nome": {
"type": "string"
}
}
},
"empresas.CreateEmpresaRequest": {
"type": "object",
"required": [
"nome"
],
"properties": {
"nome": {
"type": "string"
}
}
},
"empresas.EmpresaResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nome": {
"type": "string"
}
}
},
"funcoes.CreateFuncaoRequest": {
"type": "object",
"required": [
"nome"
],
"properties": {
"nome": {
"type": "string"
}
}
},
"funcoes.FuncaoResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nome": {
"type": "string"
}
}
},
"profissionais.CreateProfissionalInput": {
"type": "object",
"properties": {
"agencia": {
"type": "string"
},
"banco": {
"type": "string"
},
"carro_disponivel": {
"type": "boolean"
},
"cidade": {
"type": "string"
},
"conta_pix": {
"type": "string"
},
"cpf_cnpj_titular": {
"type": "string"
},
"desempenho_evento": {
"type": "integer"
},
"disp_horario": {
"type": "integer"
},
"educacao_simpatia": {
"type": "integer"
},
"endereco": {
"type": "string"
},
"equipamentos": {
"type": "string"
},
"extra_por_equipamento": {
"type": "boolean"
},
"funcao_profissional_id": {
"type": "string"
},
"media": {
"type": "number"
},
"nome": {
"type": "string"
},
"observacao": {
"type": "string"
},
"qtd_estudio": {
"type": "integer"
},
"qual_tec": {
"type": "integer"
},
"tabela_free": {
"type": "string"
},
"tem_estudio": {
"type": "boolean"
},
"tipo_cartao": {
"type": "string"
},
"uf": {
"type": "string"
},
"whatsapp": {
"type": "string"
}
}
},
"profissionais.ProfissionalResponse": {
"type": "object",
"properties": {
"agencia": {
"type": "string"
},
"banco": {
"type": "string"
},
"carro_disponivel": {
"type": "boolean"
},
"cidade": {
"type": "string"
},
"conta_pix": {
"type": "string"
},
"cpf_cnpj_titular": {
"type": "string"
},
"desempenho_evento": {
"type": "integer"
},
"disp_horario": {
"type": "integer"
},
"educacao_simpatia": {
"type": "integer"
},
"endereco": {
"type": "string"
},
"equipamentos": {
"type": "string"
},
"extra_por_equipamento": {
"type": "boolean"
},
"funcao_profissional": {
"description": "Now returns name from join",
"type": "string"
},
"funcao_profissional_id": {
"type": "string"
},
"id": {
"type": "string"
},
"media": {
"type": "number"
},
"nome": {
"type": "string"
},
"observacao": {
"type": "string"
},
"qtd_estudio": {
"type": "integer"
},
"qual_tec": {
"type": "integer"
},
"tabela_free": {
"type": "string"
},
"tem_estudio": {
"type": "boolean"
},
"tipo_cartao": {
"type": "string"
},
"uf": {
"type": "string"
},
"usuario_id": {
"type": "string"
},
"whatsapp": {
"type": "string"
}
}
},
"profissionais.UpdateProfissionalInput": {
"type": "object",
"properties": {
"agencia": {
"type": "string"
},
"banco": {
"type": "string"
},
"carro_disponivel": {
"type": "boolean"
},
"cidade": {
"type": "string"
},
"conta_pix": {
"type": "string"
},
"cpf_cnpj_titular": {
"type": "string"
},
"desempenho_evento": {
"type": "integer"
},
"disp_horario": {
"type": "integer"
},
"educacao_simpatia": {
"type": "integer"
},
"endereco": {
"type": "string"
},
"equipamentos": {
"type": "string"
},
"extra_por_equipamento": {
"type": "boolean"
},
"funcao_profissional_id": {
"type": "string"
},
"media": {
"type": "number"
},
"nome": {
"type": "string"
},
"observacao": {
"type": "string"
},
"qtd_estudio": {
"type": "integer"
},
"qual_tec": {
"type": "integer"
},
"tabela_free": {
"type": "string"
},
"tem_estudio": {
"type": "boolean"
},
"tipo_cartao": {
"type": "string"
},
"uf": {
"type": "string"
},
"whatsapp": {
"type": "string"
}
}
},
"tipos_eventos.CreateEventoRequest": {
"type": "object",
"required": [
"nome"
],
"properties": {
"nome": {
"type": "string"
}
}
},
"tipos_eventos.EventoResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nome": {
"type": "string"
},
"precos": {
"type": "array",
"items": {
"$ref": "#/definitions/tipos_eventos.PrecoResponse"
}
}
}
},
"tipos_eventos.PrecoResponse": {
"type": "object",
"properties": {
"funcao_nome": {
"type": "string"
},
"funcao_profissional_id": {
"type": "string"
},
"id": {
"type": "string"
},
"tipo_evento_id": {
"type": "string"
},
"valor": {
"type": "number"
}
}
},
"tipos_eventos.PriceInput": {
"type": "object",
"properties": {
"funcao_profissional_id": {
"type": "string"
},
"tipo_evento_id": {
"type": "string"
},
"valor": {
"type": "number"
}
}
},
"tipos_servicos.CreateTipoServicoRequest": {
"type": "object",
"required": [
"nome"
],
"properties": {
"nome": {
"type": "string"
}
}
},
"tipos_servicos.TipoServicoResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"nome": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"tags": [
{
"description": "Authentication related operations",
"name": "auth"
},
{
"description": "Administration operations",
"name": "admin"
}
]
}