gohorsejobs/backend/docs/swagger.json
2025-12-14 09:42:31 -03:00

585 lines
No EOL
19 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "API for GoHorseJobs recruitment platform.",
"title": "GoHorseJobs API",
"contact": {},
"version": "1.0"
},
"host": "localhost:8521",
"basePath": "/",
"paths": {
"/api/v1/auth/login": {
"post": {
"description": "Authenticates a user by email and password. Returns JWT and user info.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User Login",
"parameters": [
{
"description": "Login Credentials",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.LoginRequest"
}
}
],
"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"
}
}
}
}
},
"/api/v1/companies": {
"get": {
"description": "Returns a list of all companies.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Companies"
],
"summary": "List Companies",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "Registers a new company and creates an initial admin user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Companies"
],
"summary": "Create Company (Tenant)",
"parameters": [
{
"description": "Company Details",
"name": "company",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateCompanyRequest"
}
}
],
"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"
}
}
}
}
},
"/api/v1/users": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns a list of users belonging to the authenticated tenant.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "List Users",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Creates a new user under the current tenant. Requires Admin role.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Create User",
"parameters": [
{
"description": "User Details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateUserRequest"
}
}
],
"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"
}
}
}
}
},
"/api/v1/users/{id}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Deletes a user by ID. Must belong to the same tenant.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Delete User",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "User deleted",
"schema": {
"type": "string"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/jobs": {
"get": {
"description": "Get a paginated list of job postings with optional filters",
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "List all jobs",
"parameters": [
{
"type": "integer",
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Items per page",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Filter by company ID",
"name": "companyId",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "Create a new job posting",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Create a new job",
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
},
"/jobs/{id}": {
"get": {
"description": "Get a single job posting by its ID",
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Get job by ID",
"parameters": [
{
"type": "integer",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
}
}
},
"put": {
"description": "Update an existing job posting",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Update a job",
"parameters": [
{
"type": "integer",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "Delete a job posting",
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Delete a job",
"parameters": [
{
"type": "integer",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"github_com_rede5_gohorsejobs_backend_internal_core_dto.AuthResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"user": {
"$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse"
}
}
},
"github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateCompanyRequest": {
"type": "object",
"properties": {
"admin_email": {
"type": "string"
},
"contact": {
"type": "string"
},
"document": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"github_com_rede5_gohorsejobs_backend_internal_core_dto.CreateUserRequest": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"roles": {
"description": "e.g. [\"RECRUITER\"]",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"github_com_rede5_gohorsejobs_backend_internal_core_dto.LoginRequest": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"github_com_rede5_gohorsejobs_backend_internal_core_dto.UserResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
},
"status": {
"type": "string"
}
}
}
}
}