gohorsejobs/backend/docs/swagger.yaml
Tiago Yamamoto 1c7ef95c1a first commit
2025-12-09 19:04:48 -03:00

231 lines
5.8 KiB
YAML

basePath: /
definitions:
github_com_rede5_gohorsejobs_backend_internal_core_dto.AuthResponse:
properties:
token:
type: string
user:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse'
type: object
github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse:
properties:
created_at:
type: string
id:
type: string
name:
type: string
status:
type: string
type: object
github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateCompanyRequest:
properties:
admin_email:
type: string
contact:
type: string
document:
type: string
name:
type: string
type: object
github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateUserRequest:
properties:
email:
type: string
name:
type: string
password:
type: string
roles:
description: e.g. ["RECRUITER"]
items:
type: string
type: array
type: object
github_com_rede5_gohorsejobs_backend_internal_core_dto.LoginRequest:
properties:
email:
type: string
password:
type: string
type: object
github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse:
properties:
created_at:
type: string
email:
type: string
id:
type: string
name:
type: string
roles:
items:
type: string
type: array
status:
type: string
type: object
host: localhost:8080
info:
contact: {}
description: API for GoHorseJobs recruitment platform.
title: GoHorseJobs API
version: "1.0"
paths:
/api/v1/auth/login:
post:
consumes:
- application/json
description: Authenticates a user by email and password. Returns JWT and user
info.
parameters:
- description: Login Credentials
in: body
name: login
required: true
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.AuthResponse'
"400":
description: Invalid Request
schema:
type: string
"401":
description: Unauthorized
schema:
type: string
summary: User Login
tags:
- Auth
/api/v1/companies:
post:
consumes:
- application/json
description: Registers a new company and creates an initial admin user.
parameters:
- description: Company Details
in: body
name: company
required: true
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateCompanyRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse'
"400":
description: Invalid Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
summary: Create Company (Tenant)
tags:
- Companies
/api/v1/users:
get:
consumes:
- application/json
description: Returns a list of users belonging to the authenticated tenant.
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse'
type: array
"403":
description: Forbidden
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- BearerAuth: []
summary: List Users
tags:
- Users
post:
consumes:
- application/json
description: Creates a new user under the current tenant. Requires Admin role.
parameters:
- description: User Details
in: body
name: user
required: true
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateUserRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse'
"400":
description: Invalid Request
schema:
type: string
"403":
description: Forbidden
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- BearerAuth: []
summary: Create User
tags:
- Users
/api/v1/users/{id}:
delete:
consumes:
- application/json
description: Deletes a user by ID. Must belong to the same tenant.
parameters:
- description: User ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: User deleted
schema:
type: string
"403":
description: Forbidden
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- BearerAuth: []
summary: Delete User
tags:
- Users
swagger: "2.0"