Merge branch 'main' of git.targo.ca:Targo/targo_backend
This commit is contained in:
commit
292013a846
|
|
@ -15,48 +15,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/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": {
|
"/notifications/summary": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "NotificationsController_summary",
|
"operationId": "NotificationsController_summary",
|
||||||
|
|
@ -85,169 +43,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/timesheets/{year}/{period_number}": {
|
"/timesheets/{year}/{period_number}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "TimesheetController_getTimesheetByPayPeriod",
|
"operationId": "TimesheetController_getTimesheetByPayPeriod",
|
||||||
|
|
@ -293,39 +88,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/preferences": {
|
|
||||||
"patch": {
|
|
||||||
"operationId": "PreferencesController_updatePreferences",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "PreferencesDto",
|
|
||||||
"required": true,
|
|
||||||
"in": "body",
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/PreferencesDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"Preferences"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/shift/create": {
|
"/shift/create": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "ShiftController_createBatch",
|
"operationId": "ShiftController_createBatch",
|
||||||
|
|
@ -581,6 +343,332 @@
|
||||||
"Expense"
|
"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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/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": {
|
||||||
|
"patch": {
|
||||||
|
"operationId": "PreferencesController_updatePreferences",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "PreferencesDto",
|
||||||
|
"required": true,
|
||||||
|
"in": "body",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PreferencesDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Preferences"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
|
|
@ -640,14 +728,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schemas": {
|
"schemas": {
|
||||||
"BulkCrewApprovalDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {}
|
|
||||||
},
|
|
||||||
"PreferencesDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {}
|
|
||||||
},
|
|
||||||
"SchedulePresetsDto": {
|
"SchedulePresetsDto": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {}
|
"properties": {}
|
||||||
|
|
@ -659,6 +739,162 @@
|
||||||
"ExpenseDto": {
|
"ExpenseDto": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {}
|
"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": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,26 @@
|
||||||
import { BadRequestException, Module, ValidationPipe } from '@nestjs/common';
|
import { BadRequestException, Module, ValidationPipe } from '@nestjs/common';
|
||||||
import { AppController } from './app.controller';
|
import { AppController } from './app.controller';
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
import { AuthenticationModule } from './identity-and-account/authentication/auth.module';
|
|
||||||
// import { CsvExportModule } from './modules/exports/csv-exports.module';
|
|
||||||
import { HealthModule } from './health/health.module';
|
|
||||||
import { HealthController } from './health/health.controller';
|
import { HealthController } from './health/health.controller';
|
||||||
import { NotificationsModule } from './modules/notifications/notifications.module';
|
import { NotificationsModule } from './modules/notifications/notifications.module';
|
||||||
import { PreferencesModule } from './identity-and-account/preferences/preferences.module';
|
import { PrismaModule } from './prisma/prisma.module';
|
||||||
import { PrismaModule } from './prisma/prisma.module';
|
import { ScheduleModule } from '@nestjs/schedule';
|
||||||
import { ScheduleModule } from '@nestjs/schedule';
|
import { ConfigModule } from '@nestjs/config';
|
||||||
import { UsersModule } from './identity-and-account/users-management/users.module';
|
|
||||||
import { ConfigModule } from '@nestjs/config';
|
|
||||||
import { APP_FILTER, APP_PIPE } from '@nestjs/core';
|
import { APP_FILTER, APP_PIPE } from '@nestjs/core';
|
||||||
import { HttpExceptionFilter } from './common/filters/http-exception.filter';
|
import { HttpExceptionFilter } from './common/filters/http-exception.filter';
|
||||||
import { ValidationError } from 'class-validator';
|
import { ValidationError } from 'class-validator';
|
||||||
import { TimeAndAttendanceModule } from 'src/time-and-attendance/time-and-attendance.module';
|
import { TimeAndAttendanceModule } from 'src/time-and-attendance/time-and-attendance.module';
|
||||||
import { PayperiodsModule } from 'src/time-and-attendance/pay-period/pay-periods.module';
|
import { IdentityAndAccountModule } from 'src/identity-and-account/identity-and-account.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
AuthenticationModule,
|
ConfigModule.forRoot({ isGlobal: true }),
|
||||||
ConfigModule.forRoot({isGlobal: true}),
|
ScheduleModule.forRoot(), //cronjobs
|
||||||
// CsvExportModule,
|
|
||||||
HealthModule,
|
|
||||||
NotificationsModule,
|
NotificationsModule,
|
||||||
PayperiodsModule,
|
|
||||||
PreferencesModule,
|
|
||||||
PrismaModule,
|
PrismaModule,
|
||||||
ScheduleModule.forRoot(), //cronjobs
|
|
||||||
TimeAndAttendanceModule,
|
TimeAndAttendanceModule,
|
||||||
UsersModule,
|
IdentityAndAccountModule,
|
||||||
],
|
],
|
||||||
controllers: [AppController, HealthController],
|
controllers: [AppController, HealthController],
|
||||||
providers: [
|
providers: [
|
||||||
AppService,
|
AppService,
|
||||||
|
|
@ -44,9 +34,9 @@ import { PayperiodsModule } from 'src/time-and-attendance/pay-period/pay-periods
|
||||||
whitelist: true,
|
whitelist: true,
|
||||||
forbidNonWhitelisted: true,
|
forbidNonWhitelisted: true,
|
||||||
transform: true,
|
transform: true,
|
||||||
exceptionFactory: (errors: ValidationError[] = [])=> {
|
exceptionFactory: (errors: ValidationError[] = []) => {
|
||||||
const messages = errors.flatMap((e)=> Object.values(e.constraints ?? {}));
|
const messages = errors.flatMap((e) => Object.values(e.constraints ?? {}));
|
||||||
return new BadRequestException({
|
return new BadRequestException({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
error: 'Bad Request',
|
error: 'Bad Request',
|
||||||
message: messages.length ? messages : errors,
|
message: messages.length ? messages : errors,
|
||||||
|
|
@ -56,4 +46,4 @@ import { PayperiodsModule } from 'src/time-and-attendance/pay-period/pay-periods
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule { }
|
||||||
|
|
|
||||||
35
src/identity-and-account/identity-and-account.module.ts
Normal file
35
src/identity-and-account/identity-and-account.module.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import { Module } from "@nestjs/common";
|
||||||
|
import { AuthModuleOptions } from "@nestjs/passport";
|
||||||
|
import { AuthController } from "src/identity-and-account/authentication/controllers/auth.controller";
|
||||||
|
import { AuthentikAuthService } from "src/identity-and-account/authentication/services/authentik-auth.service";
|
||||||
|
import { EmployeesController } from "src/identity-and-account/employees/controllers/employees.controller";
|
||||||
|
import { EmployeesModule } from "src/identity-and-account/employees/employees.module";
|
||||||
|
import { EmployeesArchivalService } from "src/identity-and-account/employees/services/employees-archival.service";
|
||||||
|
import { EmployeesService } from "src/identity-and-account/employees/services/employees.service";
|
||||||
|
import { PreferencesController } from "src/identity-and-account/preferences/controllers/preferences.controller";
|
||||||
|
import { PreferencesModule } from "src/identity-and-account/preferences/preferences.module";
|
||||||
|
import { PreferencesService } from "src/identity-and-account/preferences/services/preferences.service";
|
||||||
|
import { UsersService } from "src/identity-and-account/users-management/services/users.service";
|
||||||
|
import { UsersModule } from "src/identity-and-account/users-management/users.module";
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [
|
||||||
|
UsersModule,
|
||||||
|
EmployeesModule,
|
||||||
|
PreferencesModule,
|
||||||
|
AuthModuleOptions,
|
||||||
|
],
|
||||||
|
controllers: [
|
||||||
|
AuthController,
|
||||||
|
EmployeesController,
|
||||||
|
PreferencesController,
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
AuthentikAuthService,
|
||||||
|
EmployeesArchivalService,
|
||||||
|
EmployeesService,
|
||||||
|
PreferencesService,
|
||||||
|
UsersService,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class IdentityAndAccountModule { };
|
||||||
Loading…
Reference in New Issue
Block a user