{
    "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/funcoes": {
            "get": {
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "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": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/funcoes.FuncaoResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "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": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/funcoes.FuncaoResponse"
                        }
                    },
                    "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 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"
                            }
                        }
                    }
                }
            }
        },
        "/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 optional professional profile",
                "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": {
        "auth.loginRequest": {
            "type": "object",
            "required": [
                "email",
                "senha"
            ],
            "properties": {
                "email": {
                    "type": "string"
                },
                "senha": {
                    "type": "string"
                }
            }
        },
        "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",
                "role",
                "senha"
            ],
            "properties": {
                "email": {
                    "type": "string"
                },
                "profissional_data": {
                    "$ref": "#/definitions/profissionais.CreateProfissionalInput"
                },
                "role": {
                    "type": "string",
                    "enum": [
                        "profissional",
                        "empresa"
                    ]
                },
                "senha": {
                    "type": "string",
                    "minLength": 6
                }
            }
        },
        "auth.userResponse": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "role": {
                    "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"
                }
            }
        }
    },
    "securityDefinitions": {
        "BearerAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}