photum/backend/docs/swagger.yaml

670 lines
15 KiB
YAML

basePath: /
definitions:
auth.loginRequest:
properties:
email:
type: string
senha:
type: string
required:
- email
- senha
type: object
auth.loginResponse:
properties:
access_token:
type: string
expires_at:
type: string
profissional: {}
user:
$ref: '#/definitions/auth.userResponse'
type: object
auth.registerRequest:
properties:
email:
type: string
profissional_data:
$ref: '#/definitions/profissionais.CreateProfissionalInput'
role:
enum:
- profissional
- empresa
type: string
senha:
minLength: 6
type: string
required:
- email
- role
- senha
type: object
auth.userResponse:
properties:
email:
type: string
id:
type: string
role:
type: string
type: object
funcoes.FuncaoResponse:
properties:
id:
type: string
nome:
type: string
type: object
profissionais.CreateProfissionalInput:
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
type: object
profissionais.ProfissionalResponse:
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
type: object
profissionais.UpdateProfissionalInput:
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
type: object
host: localhost:8080
info:
contact:
email: support@swagger.io
name: API Support
url: http://www.swagger.io/support
description: Backend authentication service for Photum.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: Photum Backend API
version: "1.0"
paths:
/api/funcoes:
get:
consumes:
- application/json
description: List all professional functions
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/funcoes.FuncaoResponse'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: List functions
tags:
- funcoes
post:
consumes:
- application/json
description: Create a new professional function
parameters:
- description: Create Function Request
in: body
name: request
required: true
schema:
additionalProperties:
type: string
type: object
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/funcoes.FuncaoResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create a new function
tags:
- funcoes
/api/funcoes/{id}:
delete:
consumes:
- application/json
description: Delete a professional function by ID
parameters:
- description: Function ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete function
tags:
- funcoes
put:
consumes:
- application/json
description: Update a professional function by ID
parameters:
- description: Function ID
in: path
name: id
required: true
type: string
- description: Update Function Request
in: body
name: request
required: true
schema:
additionalProperties:
type: string
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/funcoes.FuncaoResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update function
tags:
- funcoes
/api/profissionais:
get:
consumes:
- application/json
description: List all profissionais
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/profissionais.ProfissionalResponse'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: List profissionais
tags:
- profissionais
post:
consumes:
- application/json
description: Create a new profissional record
parameters:
- description: Create Profissional Request
in: body
name: request
required: true
schema:
$ref: '#/definitions/profissionais.CreateProfissionalInput'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/profissionais.ProfissionalResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Create a new profissional
tags:
- profissionais
/api/profissionais/{id}:
delete:
consumes:
- application/json
description: Delete a profissional by ID
parameters:
- description: Profissional ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Delete profissional
tags:
- profissionais
get:
consumes:
- application/json
description: Get a profissional by ID
parameters:
- description: Profissional ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/profissionais.ProfissionalResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"404":
description: Not Found
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Get profissional by ID
tags:
- profissionais
put:
consumes:
- application/json
description: Update a profissional by ID
parameters:
- description: Profissional ID
in: path
name: id
required: true
type: string
- description: Update Profissional Request
in: body
name: request
required: true
schema:
$ref: '#/definitions/profissionais.UpdateProfissionalInput'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/profissionais.ProfissionalResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
security:
- BearerAuth: []
summary: Update profissional
tags:
- profissionais
/auth/login:
post:
consumes:
- application/json
description: Login with email and password
parameters:
- description: Login Request
in: body
name: request
required: true
schema:
$ref: '#/definitions/auth.loginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/auth.loginResponse'
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Login
tags:
- auth
/auth/logout:
post:
consumes:
- application/json
description: Revoke refresh token and clear cookie
parameters:
- description: Refresh Token
in: body
name: refresh_token
schema:
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Logout user
tags:
- auth
/auth/refresh:
post:
consumes:
- application/json
description: Get a new access token using a valid refresh token
parameters:
- description: Refresh Token
in: body
name: refresh_token
schema:
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Refresh access token
tags:
- auth
/auth/register:
post:
consumes:
- application/json
description: Register a new user with optional professional profile
parameters:
- description: Register Request
in: body
name: request
required: true
schema:
$ref: '#/definitions/auth.registerRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Register a new user
tags:
- auth
securityDefinitions:
BearerAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"