892 lines
20 KiB
JSON
892 lines
20 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"paths": {
|
|
"/health": {
|
|
"get": {
|
|
"operationId": "HealthController_check",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Health"
|
|
]
|
|
}
|
|
},
|
|
"/auth/v1/login": {
|
|
"get": {
|
|
"operationId": "AuthController_login",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Auth"
|
|
]
|
|
}
|
|
},
|
|
"/auth/callback": {
|
|
"get": {
|
|
"operationId": "AuthController_loginCallback",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Auth"
|
|
]
|
|
}
|
|
},
|
|
"/auth/me": {
|
|
"get": {
|
|
"operationId": "AuthController_getProfile",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Auth"
|
|
]
|
|
}
|
|
},
|
|
"/notifications/summary": {
|
|
"get": {
|
|
"operationId": "NotificationsController_summary",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Notifications"
|
|
]
|
|
}
|
|
},
|
|
"/notifications/stream": {
|
|
"get": {
|
|
"operationId": "NotificationsController_stream",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Notifications"
|
|
]
|
|
}
|
|
},
|
|
"/timesheets/{year}/{period_number}": {
|
|
"get": {
|
|
"operationId": "TimesheetController_getTimesheetByPayPeriod",
|
|
"parameters": [
|
|
{
|
|
"name": "year",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "period_number",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Timesheet"
|
|
]
|
|
}
|
|
},
|
|
"/timesheets/timesheet-approval": {
|
|
"patch": {
|
|
"operationId": "TimesheetController_approveTimesheet",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Timesheet"
|
|
]
|
|
}
|
|
},
|
|
"/shift/create": {
|
|
"post": {
|
|
"operationId": "ShiftController_createBatch",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Shift"
|
|
]
|
|
}
|
|
},
|
|
"/shift/update": {
|
|
"patch": {
|
|
"operationId": "ShiftController_updateBatch",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Shift"
|
|
]
|
|
}
|
|
},
|
|
"/shift/{shift_id}": {
|
|
"delete": {
|
|
"operationId": "ShiftController_remove",
|
|
"parameters": [
|
|
{
|
|
"name": "shift_id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Shift"
|
|
]
|
|
}
|
|
},
|
|
"/schedule-presets/create": {
|
|
"post": {
|
|
"operationId": "SchedulePresetsController_createPreset",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SchedulePresetsDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"SchedulePresets"
|
|
]
|
|
}
|
|
},
|
|
"/schedule-presets/update/{preset_id}": {
|
|
"patch": {
|
|
"operationId": "SchedulePresetsController_updatePreset",
|
|
"parameters": [
|
|
{
|
|
"name": "preset_id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SchedulePresetsUpdateDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"SchedulePresets"
|
|
]
|
|
}
|
|
},
|
|
"/schedule-presets/delete/{preset_id}": {
|
|
"delete": {
|
|
"operationId": "SchedulePresetsController_deletePreset",
|
|
"parameters": [
|
|
{
|
|
"name": "preset_id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"SchedulePresets"
|
|
]
|
|
}
|
|
},
|
|
"/schedule-presets/find-list": {
|
|
"get": {
|
|
"operationId": "SchedulePresetsController_findListById",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"SchedulePresets"
|
|
]
|
|
}
|
|
},
|
|
"/schedule-presets/apply-presets": {
|
|
"post": {
|
|
"operationId": "SchedulePresetsController_applyPresets",
|
|
"parameters": [],
|
|
"responses": {
|
|
"201": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"SchedulePresets"
|
|
]
|
|
}
|
|
},
|
|
"/expense/create": {
|
|
"post": {
|
|
"operationId": "ExpenseController_create",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ExpenseDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Expense"
|
|
]
|
|
}
|
|
},
|
|
"/expense/update": {
|
|
"patch": {
|
|
"operationId": "ExpenseController_update",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ExpenseDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Expense"
|
|
]
|
|
}
|
|
},
|
|
"/expense/delete/{expense_id}": {
|
|
"delete": {
|
|
"operationId": "ExpenseController_remove",
|
|
"parameters": [
|
|
{
|
|
"name": "expense_id",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Expense"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/current-and-all": {
|
|
"get": {
|
|
"operationId": "PayPeriodsController_getCurrentAndAll",
|
|
"parameters": [
|
|
{
|
|
"name": "date",
|
|
"required": true,
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/date/{date}": {
|
|
"get": {
|
|
"operationId": "PayPeriodsController_findByDate",
|
|
"parameters": [
|
|
{
|
|
"name": "date",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/{year}/{periodNumber}": {
|
|
"get": {
|
|
"operationId": "PayPeriodsController_findOneByYear",
|
|
"parameters": [
|
|
{
|
|
"name": "year",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "periodNumber",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/crew/pay-period-approval": {
|
|
"patch": {
|
|
"operationId": "PayPeriodsController_bulkApproval",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BulkCrewApprovalDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/crew/{year}/{periodNumber}": {
|
|
"get": {
|
|
"operationId": "PayPeriodsController_getCrewOverview",
|
|
"parameters": [
|
|
{
|
|
"name": "year",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "periodNumber",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/pay-periods/overview/{year}/{periodNumber}": {
|
|
"get": {
|
|
"operationId": "PayPeriodsController_getOverviewByYear",
|
|
"parameters": [
|
|
{
|
|
"name": "year",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
{
|
|
"name": "periodNumber",
|
|
"required": true,
|
|
"in": "path",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"PayPeriods"
|
|
]
|
|
}
|
|
},
|
|
"/exports/csv": {
|
|
"get": {
|
|
"operationId": "CsvExportController_exportCsv",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"CsvExport"
|
|
]
|
|
}
|
|
},
|
|
"/employees/profile": {
|
|
"get": {
|
|
"operationId": "EmployeesController_findOneProfile",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Employees"
|
|
]
|
|
}
|
|
},
|
|
"/employees/employee-list": {
|
|
"get": {
|
|
"operationId": "EmployeesController_findListEmployees",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Employees"
|
|
]
|
|
}
|
|
},
|
|
"/employees": {
|
|
"patch": {
|
|
"operationId": "EmployeesController_updateOrArchiveOrRestore",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdateEmployeeDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Employees"
|
|
]
|
|
},
|
|
"post": {
|
|
"operationId": "EmployeesController_create",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateEmployeeDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Employees"
|
|
]
|
|
}
|
|
},
|
|
"/preferences/update_preferences": {
|
|
"patch": {
|
|
"operationId": "PreferencesController_updatePreferences",
|
|
"parameters": [],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PreferencesDto"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"tags": [
|
|
"Preferences"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"title": "Targo_Backend",
|
|
"description": "Documentation de l`API REST pour Targo (NestJS + Prisma)",
|
|
"version": "1.0",
|
|
"contact": {}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Users",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Employees",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Customers",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Timesheets",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Shifts",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Leave Requests",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Shift Codes",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "OAuth Access Tokens",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "Authorization",
|
|
"description": ""
|
|
}
|
|
],
|
|
"servers": [],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"access-token": {
|
|
"scheme": "bearer",
|
|
"bearerFormat": "JWT",
|
|
"type": "http",
|
|
"name": "Authorization",
|
|
"description": "Invalid JWT token",
|
|
"in": "header"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"SchedulePresetsDto": {
|
|
"type": "object",
|
|
"properties": {}
|
|
},
|
|
"SchedulePresetsUpdateDto": {
|
|
"type": "object",
|
|
"properties": {}
|
|
},
|
|
"ExpenseDto": {
|
|
"type": "object",
|
|
"properties": {}
|
|
},
|
|
"BulkCrewApprovalDto": {
|
|
"type": "object",
|
|
"properties": {}
|
|
},
|
|
"UpdateEmployeeDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number",
|
|
"example": 1,
|
|
"description": "Unique ID of an employee(primary-key, auto-incremented)"
|
|
},
|
|
"user_id": {
|
|
"type": "string",
|
|
"example": "0e6e2e1f-b157-4c7c-ae3f-999b3e4f914d",
|
|
"description": "UUID of the user linked to that employee"
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "Frodo",
|
|
"description": "Employee`s first name"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Baggins",
|
|
"description": "Employee`s last name"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"example": "i_cant_do_this_sam@targointernet.com",
|
|
"description": "Employee`s email"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "82538437464",
|
|
"description": "Employee`s phone number"
|
|
},
|
|
"residence": {
|
|
"type": "string",
|
|
"example": "1 Bagshot Row, Hobbiton, The Shire, Middle-earth",
|
|
"description": "Employee`s residence"
|
|
},
|
|
"external_payroll_id": {
|
|
"type": "number",
|
|
"example": 7464,
|
|
"description": "external ID for the pay system"
|
|
},
|
|
"company_code": {
|
|
"type": "number",
|
|
"example": 335567447,
|
|
"description": "Employee`s company code"
|
|
},
|
|
"job_title": {
|
|
"type": "string",
|
|
"example": "technicient",
|
|
"description": "employee`s job title"
|
|
},
|
|
"first_work_day": {
|
|
"format": "date-time",
|
|
"type": "string",
|
|
"example": "23/09/3018",
|
|
"description": "New hire date or undefined"
|
|
},
|
|
"last_work_day": {
|
|
"format": "date-time",
|
|
"type": "string",
|
|
"example": "25/03/3019",
|
|
"description": "Termination date (null to restore)"
|
|
},
|
|
"supervisor_id": {
|
|
"type": "number",
|
|
"description": "Supervisor ID"
|
|
}
|
|
}
|
|
},
|
|
"CreateEmployeeDto": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "number",
|
|
"example": 1,
|
|
"description": "Unique ID of an employee(primary-key, auto-incremented)"
|
|
},
|
|
"user_id": {
|
|
"type": "string",
|
|
"example": "0e6e2e1f-b157-4c7c-ae3f-999b3e4f914d",
|
|
"description": "UUID of the user linked to that employee"
|
|
},
|
|
"first_name": {
|
|
"type": "string",
|
|
"example": "Frodo",
|
|
"description": "Employee`s first name"
|
|
},
|
|
"last_name": {
|
|
"type": "string",
|
|
"example": "Baggins",
|
|
"description": "Employee`s last name"
|
|
},
|
|
"email": {
|
|
"type": "string",
|
|
"example": "i_cant_do_this_sam@targointernet.com",
|
|
"description": "Employee`s email"
|
|
},
|
|
"phone_number": {
|
|
"type": "string",
|
|
"example": "82538437464",
|
|
"description": "Employee`s phone number"
|
|
},
|
|
"residence": {
|
|
"type": "string",
|
|
"example": "1 Bagshot Row, Hobbiton, The Shire, Middle-earth",
|
|
"description": "Employee`s residence"
|
|
},
|
|
"external_payroll_id": {
|
|
"type": "number",
|
|
"example": 7464,
|
|
"description": "external ID for the pay system"
|
|
},
|
|
"company_code": {
|
|
"type": "number",
|
|
"example": 335567447,
|
|
"description": "Employee`s company code"
|
|
},
|
|
"job_title": {
|
|
"type": "string",
|
|
"example": "technicient",
|
|
"description": "employee`s job title"
|
|
},
|
|
"first_work_day": {
|
|
"type": "string",
|
|
"example": "23/09/3018",
|
|
"description": "Employee`s first working day"
|
|
},
|
|
"last_work_day": {
|
|
"type": "string",
|
|
"example": "25/03/3019",
|
|
"description": "Employee`s last working day"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"user_id",
|
|
"first_name",
|
|
"last_name",
|
|
"email",
|
|
"phone_number",
|
|
"external_payroll_id",
|
|
"company_code",
|
|
"job_title",
|
|
"first_work_day"
|
|
]
|
|
},
|
|
"PreferencesDto": {
|
|
"type": "object",
|
|
"properties": {}
|
|
}
|
|
}
|
|
}
|
|
} |