diff --git a/docs/swagger/swagger-spec.json b/docs/swagger/swagger-spec.json index 15ab59d..0462102 100644 --- a/docs/swagger/swagger-spec.json +++ b/docs/swagger/swagger-spec.json @@ -71,142 +71,6 @@ ] } }, - "/employees/employee-list": { - "get": { - "operationId": "EmployeesController_findListEmployees", - "parameters": [], - "responses": { - "200": { - "description": "List of employees with scoped info found", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EmployeeListItemDto" - } - } - } - } - }, - "400": { - "description": "List of employees with scoped info not found" - } - }, - "security": [ - { - "access-token": [] - } - ], - "summary": "Find all employees with scoped info", - "tags": [ - "Employees" - ] - } - }, - "/employees/{email}": { - "patch": { - "operationId": "EmployeesController_updateOrArchiveOrRestore", - "parameters": [ - { - "name": "email", - "required": true, - "in": "path", - "description": "Email of the employee", - "schema": { - "type": "number" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEmployeeDto" - } - } - } - }, - "responses": { - "200": { - "description": "Employee updated or restored", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEmployeeDto" - } - } - } - }, - "202": { - "description": "Employee archived successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEmployeeDto" - } - } - } - }, - "404": { - "description": "Employee not found in active or archive" - } - }, - "security": [ - { - "access-token": [] - }, - { - "access-token": [] - } - ], - "summary": "Update, archive or restore an employee", - "tags": [ - "Employees" - ] - } - }, - "/employees/profile/{email}": { - "get": { - "operationId": "EmployeesController_findOneProfile", - "parameters": [ - { - "name": "email", - "required": true, - "in": "path", - "description": "Identifier of the employee", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Employee profile found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmployeeProfileItemDto" - } - } - } - }, - "400": { - "description": "Employee profile not found" - } - }, - "security": [ - { - "access-token": [] - } - ], - "summary": "Find employee profile", - "tags": [ - "Employees" - ] - } - }, "/notifications/summary": { "get": { "operationId": "NotificationsController_summary", @@ -649,6 +513,39 @@ ] } }, + "/preferences/{email}": { + "patch": { + "operationId": "PreferencesController_updatePreferences", + "parameters": [ + { + "name": "email", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PreferencesDto" + } + } + } + }, + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Preferences" + ] + } + }, "/timesheets": { "get": { "operationId": "TimesheetController_getTimesheetByIds", @@ -688,41 +585,6 @@ ] } }, - "/shift": { - "get": { - "operationId": "ShiftController_getShiftsByIds", - "parameters": [ - { - "name": "shift_ids", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "Shift" - ] - }, - "patch": { - "operationId": "ShiftController_updateBatch", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "Shift" - ] - } - }, "/shift/{timesheet_id}": { "post": { "operationId": "ShiftController_createBatch", @@ -759,6 +621,20 @@ ] } }, + "/shift": { + "patch": { + "operationId": "ShiftController_updateBatch", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Shift" + ] + } + }, "/shift/{shift_id}": { "delete": { "operationId": "ShiftController_remove", @@ -782,39 +658,6 @@ ] } }, - "/preferences/{email}": { - "patch": { - "operationId": "PreferencesController_updatePreferences", - "parameters": [ - { - "name": "email", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PreferencesDto" - } - } - } - }, - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "Preferences" - ] - } - }, "/schedule-presets/{email}": { "put": { "operationId": "SchedulePresetsController_upsert", @@ -915,6 +758,100 @@ "SchedulePresets" ] } + }, + "/expense/{timesheet_id}": { + "post": { + "operationId": "ExpenseController_create", + "parameters": [ + { + "name": "timesheet_id", + "required": true, + "in": "path", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpenseDto" + } + } + } + }, + "responses": { + "201": { + "description": "" + } + }, + "tags": [ + "Expense" + ] + } + }, + "/expense": { + "patch": { + "operationId": "ExpenseController_update", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Expense" + ] + } + }, + "/expense/{expense_id}": { + "delete": { + "operationId": "ExpenseController_remove", + "parameters": [ + { + "name": "expense_id", + "required": true, + "in": "path", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Expense" + ] + } + }, + "/archives/expenses": { + "get": { + "operationId": "ExpensesArchiveController_findOneArchived", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Archived expense found" + } + }, + "summary": "Fetch expense in archives with its Id", + "tags": [ + "Expense Archives" + ] + } } }, "info": { @@ -974,162 +911,6 @@ } }, "schemas": { - "EmployeeListItemDto": { - "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" - ] - }, - "EmployeeProfileItemDto": { - "type": "object", - "properties": {} - }, "CreateOauthSessionDto": { "type": "object", "properties": { @@ -1407,6 +1188,10 @@ "SchedulePresetsDto": { "type": "object", "properties": {} + }, + "ExpenseDto": { + "type": "object", + "properties": {} } } } diff --git a/prisma/mock-seeds-scripts/04-customers.ts b/prisma/mock-seeds-scripts/04-customers.ts index aaa63b6..b8319cf 100644 --- a/prisma/mock-seeds-scripts/04-customers.ts +++ b/prisma/mock-seeds-scripts/04-customers.ts @@ -1,28 +1,28 @@ -import { PrismaClient, Roles } from '@prisma/client'; +// import { PrismaClient, Roles } from '@prisma/client'; -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -async function main() { - const customerUsers = await prisma.users.findMany({ - where: { role: Roles.CUSTOMER }, - orderBy: { email: 'asc' }, - }); +// async function main() { +// const customerUsers = await prisma.users.findMany({ +// where: { role: Roles.CUSTOMER }, +// orderBy: { email: 'asc' }, +// }); - let i = 0; - for (const u of customerUsers) { - await prisma.customers.upsert({ - where: { user_id: u.id }, - update: {}, - create: { - user_id: u.id, - invoice_id: i % 2 === 0 ? 100000 + i : null, // 1 sur 2 a un invoice_id - }, - }); - i++; - } +// let i = 0; +// for (const u of customerUsers) { +// await prisma.customers.upsert({ +// where: { user_id: u.id }, +// update: {}, +// create: { +// user_id: u.id, +// invoice_id: i % 2 === 0 ? 100000 + i : null, // 1 sur 2 a un invoice_id +// }, +// }); +// i++; +// } - const total = await prisma.customers.count(); - console.log(`✓ Customers: ${total} rows`); -} +// const total = await prisma.customers.count(); +// console.log(`✓ Customers: ${total} rows`); +// } -main().finally(() => prisma.$disconnect()); +// main().finally(() => prisma.$disconnect()); diff --git a/prisma/mock-seeds-scripts/05-employees-archive.ts b/prisma/mock-seeds-scripts/05-employees-archive.ts index 1687b23..b352a7f 100644 --- a/prisma/mock-seeds-scripts/05-employees-archive.ts +++ b/prisma/mock-seeds-scripts/05-employees-archive.ts @@ -1,45 +1,45 @@ -import { PrismaClient } from '@prisma/client'; +// import { PrismaClient } from '@prisma/client'; -if (process.env.SKIP_LEAVE_REQUESTS === 'true') { - console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); - process.exit(0); -} +// if (process.env.SKIP_LEAVE_REQUESTS === 'true') { +// console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); +// process.exit(0); +// } -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -function daysAgo(n: number) { - const d = new Date(); - d.setDate(d.getDate() - n); - d.setHours(0,0,0,0); - return d; -} +// function daysAgo(n: number) { +// const d = new Date(); +// d.setDate(d.getDate() - n); +// d.setHours(0,0,0,0); +// return d; +// } -async function main() { - const employees = await prisma.employees.findMany({ - include: { user: true }, - take: 10, // archive 10 - }); +// async function main() { +// const employees = await prisma.employees.findMany({ +// include: { user: true }, +// take: 10, // archive 10 +// }); - for (const e of employees) { - await prisma.employeesArchive.create({ - data: { - employee_id: e.id, - user_id: e.user_id, - first_name: e.user.first_name, - last_name: e.user.last_name, - external_payroll_id: e.external_payroll_id, - company_code: e.company_code, - first_work_day: e.first_work_day, - last_work_day: daysAgo(30), - supervisor_id: e.supervisor_id ?? null, - job_title: e.job_title, - is_supervisor: e.is_supervisor, - }, - }); - } +// for (const e of employees) { +// await prisma.employeesArchive.create({ +// data: { +// employee_id: e.id, +// user_id: e.user_id, +// first_name: e.user.first_name, +// last_name: e.user.last_name, +// external_payroll_id: e.external_payroll_id, +// company_code: e.company_code, +// first_work_day: e.first_work_day, +// last_work_day: daysAgo(30), +// supervisor_id: e.supervisor_id ?? null, +// job_title: e.job_title, +// is_supervisor: e.is_supervisor, +// }, +// }); +// } - const total = await prisma.employeesArchive.count(); - console.log(`✓ EmployeesArchive: ${total} rows (added 10)`); -} +// const total = await prisma.employeesArchive.count(); +// console.log(`✓ EmployeesArchive: ${total} rows (added 10)`); +// } -main().finally(() => prisma.$disconnect()); +// main().finally(() => prisma.$disconnect()); diff --git a/prisma/mock-seeds-scripts/06-customers-archive.ts b/prisma/mock-seeds-scripts/06-customers-archive.ts index 31a7d01..0c2a382 100644 --- a/prisma/mock-seeds-scripts/06-customers-archive.ts +++ b/prisma/mock-seeds-scripts/06-customers-archive.ts @@ -1,35 +1,35 @@ -// prisma/mock-seeds-scripts/06-customers-archive.ts -import { PrismaClient } from '@prisma/client'; +// // prisma/mock-seeds-scripts/06-customers-archive.ts +// import { PrismaClient } from '@prisma/client'; -if (process.env.SKIP_LEAVE_REQUESTS === 'true') { - console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); - process.exit(0); -} +// if (process.env.SKIP_LEAVE_REQUESTS === 'true') { +// console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); +// process.exit(0); +// } -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -async function main() { - const customers = await prisma.customers.findMany({ - orderBy: { id: 'asc' }, - take: 5, - }); +// async function main() { +// const customers = await prisma.customers.findMany({ +// orderBy: { id: 'asc' }, +// take: 5, +// }); - for (const c of customers) { - const invoiceId = 200000 + c.id; // déterministe, stable entre runs +// for (const c of customers) { +// const invoiceId = 200000 + c.id; // déterministe, stable entre runs - await prisma.customersArchive.upsert({ - where: { invoice_id: invoiceId }, // invoice_id est unique - update: {}, // idempotent - create: { - customer_id: c.id, - user_id: c.user_id, - invoice_id: invoiceId, - }, - }); - } +// await prisma.customersArchive.upsert({ +// where: { invoice_id: invoiceId }, // invoice_id est unique +// update: {}, // idempotent +// create: { +// customer_id: c.id, +// user_id: c.user_id, +// invoice_id: invoiceId, +// }, +// }); +// } - const total = await prisma.customersArchive.count(); - console.log(`✓ CustomersArchive upserted for ${customers.length} customers (total=${total})`); -} +// const total = await prisma.customersArchive.count(); +// console.log(`✓ CustomersArchive upserted for ${customers.length} customers (total=${total})`); +// } -main().finally(() => prisma.$disconnect()); +// main().finally(() => prisma.$disconnect()); diff --git a/prisma/mock-seeds-scripts/08-leave-requests-archive.ts b/prisma/mock-seeds-scripts/08-leave-requests-archive.ts index 45b1d43..0170635 100644 --- a/prisma/mock-seeds-scripts/08-leave-requests-archive.ts +++ b/prisma/mock-seeds-scripts/08-leave-requests-archive.ts @@ -1,87 +1,87 @@ -import { PrismaClient, LeaveApprovalStatus, LeaveTypes } from '@prisma/client'; +// import { PrismaClient, LeaveApprovalStatus, LeaveTypes } from '@prisma/client'; -if (process.env.SKIP_LEAVE_REQUESTS === 'true') { - console.log('?? Seed leave-requests ignor (SKIP_LEAVE_REQUESTS=true)'); - process.exit(0); -} +// if (process.env.SKIP_LEAVE_REQUESTS === 'true') { +// console.log('?? Seed leave-requests ignor� (SKIP_LEAVE_REQUESTS=true)'); +// process.exit(0); +// } -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -function daysAgo(n: number) { - const d = new Date(); - d.setUTCDate(d.getUTCDate() - n); - d.setUTCHours(0, 0, 0, 0); - return d; -} +// function daysAgo(n: number) { +// const d = new Date(); +// d.setUTCDate(d.getUTCDate() - n); +// d.setUTCHours(0, 0, 0, 0); +// return d; +// } -async function main() { - const employees = await prisma.employees.findMany({ select: { id: true } }); - if (!employees.length) { - throw new Error('Aucun employ trouv. Excute le seed employees avant celui-ci.'); - } +// async function main() { +// const employees = await prisma.employees.findMany({ select: { id: true } }); +// if (!employees.length) { +// throw new Error('Aucun employ� trouv�. Ex�cute le seed employees avant celui-ci.'); +// } - const leaveCodes = await prisma.bankCodes.findMany({ - where: { type: { in: ['SICK', 'VACATION', 'HOLIDAY'] } }, - select: { id: true, type: true }, - }); - if (!leaveCodes.length) { - throw new Error("Aucun bank code trouv avec type in ('SICK','VACATION','HOLIDAY'). Vrifie ta table bank_codes."); - } +// const leaveCodes = await prisma.bankCodes.findMany({ +// where: { type: { in: ['SICK', 'VACATION', 'HOLIDAY'] } }, +// select: { id: true, type: true }, +// }); +// if (!leaveCodes.length) { +// throw new Error("Aucun bank code trouv� avec type in ('SICK','VACATION','HOLIDAY'). V�rifie ta table bank_codes."); +// } - const statuses = Object.values(LeaveApprovalStatus); - const created = [] as Array<{ id: number; employee_id: number; leave_type: LeaveTypes; date: Date; comment: string; approval_status: LeaveApprovalStatus; requested_hours: number; payable_hours: number | null }>; +// const statuses = Object.values(LeaveApprovalStatus); +// const created = [] as Array<{ id: number; employee_id: number; leave_type: LeaveTypes; date: Date; comment: string; approval_status: LeaveApprovalStatus; requested_hours: number; payable_hours: number | null }>; - const COUNT = 12; - for (let i = 0; i < COUNT; i++) { - const emp = employees[i % employees.length]; - const leaveCode = leaveCodes[Math.floor(Math.random() * leaveCodes.length)]; +// const COUNT = 12; +// for (let i = 0; i < COUNT; i++) { +// const emp = employees[i % employees.length]; +// const leaveCode = leaveCodes[Math.floor(Math.random() * leaveCodes.length)]; - const date = daysAgo(120 - i * 3); - const status = statuses[(i + 2) % statuses.length]; - const requestedHours = 4 + (i % 5); // 4 ? 8 h - const payableHours = status === LeaveApprovalStatus.APPROVED ? Math.min(requestedHours, 8) : null; +// const date = daysAgo(120 - i * 3); +// const status = statuses[(i + 2) % statuses.length]; +// const requestedHours = 4 + (i % 5); // 4 ? 8 h +// const payableHours = status === LeaveApprovalStatus.APPROVED ? Math.min(requestedHours, 8) : null; - const lr = await prisma.leaveRequests.create({ - data: { - employee_id: emp.id, - bank_code_id: leaveCode.id, - leave_type: leaveCode.type as LeaveTypes, - date, - comment: `Past leave #${i + 1} (${leaveCode.type})`, - approval_status: status, - requested_hours: requestedHours, - payable_hours: payableHours, - }, - }); +// const lr = await prisma.leaveRequests.create({ +// data: { +// employee_id: emp.id, +// bank_code_id: leaveCode.id, +// leave_type: leaveCode.type as LeaveTypes, +// date, +// comment: `Past leave #${i + 1} (${leaveCode.type})`, +// approval_status: status, +// requested_hours: requestedHours, +// payable_hours: payableHours, +// }, +// }); - created.push({ - id: lr.id, - employee_id: lr.employee_id, - leave_type: lr.leave_type, - date: lr.date, - comment: lr.comment, - approval_status: lr.approval_status, - requested_hours: requestedHours, - payable_hours: payableHours, - }); - } +// created.push({ +// id: lr.id, +// employee_id: lr.employee_id, +// leave_type: lr.leave_type, +// date: lr.date, +// comment: lr.comment, +// approval_status: lr.approval_status, +// requested_hours: requestedHours, +// payable_hours: payableHours, +// }); +// } - for (const lr of created) { - await prisma.leaveRequestsArchive.create({ - data: { - leave_request_id: lr.id, - employee_id: lr.employee_id, - leave_type: lr.leave_type, - date: lr.date, - comment: lr.comment, - approval_status: lr.approval_status, - requested_hours: lr.requested_hours, - payable_hours: lr.payable_hours, - }, - }); - } +// for (const lr of created) { +// await prisma.leaveRequestsArchive.create({ +// data: { +// leave_request_id: lr.id, +// employee_id: lr.employee_id, +// leave_type: lr.leave_type, +// date: lr.date, +// comment: lr.comment, +// approval_status: lr.approval_status, +// requested_hours: lr.requested_hours, +// payable_hours: lr.payable_hours, +// }, +// }); +// } - console.log(`? LeaveRequestsArchive: ${created.length} rows`); -} +// console.log(`? LeaveRequestsArchive: ${created.length} rows`); +// } -main().finally(() => prisma.$disconnect()); \ No newline at end of file +// main().finally(() => prisma.$disconnect()); \ No newline at end of file diff --git a/prisma/mock-seeds-scripts/11-shifts-archive.ts b/prisma/mock-seeds-scripts/11-shifts-archive.ts index 1c3f5e8..4259359 100644 --- a/prisma/mock-seeds-scripts/11-shifts-archive.ts +++ b/prisma/mock-seeds-scripts/11-shifts-archive.ts @@ -1,71 +1,71 @@ -import { PrismaClient } from '@prisma/client'; +// import { PrismaClient } from '@prisma/client'; -if (process.env.SKIP_LEAVE_REQUESTS === 'true') { - console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); - process.exit(0); -} +// if (process.env.SKIP_LEAVE_REQUESTS === 'true') { +// console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); +// process.exit(0); +// } -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -function timeAt(h:number,m:number) { - return new Date(Date.UTC(1970,0,1,h,m,0)); -} -function daysAgo(n:number) { - const d = new Date(); - d.setUTCDate(d.getUTCDate() - n); - d.setUTCHours(0,0,0,0); - return d; -} +// function timeAt(h:number,m:number) { +// return new Date(Date.UTC(1970,0,1,h,m,0)); +// } +// function daysAgo(n:number) { +// const d = new Date(); +// d.setUTCDate(d.getUTCDate() - n); +// d.setUTCHours(0,0,0,0); +// return d; +// } -async function main() { - const bankCodes = await prisma.bankCodes.findMany({ where: { categorie: 'SHIFT' }, select: { id: true } }); - const employees = await prisma.employees.findMany({ select: { id: true } }); +// async function main() { +// const bankCodes = await prisma.bankCodes.findMany({ where: { categorie: 'SHIFT' }, select: { id: true } }); +// const employees = await prisma.employees.findMany({ select: { id: true } }); - for (const e of employees) { - const tss = await prisma.timesheets.findMany({ where: { employee_id: e.id }, select: { id: true } }); - if (!tss.length) continue; +// for (const e of employees) { +// const tss = await prisma.timesheets.findMany({ where: { employee_id: e.id }, select: { id: true } }); +// if (!tss.length) continue; - const createdShiftIds: number[] = []; - for (let i = 0; i < 8; i++) { - const ts = tss[i % tss.length]; - const bc = bankCodes[i % bankCodes.length]; - const date = daysAgo(200 + i); // bien dans le passé - const startH = 7 + (i % 4); // 7..10 - const endH = startH + 8; // 15..18 +// const createdShiftIds: number[] = []; +// for (let i = 0; i < 8; i++) { +// const ts = tss[i % tss.length]; +// const bc = bankCodes[i % bankCodes.length]; +// const date = daysAgo(200 + i); // bien dans le passé +// const startH = 7 + (i % 4); // 7..10 +// const endH = startH + 8; // 15..18 - const sh = await prisma.shifts.create({ - data: { - timesheet_id: ts.id, - bank_code_id: bc.id, - comment: `Archived-era shift ${i + 1} for emp ${e.id}`, - date, - start_time: timeAt(startH, 0), - end_time: timeAt(endH, 0), - is_approved: true, - }, - }); - createdShiftIds.push(sh.id); - } +// const sh = await prisma.shifts.create({ +// data: { +// timesheet_id: ts.id, +// bank_code_id: bc.id, +// comment: `Archived-era shift ${i + 1} for emp ${e.id}`, +// date, +// start_time: timeAt(startH, 0), +// end_time: timeAt(endH, 0), +// is_approved: true, +// }, +// }); +// createdShiftIds.push(sh.id); +// } - for (const sid of createdShiftIds) { - const s = await prisma.shifts.findUnique({ where: { id: sid } }); - if (!s) continue; - await prisma.shiftsArchive.create({ - data: { - shift_id: s.id, - timesheet_id: s.timesheet_id, - bank_code_id: s.bank_code_id, - comment: s.comment, - date: s.date, - start_time: s.start_time, - end_time: s.end_time, - }, - }); - } - } +// for (const sid of createdShiftIds) { +// const s = await prisma.shifts.findUnique({ where: { id: sid } }); +// if (!s) continue; +// await prisma.shiftsArchive.create({ +// data: { +// shift_id: s.id, +// timesheet_id: s.timesheet_id, +// bank_code_id: s.bank_code_id, +// comment: s.comment, +// date: s.date, +// start_time: s.start_time, +// end_time: s.end_time, +// }, +// }); +// } +// } - const total = await prisma.shiftsArchive.count(); - console.log(`✓ ShiftsArchive: ${total} rows total`); -} +// const total = await prisma.shiftsArchive.count(); +// console.log(`✓ ShiftsArchive: ${total} rows total`); +// } -main().finally(() => prisma.$disconnect()); +// main().finally(() => prisma.$disconnect()); diff --git a/prisma/mock-seeds-scripts/13-expenses-archive.ts b/prisma/mock-seeds-scripts/13-expenses-archive.ts index d8e35a2..c56520e 100644 --- a/prisma/mock-seeds-scripts/13-expenses-archive.ts +++ b/prisma/mock-seeds-scripts/13-expenses-archive.ts @@ -1,65 +1,65 @@ -// 13-expenses-archive.ts -import { PrismaClient, Expenses } from '@prisma/client'; +// // 13-expenses-archive.ts +// import { PrismaClient, Expenses } from '@prisma/client'; -if (process.env.SKIP_LEAVE_REQUESTS === 'true') { - console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); - process.exit(0); -} +// if (process.env.SKIP_LEAVE_REQUESTS === 'true') { +// console.log("⏭ Seed leave-requests ignoré (SKIP_LEAVE_REQUESTS=true)"); +// process.exit(0); +// } -const prisma = new PrismaClient(); +// const prisma = new PrismaClient(); -function daysAgo(n:number) { - const d = new Date(); - d.setUTCDate(d.getUTCDate() - n); - d.setUTCHours(0,0,0,0); - return d; -} +// function daysAgo(n:number) { +// const d = new Date(); +// d.setUTCDate(d.getUTCDate() - n); +// d.setUTCHours(0,0,0,0); +// return d; +// } -async function main() { - const expenseCodes = await prisma.bankCodes.findMany({ where: { categorie: 'EXPENSE' }, select: { id: true } }); - const timesheets = await prisma.timesheets.findMany({ select: { id: true } }); +// async function main() { +// const expenseCodes = await prisma.bankCodes.findMany({ where: { categorie: 'EXPENSE' }, select: { id: true } }); +// const timesheets = await prisma.timesheets.findMany({ select: { id: true } }); - // ✅ typer pour éviter never[] - const created: Expenses[] = []; +// // ✅ typer pour éviter never[] +// const created: Expenses[] = []; - for (let i = 0; i < 4; i++) { - const ts = timesheets[i % timesheets.length]; - const bc = expenseCodes[i % expenseCodes.length]; +// for (let i = 0; i < 4; i++) { +// const ts = timesheets[i % timesheets.length]; +// const bc = expenseCodes[i % expenseCodes.length]; - const exp = await prisma.expenses.create({ - data: { - timesheet_id: ts.id, - bank_code_id: bc.id, - date: daysAgo(60 + i), - amount: (20 + i * 3.5).toFixed(2), // ok: Decimal accepte string - attachment: null, - comment: `Old expense #${i + 1}`, - is_approved: true, - supervisor_comment: null, - }, - }); +// const exp = await prisma.expenses.create({ +// data: { +// timesheet_id: ts.id, +// bank_code_id: bc.id, +// date: daysAgo(60 + i), +// amount: (20 + i * 3.5).toFixed(2), // ok: Decimal accepte string +// attachment: null, +// comment: `Old expense #${i + 1}`, +// is_approved: true, +// supervisor_comment: null, +// }, +// }); - created.push(exp); - } +// created.push(exp); +// } - for (const e of created) { - await prisma.expensesArchive.create({ - data: { - expense_id: e.id, - timesheet_id: e.timesheet_id, - bank_code_id: e.bank_code_id, - date: e.date, - amount: e.amount, - attachment: e.attachment, - comment: e.comment, - is_approved: e.is_approved, - supervisor_comment: e.supervisor_comment, - }, - }); - } +// for (const e of created) { +// await prisma.expensesArchive.create({ +// data: { +// expense_id: e.id, +// timesheet_id: e.timesheet_id, +// bank_code_id: e.bank_code_id, +// date: e.date, +// amount: e.amount, +// attachment: e.attachment, +// comment: e.comment, +// is_approved: e.is_approved, +// supervisor_comment: e.supervisor_comment, +// }, +// }); +// } - const total = await prisma.expensesArchive.count(); - console.log(`✓ ExpensesArchive: ${total} total rows (added ${created.length})`); -} +// const total = await prisma.expensesArchive.count(); +// console.log(`✓ ExpensesArchive: ${total} total rows (added ${created.length})`); +// } -main().finally(() => prisma.$disconnect()); +// main().finally(() => prisma.$disconnect()); diff --git a/src/app.module.ts b/src/app.module.ts index 60c2767..901f74e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -4,58 +4,45 @@ import { AppService } from './app.service'; // import { ArchivalModule } from './modules/archival/archival.module'; import { AuthenticationModule } from './modules/authentication/auth.module'; import { BankCodesModule } from './modules/bank-codes/bank-codes.module'; -import { BusinessLogicsModule } from './modules/business-logics/business-logics.module'; // import { CsvExportModule } from './modules/exports/csv-exports.module'; -import { CustomersModule } from './modules/customers/customers.module'; -import { EmployeesModule } from './modules/employees/employees.module'; -// import { ExpensesModule } from './modules/expenses/expenses.module'; import { HealthModule } from './health/health.module'; import { HealthController } from './health/health.controller'; -// import { LeaveRequestsModule } from './modules/leave-requests/leave-requests.module'; import { NotificationsModule } from './modules/notifications/notifications.module'; import { OauthSessionsModule } from './modules/oauth-sessions/oauth-sessions.module'; -import { OvertimeService } from './modules/business-logics/services/overtime.service'; import { PreferencesModule } from './modules/preferences/preferences.module'; import { PrismaModule } from './prisma/prisma.module'; import { ScheduleModule } from '@nestjs/schedule'; -import { ShiftsModule } from './Time_And_Attendance/modules/time-tracker/shifts/shifts.module'; -import { TimesheetsModule } from './Time_And_Attendance/modules/time-tracker/timesheets/timesheets.module'; import { UsersModule } from './modules/users-management/users.module'; import { ConfigModule } from '@nestjs/config'; import { APP_FILTER, APP_PIPE } from '@nestjs/core'; import { HttpExceptionFilter } from './common/filters/http-exception.filter'; import { ValidationError } from 'class-validator'; -import { SchedulePresetsModule } from './modules/schedule-presets/schedule-presets.module'; -import { PayperiodsModule } from './Time_And_Attendance/modules/pay-period/pay-periods.module'; +import { PayperiodsModule } from './time-and-attendance/modules/pay-period/pay-periods.module'; +import { TimeAndAttendanceModule } from 'src/time-and-attendance/time-and-attendance.module'; @Module({ imports: [ - // ArchivalModule, AuthenticationModule, BankCodesModule, - BusinessLogicsModule, ConfigModule.forRoot({isGlobal: true}), // CsvExportModule, - CustomersModule, - EmployeesModule, - // ExpensesModule, + // CustomersModule, + // EmployeesModule, HealthModule, - // LeaveRequestsModule, NotificationsModule, OauthSessionsModule, PayperiodsModule, PreferencesModule, PrismaModule, ScheduleModule.forRoot(), //cronjobs - SchedulePresetsModule, - ShiftsModule, - TimesheetsModule, + // ShiftsModule, + TimeAndAttendanceModule, + // TimesheetsModule, UsersModule, ], controllers: [AppController, HealthController], providers: [ AppService, - OvertimeService, { provide: APP_FILTER, useClass: HttpExceptionFilter diff --git a/src/identity-and-account/employees/employees.module.ts b/src/identity-and-account/employees/employees.module.ts new file mode 100644 index 0000000..7ce6f04 --- /dev/null +++ b/src/identity-and-account/employees/employees.module.ts @@ -0,0 +1,13 @@ +// import { Module } from '@nestjs/common'; +// import { EmployeesController } from './controllers/employees.controller'; +// import { EmployeesService } from './services/employees.service'; +// import { EmployeesArchivalService } from './services/employees-archival.service'; +// import { SharedModule } from '../../time-and-attendance/modules/shared/shared.module'; + +// @Module({ +// imports: [SharedModule], +// controllers: [EmployeesController], +// providers: [EmployeesService, EmployeesArchivalService], +// exports: [EmployeesService, EmployeesArchivalService], +// }) +// export class EmployeesModule {} diff --git a/src/modules/archival/controllers/employees-archive.controller.ts b/src/modules/archival/controllers/employees-archive.controller.ts index 375a351..776c6fa 100644 --- a/src/modules/archival/controllers/employees-archive.controller.ts +++ b/src/modules/archival/controllers/employees-archive.controller.ts @@ -1,33 +1,33 @@ -import { Controller, Get, NotFoundException, Param, ParseIntPipe, UseGuards } from "@nestjs/common"; -import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; -import { RolesAllowed } from "src/common/decorators/roles.decorators"; -import { EmployeesArchive, Roles as RoleEnum } from '@prisma/client'; -import { EmployeesArchivalService } from "src/modules/employees/services/employees-archival.service"; +// import { Controller, Get, NotFoundException, Param, ParseIntPipe, UseGuards } from "@nestjs/common"; +// import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; +// import { RolesAllowed } from "src/common/decorators/roles.decorators"; +// import { EmployeesArchive, Roles as RoleEnum } from '@prisma/client'; +// import { EmployeesArchivalService } from "src/modules/employees/services/employees-archival.service"; -@ApiTags('Employee Archives') -// @UseGuards() -@Controller('archives/employees') -export class EmployeesArchiveController { - constructor(private readonly employeesArchiveService: EmployeesArchivalService) {} +// @ApiTags('Employee Archives') +// // @UseGuards() +// @Controller('archives/employees') +// export class EmployeesArchiveController { +// constructor(private readonly employeesArchiveService: EmployeesArchivalService) {} - @Get() - //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) - @ApiOperation({ summary: 'List of archived employees'}) - @ApiResponse({ status: 200, description: 'List of archived employees', isArray: true }) - async findAllArchived(): Promise { - return this.employeesArchiveService.findAllArchived(); - } +// @Get() +// //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) +// @ApiOperation({ summary: 'List of archived employees'}) +// @ApiResponse({ status: 200, description: 'List of archived employees', isArray: true }) +// async findAllArchived(): Promise { +// return this.employeesArchiveService.findAllArchived(); +// } - @Get() - //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR,RoleEnum.SUPERVISOR) - @ApiOperation({ summary: 'Fetch employee in archives with its Id'}) - @ApiResponse({ status: 200, description: 'Archived employee found'}) - async findOneArchived(@Param('id', ParseIntPipe) id: number ): Promise { - try{ - return await this.employeesArchiveService.findOneArchived(id); - }catch { - throw new NotFoundException(`Archived employee #${id} not found`); - } - } +// @Get() +// //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR,RoleEnum.SUPERVISOR) +// @ApiOperation({ summary: 'Fetch employee in archives with its Id'}) +// @ApiResponse({ status: 200, description: 'Archived employee found'}) +// async findOneArchived(@Param('id', ParseIntPipe) id: number ): Promise { +// try{ +// return await this.employeesArchiveService.findOneArchived(id); +// }catch { +// throw new NotFoundException(`Archived employee #${id} not found`); +// } +// } -} \ No newline at end of file +// } \ No newline at end of file diff --git a/src/modules/archival/controllers/expenses-archive.controller.ts b/src/modules/archival/controllers/expenses-archive.controller.ts index e6bd935..f256b82 100644 --- a/src/modules/archival/controllers/expenses-archive.controller.ts +++ b/src/modules/archival/controllers/expenses-archive.controller.ts @@ -2,7 +2,7 @@ import { UseGuards, Controller, Get, Param, ParseIntPipe, NotFoundException } fr import { ApiTags, ApiOperation, ApiResponse } from "@nestjs/swagger"; import { ExpensesArchive,Roles as RoleEnum } from "@prisma/client"; import { RolesAllowed } from "src/common/decorators/roles.decorators"; -import { ExpensesArchivalService } from "src/modules/expenses/services/expenses-archival.service"; +import { ExpensesArchivalService } from "src/time-and-attendance/modules/expenses/services/expenses-archival.service"; @ApiTags('Expense Archives') // @UseGuards() diff --git a/src/modules/archival/controllers/shifts-archive.controller.ts b/src/modules/archival/controllers/shifts-archive.controller.ts index 463ea4a..7c88288 100644 --- a/src/modules/archival/controllers/shifts-archive.controller.ts +++ b/src/modules/archival/controllers/shifts-archive.controller.ts @@ -2,7 +2,7 @@ import { Get, Param, ParseIntPipe, NotFoundException, Controller, UseGuards } fr import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; import { ShiftsArchive, Roles as RoleEnum } from "@prisma/client"; import { RolesAllowed } from "src/common/decorators/roles.decorators"; -import { ShiftsArchivalService } from "src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-archival.service"; +import { ShiftsArchivalService } from "src/time-and-attendance/modules/time-tracker/shifts/services/shifts-archival.service"; @ApiTags('Shift Archives') // @UseGuards() diff --git a/src/modules/archival/controllers/timesheets-archive.controller.ts b/src/modules/archival/controllers/timesheets-archive.controller.ts index 9be0116..3a8f0a2 100644 --- a/src/modules/archival/controllers/timesheets-archive.controller.ts +++ b/src/modules/archival/controllers/timesheets-archive.controller.ts @@ -2,7 +2,7 @@ import { Controller, Get, NotFoundException, Param, ParseIntPipe, UseGuards } fr import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; import { RolesAllowed } from "src/common/decorators/roles.decorators"; import { TimesheetsArchive, Roles as RoleEnum } from '@prisma/client'; -import { TimesheetArchiveService } from "src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-archive.service"; +import { TimesheetArchiveService } from "src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-archive.service"; @ApiTags('Timesheet Archives') // @UseGuards() diff --git a/src/modules/archival/services/archival.service.ts b/src/modules/archival/services/archival.service.ts index 898ab51..ded45eb 100644 --- a/src/modules/archival/services/archival.service.ts +++ b/src/modules/archival/services/archival.service.ts @@ -1,8 +1,8 @@ import { Injectable, Logger } from "@nestjs/common"; import { Cron } from "@nestjs/schedule"; -import { ExpensesArchivalService } from "src/modules/expenses/services/expenses-archival.service"; -import { ShiftsArchivalService } from "src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-archival.service"; -import { TimesheetArchiveService } from "src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-archive.service"; +import { ExpensesArchivalService } from "src/time-and-attendance/modules/expenses/services/expenses-archival.service"; +import { ShiftsArchivalService } from "src/time-and-attendance/modules/time-tracker/shifts/services/shifts-archival.service"; +import { TimesheetArchiveService } from "src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-archive.service"; @Injectable() export class ArchivalService { diff --git a/src/modules/customers/controllers/customers.controller.ts b/src/modules/customers/controllers/customers.controller.ts index 713ebde..c066342 100644 --- a/src/modules/customers/controllers/customers.controller.ts +++ b/src/modules/customers/controllers/customers.controller.ts @@ -1,68 +1,68 @@ -import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post, UseGuards } from '@nestjs/common'; -import { CustomersService } from '../services/customers.service'; -import { Customers } from '@prisma/client'; -import { CreateCustomerDto } from '../dtos/create-customer.dto'; -import { UpdateCustomerDto } from '../dtos/update-customer.dto'; -import { RolesAllowed } from "src/common/decorators/roles.decorators"; -import { Roles as RoleEnum } from '.prisma/client'; -import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; +// import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post, UseGuards } from '@nestjs/common'; +// import { CustomersService } from '../services/customers.service'; +// import { Customers } from '@prisma/client'; +// import { CreateCustomerDto } from '../dtos/create-customer.dto'; +// import { UpdateCustomerDto } from '../dtos/update-customer.dto'; +// import { RolesAllowed } from "src/common/decorators/roles.decorators"; +// import { Roles as RoleEnum } from '.prisma/client'; +// import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; -@ApiTags('Customers') -@ApiBearerAuth('access-token') -// @UseGuards() -@Controller('customers') -export class CustomersController { - constructor(private readonly customersService: CustomersService) {} +// @ApiTags('Customers') +// @ApiBearerAuth('access-token') +// // @UseGuards() +// @Controller('customers') +// export class CustomersController { +// constructor(private readonly customersService: CustomersService) {} -//_____________________________________________________________________________________________ -// Deprecated or unused methods -//_____________________________________________________________________________________________ +// //_____________________________________________________________________________________________ +// // Deprecated or unused methods +// //_____________________________________________________________________________________________ - // @Post() - // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.SUPERVISOR) - // @ApiOperation({ summary: 'Create customer' }) - // @ApiResponse({ status: 201, description: 'Customer created', type: CreateCustomerDto }) - // @ApiResponse({ status: 400, description: 'Invalid task or invalid data' }) - // create(@Body() dto: CreateCustomerDto): Promise { - // return this.customersService.create(dto); - // } +// // @Post() +// // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.SUPERVISOR) +// // @ApiOperation({ summary: 'Create customer' }) +// // @ApiResponse({ status: 201, description: 'Customer created', type: CreateCustomerDto }) +// // @ApiResponse({ status: 400, description: 'Invalid task or invalid data' }) +// // create(@Body() dto: CreateCustomerDto): Promise { +// // return this.customersService.create(dto); +// // } - // @Get() - // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.HR, RoleEnum.SUPERVISOR) - // @ApiOperation({ summary: 'Find all customers' }) - // @ApiResponse({ status: 201, description: 'List of customers found', type: CreateCustomerDto, isArray: true }) - // @ApiResponse({ status: 400, description: 'List of customers not found' }) - // findAll(): Promise { - // return this.customersService.findAll(); - // } +// // @Get() +// // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.HR, RoleEnum.SUPERVISOR) +// // @ApiOperation({ summary: 'Find all customers' }) +// // @ApiResponse({ status: 201, description: 'List of customers found', type: CreateCustomerDto, isArray: true }) +// // @ApiResponse({ status: 400, description: 'List of customers not found' }) +// // findAll(): Promise { +// // return this.customersService.findAll(); +// // } - // @Get(':id') - // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.HR, RoleEnum.SUPERVISOR) - // @ApiOperation({ summary: 'Find customer' }) - // @ApiResponse({ status: 201, description: 'Customer found', type: CreateCustomerDto }) - // @ApiResponse({ status: 400, description: 'Customer not found' }) - // findOne(@Param('id', ParseIntPipe) id: number): Promise { - // return this.customersService.findOne(id); - // } +// // @Get(':id') +// // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE, RoleEnum.HR, RoleEnum.SUPERVISOR) +// // @ApiOperation({ summary: 'Find customer' }) +// // @ApiResponse({ status: 201, description: 'Customer found', type: CreateCustomerDto }) +// // @ApiResponse({ status: 400, description: 'Customer not found' }) +// // findOne(@Param('id', ParseIntPipe) id: number): Promise { +// // return this.customersService.findOne(id); +// // } - // @Patch(':id') - // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE,RoleEnum.SUPERVISOR) - // @ApiOperation({ summary: 'Update customer' }) - // @ApiResponse({ status: 201, description: 'Customer updated', type: CreateCustomerDto }) - // @ApiResponse({ status: 400, description: 'Customer not found' }) - // update( - // @Param('id', ParseIntPipe) id: number, - // @Body() dto: UpdateCustomerDto, - // ): Promise { - // return this.customersService.update(id, dto); - // } +// // @Patch(':id') +// // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.EMPLOYEE,RoleEnum.SUPERVISOR) +// // @ApiOperation({ summary: 'Update customer' }) +// // @ApiResponse({ status: 201, description: 'Customer updated', type: CreateCustomerDto }) +// // @ApiResponse({ status: 400, description: 'Customer not found' }) +// // update( +// // @Param('id', ParseIntPipe) id: number, +// // @Body() dto: UpdateCustomerDto, +// // ): Promise { +// // return this.customersService.update(id, dto); +// // } - // @Delete(':id') - // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.SUPERVISOR) - // @ApiOperation({ summary: 'Delete customer' }) - // @ApiResponse({ status: 201, description: 'Customer deleted', type: CreateCustomerDto }) - // @ApiResponse({ status: 400, description: 'Customer not found' }) - // remove(@Param('id', ParseIntPipe) id: number): Promise{ - // return this.customersService.remove(id); - // } -} +// // @Delete(':id') +// // //@RolesAllowed(RoleEnum.ACCOUNTING, RoleEnum.ADMIN, RoleEnum.SUPERVISOR) +// // @ApiOperation({ summary: 'Delete customer' }) +// // @ApiResponse({ status: 201, description: 'Customer deleted', type: CreateCustomerDto }) +// // @ApiResponse({ status: 400, description: 'Customer not found' }) +// // remove(@Param('id', ParseIntPipe) id: number): Promise{ +// // return this.customersService.remove(id); +// // } +// } diff --git a/src/modules/customers/customers.module.ts b/src/modules/customers/customers.module.ts index c9e3f9d..cccb363 100644 --- a/src/modules/customers/customers.module.ts +++ b/src/modules/customers/customers.module.ts @@ -1,10 +1,10 @@ -import { Module } from '@nestjs/common'; -import { CustomersController } from './controllers/customers.controller'; -import { CustomersService } from './services/customers.service'; +// import { Module } from '@nestjs/common'; +// import { CustomersController } from './controllers/customers.controller'; +// import { CustomersService } from './services/customers.service'; -@Module({ - controllers:[CustomersController], - providers:[CustomersService], -}) -export class CustomersModule {} \ No newline at end of file +// @Module({ +// controllers:[CustomersController], +// providers:[CustomersService], +// }) +// export class CustomersModule {} \ No newline at end of file diff --git a/src/modules/employees/controllers/employees.controller.ts b/src/modules/employees/controllers/employees.controller.ts index e647547..4828d91 100644 --- a/src/modules/employees/controllers/employees.controller.ts +++ b/src/modules/employees/controllers/employees.controller.ts @@ -1,99 +1,99 @@ -import { Body,Controller,Get,NotFoundException,Param,Patch } from '@nestjs/common'; -import { EmployeesService } from '../services/employees.service'; -import { CreateEmployeeDto } from '../dtos/create-employee.dto'; -import { UpdateEmployeeDto } from '../dtos/update-employee.dto'; -import { RolesAllowed } from '../../../common/decorators/roles.decorators'; -import { ApiBearerAuth, ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger'; -import { EmployeeListItemDto } from '../dtos/list-employee.dto'; -import { EmployeesArchivalService } from '../services/employees-archival.service'; -import { EmployeeProfileItemDto } from 'src/modules/employees/dtos/profil-employee.dto'; +// import { Body,Controller,Get,NotFoundException,Param,Patch } from '@nestjs/common'; +// import { EmployeesService } from '../services/employees.service'; +// import { CreateEmployeeDto } from '../dtos/create-employee.dto'; +// import { UpdateEmployeeDto } from '../dtos/update-employee.dto'; +// import { RolesAllowed } from '../../../common/decorators/roles.decorators'; +// import { ApiBearerAuth, ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger'; +// import { EmployeeListItemDto } from '../dtos/list-employee.dto'; +// import { EmployeesArchivalService } from '../services/employees-archival.service'; +// import { EmployeeProfileItemDto } from 'src/modules/employees/dtos/profil-employee.dto'; -@ApiTags('Employees') -@ApiBearerAuth('access-token') -// @UseGuards() -@Controller('employees') -export class EmployeesController { - constructor( - private readonly employeesService: EmployeesService, - private readonly archiveService: EmployeesArchivalService, - ) {} +// @ApiTags('Employees') +// @ApiBearerAuth('access-token') +// // @UseGuards() +// @Controller('employees') +// export class EmployeesController { +// constructor( +// private readonly employeesService: EmployeesService, +// private readonly archiveService: EmployeesArchivalService, +// ) {} - @Get('employee-list') - //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR, RoleEnum.ACCOUNTING) - @ApiOperation({summary: 'Find all employees with scoped info' }) - @ApiResponse({ status: 200, description: 'List of employees with scoped info found', type: EmployeeListItemDto, isArray: true }) - @ApiResponse({ status: 400, description: 'List of employees with scoped info not found' }) - findListEmployees(): Promise { - return this.employeesService.findListEmployees(); - } +// @Get('employee-list') +// //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR, RoleEnum.ACCOUNTING) +// @ApiOperation({summary: 'Find all employees with scoped info' }) +// @ApiResponse({ status: 200, description: 'List of employees with scoped info found', type: EmployeeListItemDto, isArray: true }) +// @ApiResponse({ status: 400, description: 'List of employees with scoped info not found' }) +// findListEmployees(): Promise { +// return this.employeesService.findListEmployees(); +// } - @Patch(':email') - //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) - @ApiBearerAuth('access-token') - @ApiOperation({ summary: 'Update, archive or restore an employee' }) - @ApiParam({ name: 'email', type: Number, description: 'Email of the employee' }) - @ApiResponse({ status: 200, description: 'Employee updated or restored', type: CreateEmployeeDto }) - @ApiResponse({ status: 202, description: 'Employee archived successfully', type: CreateEmployeeDto }) - @ApiResponse({ status: 404, description: 'Employee not found in active or archive' }) - async updateOrArchiveOrRestore(@Param('email') email: string, @Body() dto: UpdateEmployeeDto,) { - // if last_work_day is set => archive the employee - // else if employee is archived and first_work_day or last_work_day = null => restore - //otherwise => standard update - const result = await this.archiveService.patchEmployee(email, dto); - if(!result) { - throw new NotFoundException(`Employee with email: ${ email } is not found in active or archive.`) - } - return result; - } +// @Patch(':email') +// //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) +// @ApiBearerAuth('access-token') +// @ApiOperation({ summary: 'Update, archive or restore an employee' }) +// @ApiParam({ name: 'email', type: Number, description: 'Email of the employee' }) +// @ApiResponse({ status: 200, description: 'Employee updated or restored', type: CreateEmployeeDto }) +// @ApiResponse({ status: 202, description: 'Employee archived successfully', type: CreateEmployeeDto }) +// @ApiResponse({ status: 404, description: 'Employee not found in active or archive' }) +// async updateOrArchiveOrRestore(@Param('email') email: string, @Body() dto: UpdateEmployeeDto,) { +// // if last_work_day is set => archive the employee +// // else if employee is archived and first_work_day or last_work_day = null => restore +// //otherwise => standard update +// const result = await this.archiveService.patchEmployee(email, dto); +// if(!result) { +// throw new NotFoundException(`Employee with email: ${ email } is not found in active or archive.`) +// } +// return result; +// } - //_____________________________________________________________________________________________ - // Deprecated or unused methods - //_____________________________________________________________________________________________ +// //_____________________________________________________________________________________________ +// // Deprecated or unused methods +// //_____________________________________________________________________________________________ - // @Post() - // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) - // @ApiOperation({summary: 'Create employee' }) - // @ApiResponse({ status: 201, description: 'Employee created', type: CreateEmployeeDto }) - // @ApiResponse({ status: 400, description: 'Incomplete task or invalid data' }) - // create(@Body() dto: CreateEmployeeDto): Promise { - // return this.employeesService.create(dto); - // } - // @Get() - // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR, RoleEnum.ACCOUNTING) - // @ApiOperation({summary: 'Find all employees' }) - // @ApiResponse({ status: 200, description: 'List of employees found', type: CreateEmployeeDto, isArray: true }) - // @ApiResponse({ status: 400, description: 'List of employees not found' }) - // findAll(): Promise { - // return this.employeesService.findAll(); - // } +// // @Post() +// // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR) +// // @ApiOperation({summary: 'Create employee' }) +// // @ApiResponse({ status: 201, description: 'Employee created', type: CreateEmployeeDto }) +// // @ApiResponse({ status: 400, description: 'Incomplete task or invalid data' }) +// // create(@Body() dto: CreateEmployeeDto): Promise { +// // return this.employeesService.create(dto); +// // } +// // @Get() +// // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR, RoleEnum.ACCOUNTING) +// // @ApiOperation({summary: 'Find all employees' }) +// // @ApiResponse({ status: 200, description: 'List of employees found', type: CreateEmployeeDto, isArray: true }) +// // @ApiResponse({ status: 400, description: 'List of employees not found' }) +// // findAll(): Promise { +// // return this.employeesService.findAll(); +// // } - // @Get(':email') - // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR,RoleEnum.ACCOUNTING ) - // @ApiOperation({summary: 'Find employee' }) - // @ApiResponse({ status: 200, description: 'Employee found', type: CreateEmployeeDto }) - // @ApiResponse({ status: 400, description: 'Employee not found' }) - // findOne(@Param('email', ParseIntPipe) email: string): Promise { - // return this.employeesService.findOne(email); - // } +// // @Get(':email') +// // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR,RoleEnum.ACCOUNTING ) +// // @ApiOperation({summary: 'Find employee' }) +// // @ApiResponse({ status: 200, description: 'Employee found', type: CreateEmployeeDto }) +// // @ApiResponse({ status: 400, description: 'Employee not found' }) +// // findOne(@Param('email', ParseIntPipe) email: string): Promise { +// // return this.employeesService.findOne(email); +// // } - @Get('profile/:email') - @ApiOperation({summary: 'Find employee profile' }) - @ApiParam({ name: 'email', type: String, description: 'Identifier of the employee' }) - @ApiResponse({ status: 200, description: 'Employee profile found', type: EmployeeProfileItemDto }) - @ApiResponse({ status: 400, description: 'Employee profile not found' }) - findOneProfile(@Param('email') email: string): Promise { - return this.employeesService.findOneProfile(email); - } +// @Get('profile/:email') +// @ApiOperation({summary: 'Find employee profile' }) +// @ApiParam({ name: 'email', type: String, description: 'Identifier of the employee' }) +// @ApiResponse({ status: 200, description: 'Employee profile found', type: EmployeeProfileItemDto }) +// @ApiResponse({ status: 400, description: 'Employee profile not found' }) +// findOneProfile(@Param('email') email: string): Promise { +// return this.employeesService.findOneProfile(email); +// } - // @Delete(':email') - // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR ) - // @ApiOperation({summary: 'Delete employee' }) - // @ApiParam({ name: 'email', type: Number, description: 'Email of the employee to delete' }) - // @ApiResponse({ status: 204, description: 'Employee deleted' }) - // @ApiResponse({ status: 404, description: 'Employee not found' }) - // remove(@Param('email', ParseIntPipe) email: string): Promise { - // return this.employeesService.remove(email); - // } +// // @Delete(':email') +// // //@RolesAllowed(RoleEnum.ADMIN, RoleEnum.HR, RoleEnum.SUPERVISOR ) +// // @ApiOperation({summary: 'Delete employee' }) +// // @ApiParam({ name: 'email', type: Number, description: 'Email of the employee to delete' }) +// // @ApiResponse({ status: 204, description: 'Employee deleted' }) +// // @ApiResponse({ status: 404, description: 'Employee not found' }) +// // remove(@Param('email', ParseIntPipe) email: string): Promise { +// // return this.employeesService.remove(email); +// // } -} +// } diff --git a/src/modules/employees/employees.module.ts b/src/modules/employees/employees.module.ts index 2fd40ee..676f4b0 100644 --- a/src/modules/employees/employees.module.ts +++ b/src/modules/employees/employees.module.ts @@ -1,13 +1,12 @@ -import { Module } from '@nestjs/common'; -import { EmployeesController } from './controllers/employees.controller'; -import { EmployeesService } from './services/employees.service'; -import { EmployeesArchivalService } from './services/employees-archival.service'; -import { SharedModule } from '../../Time_And_Attendance/modules/shared/shared.module'; +// import { Module } from '@nestjs/common'; +// import { EmployeesController } from './controllers/employees.controller'; +// import { EmployeesService } from './services/employees.service'; +// import { SharedModule } from '../../time-and-attendance/modules/shared/shared.module'; -@Module({ - imports: [SharedModule], - controllers: [EmployeesController], - providers: [EmployeesService, EmployeesArchivalService], - exports: [EmployeesService, EmployeesArchivalService], -}) -export class EmployeesModule {} +// @Module({ +// imports: [SharedModule], +// controllers: [EmployeesController], +// providers: [EmployeesService], +// exports: [EmployeesService ], +// }) +// export class EmployeesModule {} diff --git a/src/modules/employees/services/employees-archival.service.ts b/src/modules/employees/services/employees-archival.service.ts index b13fa74..6046e94 100644 --- a/src/modules/employees/services/employees-archival.service.ts +++ b/src/modules/employees/services/employees-archival.service.ts @@ -1,173 +1,173 @@ -import { Injectable } from "@nestjs/common"; -import { Employees, EmployeesArchive, Users } from "@prisma/client"; -import { PrismaService } from "src/prisma/prisma.service"; -import { UpdateEmployeeDto } from "../dtos/update-employee.dto"; -import { toDateOrUndefined, toDateOrNull } from "../utils/employee.utils"; +// import { Injectable } from "@nestjs/common"; +// import { Employees, EmployeesArchive, Users } from "@prisma/client"; +// import { PrismaService } from "src/prisma/prisma.service"; +// import { UpdateEmployeeDto } from "../dtos/update-employee.dto"; +// import { toDateOrUndefined, toDateOrNull } from "../utils/employee.utils"; -@Injectable() -export class EmployeesArchivalService { - constructor(private readonly prisma: PrismaService) { } +// @Injectable() +// export class EmployeesArchivalService { +// constructor(private readonly prisma: PrismaService) { } - async patchEmployee(email: string, dto: UpdateEmployeeDto): Promise { - // 1) Tenter sur employés actifs - const active = await this.prisma.employees.findFirst({ - where: { user: { email } }, - include: { user: true }, - }); +// async patchEmployee(email: string, dto: UpdateEmployeeDto): Promise { +// // 1) Tenter sur employés actifs +// const active = await this.prisma.employees.findFirst({ +// where: { user: { email } }, +// include: { user: true }, +// }); - if (active) { - // Archivage : si on reçoit un last_work_day défini et que l'employé n’est pas déjà terminé - if (dto.last_work_day !== undefined && active.last_work_day == null && dto.last_work_day !== null) { - return this.archiveOnTermination(active, dto); - } +// if (active) { +// // Archivage : si on reçoit un last_work_day défini et que l'employé n’est pas déjà terminé +// if (dto.last_work_day !== undefined && active.last_work_day == null && dto.last_work_day !== null) { +// return this.archiveOnTermination(active, dto); +// } - // Sinon, update standard (split Users/Employees) - const { - first_name, - last_name, - email: new_email, - phone_number, - residence, - external_payroll_id, - company_code, - job_title, - first_work_day, - last_work_day, - supervisor_id, - is_supervisor, - } = dto as any; +// // Sinon, update standard (split Users/Employees) +// const { +// first_name, +// last_name, +// email: new_email, +// phone_number, +// residence, +// external_payroll_id, +// company_code, +// job_title, +// first_work_day, +// last_work_day, +// supervisor_id, +// is_supervisor, +// } = dto as any; - const first_work_d = toDateOrUndefined(first_work_day); - const last_work_d = Object.prototype.hasOwnProperty('last_work_day') - ? toDateOrNull(last_work_day ?? null) - : undefined; +// const first_work_d = toDateOrUndefined(first_work_day); +// const last_work_d = Object.prototype.hasOwnProperty('last_work_day') +// ? toDateOrNull(last_work_day ?? null) +// : undefined; - await this.prisma.$transaction(async (transaction) => { - if ( - first_name !== undefined || - last_name !== undefined || - new_email !== undefined || - phone_number !== undefined || - residence !== undefined - ) { - await transaction.users.update({ - where: { id: active.user_id }, - data: { - ...(first_name !== undefined ? { first_name } : {}), - ...(last_name !== undefined ? { last_name } : {}), - ...(email !== undefined ? { email: new_email } : {}), - ...(phone_number !== undefined ? { phone_number } : {}), - ...(residence !== undefined ? { residence } : {}), - }, - }); +// await this.prisma.$transaction(async (transaction) => { +// if ( +// first_name !== undefined || +// last_name !== undefined || +// new_email !== undefined || +// phone_number !== undefined || +// residence !== undefined +// ) { +// await transaction.users.update({ +// where: { id: active.user_id }, +// data: { +// ...(first_name !== undefined ? { first_name } : {}), +// ...(last_name !== undefined ? { last_name } : {}), +// ...(email !== undefined ? { email: new_email } : {}), +// ...(phone_number !== undefined ? { phone_number } : {}), +// ...(residence !== undefined ? { residence } : {}), +// }, +// }); - } +// } - const updated = await transaction.employees.update({ - where: { id: active.id }, - data: { - ...(external_payroll_id !== undefined ? { external_payroll_id } : {}), - ...(company_code !== undefined ? { company_code } : {}), - ...(job_title !== undefined ? { job_title } : {}), - ...(first_work_d !== undefined ? { first_work_day: first_work_d } : {}), - ...(last_work_d !== undefined ? { last_work_day: last_work_d } : {}), - ...(is_supervisor !== undefined ? { is_supervisor } : {}), - ...(supervisor_id !== undefined ? { supervisor_id } : {}), - }, - include: { user: true }, - }); +// const updated = await transaction.employees.update({ +// where: { id: active.id }, +// data: { +// ...(external_payroll_id !== undefined ? { external_payroll_id } : {}), +// ...(company_code !== undefined ? { company_code } : {}), +// ...(job_title !== undefined ? { job_title } : {}), +// ...(first_work_d !== undefined ? { first_work_day: first_work_d } : {}), +// ...(last_work_d !== undefined ? { last_work_day: last_work_d } : {}), +// ...(is_supervisor !== undefined ? { is_supervisor } : {}), +// ...(supervisor_id !== undefined ? { supervisor_id } : {}), +// }, +// include: { user: true }, +// }); - return updated; - }); +// return updated; +// }); - return this.prisma.employees.findFirst({ where: { user: { email } } }); - } +// return this.prisma.employees.findFirst({ where: { user: { email } } }); +// } - const user = await this.prisma.users.findUnique({ where: { email } }); - if (!user) return null; - // 2) Pas trouvé en actifs → regarder en archive (pour restauration) - const archived = await this.prisma.employeesArchive.findFirst({ - where: { user_id: user.id }, - include: { user: true }, - }); +// const user = await this.prisma.users.findUnique({ where: { email } }); +// if (!user) return null; +// // 2) Pas trouvé en actifs → regarder en archive (pour restauration) +// const archived = await this.prisma.employeesArchive.findFirst({ +// where: { user_id: user.id }, +// include: { user: true }, +// }); - if (archived) { - // Condition de restauration : last_work_day === null ou first_work_day fourni - const restore = dto.last_work_day === null || dto.first_work_day != null; - if (restore) { - return this.restoreEmployee(archived, dto); - } - } - // 3) Ni actif, ni archivé → 404 dans le controller - return null; - } +// if (archived) { +// // Condition de restauration : last_work_day === null ou first_work_day fourni +// const restore = dto.last_work_day === null || dto.first_work_day != null; +// if (restore) { +// return this.restoreEmployee(archived, dto); +// } +// } +// // 3) Ni actif, ni archivé → 404 dans le controller +// return null; +// } - //transfers the employee to archive and then delete from employees table - private async archiveOnTermination(active: Employees & { user: Users }, dto: UpdateEmployeeDto): Promise { - const last_work_d = toDateOrNull(dto.last_work_day!); - if (!last_work_d) throw new Error('invalide last_work_day for archive'); - return this.prisma.$transaction(async transaction => { - //detach crew from supervisor if employee is a supervisor - await transaction.employees.updateMany({ - where: { supervisor_id: active.id }, - data: { supervisor_id: null }, - }) - const archived = await transaction.employeesArchive.create({ - data: { - employee_id: active.id, - user_id: active.user_id, - first_name: active.user.first_name, - last_name: active.user.last_name, - company_code: active.company_code, - job_title: active.job_title, - first_work_day: active.first_work_day, - last_work_day: last_work_d, - supervisor_id: active.supervisor_id ?? null, - is_supervisor: active.is_supervisor, - external_payroll_id: active.external_payroll_id, - }, - include: { user: true } - }); - //delete from employees table - await transaction.employees.delete({ where: { id: active.id } }); - //return archived employee - return archived - }); - } +// //transfers the employee to archive and then delete from employees table +// private async archiveOnTermination(active: Employees & { user: Users }, dto: UpdateEmployeeDto): Promise { +// const last_work_d = toDateOrNull(dto.last_work_day!); +// if (!last_work_d) throw new Error('invalide last_work_day for archive'); +// return this.prisma.$transaction(async transaction => { +// //detach crew from supervisor if employee is a supervisor +// await transaction.employees.updateMany({ +// where: { supervisor_id: active.id }, +// data: { supervisor_id: null }, +// }) +// const archived = await transaction.employeesArchive.create({ +// data: { +// employee_id: active.id, +// user_id: active.user_id, +// first_name: active.user.first_name, +// last_name: active.user.last_name, +// company_code: active.company_code, +// job_title: active.job_title, +// first_work_day: active.first_work_day, +// last_work_day: last_work_d, +// supervisor_id: active.supervisor_id ?? null, +// is_supervisor: active.is_supervisor, +// external_payroll_id: active.external_payroll_id, +// }, +// include: { user: true } +// }); +// //delete from employees table +// await transaction.employees.delete({ where: { id: active.id } }); +// //return archived employee +// return archived +// }); +// } - //transfers the employee from archive to the employees table - private async restoreEmployee(archived: EmployeesArchive & { user: Users }, dto: UpdateEmployeeDto): Promise { - // const first_work_d = toDateOrUndefined(dto.first_work_day); - return this.prisma.$transaction(async transaction => { - //restores the archived employee into the employees table - const restored = await transaction.employees.create({ - data: { - user_id: archived.user_id, - company_code: archived.company_code, - job_title: archived.job_title, - first_work_day: archived.first_work_day, - last_work_day: null, - is_supervisor: archived.is_supervisor ?? false, - external_payroll_id: archived.external_payroll_id, - }, - }); - //deleting archived entry by id - await transaction.employeesArchive.delete({ where: { id: archived.id } }); +// //transfers the employee from archive to the employees table +// private async restoreEmployee(archived: EmployeesArchive & { user: Users }, dto: UpdateEmployeeDto): Promise { +// // const first_work_d = toDateOrUndefined(dto.first_work_day); +// return this.prisma.$transaction(async transaction => { +// //restores the archived employee into the employees table +// const restored = await transaction.employees.create({ +// data: { +// user_id: archived.user_id, +// company_code: archived.company_code, +// job_title: archived.job_title, +// first_work_day: archived.first_work_day, +// last_work_day: null, +// is_supervisor: archived.is_supervisor ?? false, +// external_payroll_id: archived.external_payroll_id, +// }, +// }); +// //deleting archived entry by id +// await transaction.employeesArchive.delete({ where: { id: archived.id } }); - //return restored employee - return restored; - }); - } +// //return restored employee +// return restored; +// }); +// } - //fetches all archived employees - async findAllArchived(): Promise { - return this.prisma.employeesArchive.findMany(); - } +// //fetches all archived employees +// async findAllArchived(): Promise { +// return this.prisma.employeesArchive.findMany(); +// } - //fetches an archived employee - async findOneArchived(id: number): Promise { - return this.prisma.employeesArchive.findUniqueOrThrow({ where: { id } }); - } +// //fetches an archived employee +// async findOneArchived(id: number): Promise { +// return this.prisma.employeesArchive.findUniqueOrThrow({ where: { id } }); +// } -} +// } diff --git a/src/modules/expenses/expenses.module.ts b/src/modules/expenses/expenses.module.ts deleted file mode 100644 index 85f62cb..0000000 --- a/src/modules/expenses/expenses.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ExpensesArchivalService } from "./services/expenses-archival.service"; -import { BusinessLogicsModule } from "src/modules/business-logics/business-logics.module"; -import { ExpenseUpsertService } from "src/modules/expenses/services/expense-upsert.service"; -import { ExpenseController } from "src/modules/expenses/controllers/expense.controller"; -import { SharedModule } from "../shared/shared.module"; -import { Module } from "@nestjs/common"; - -@Module({ - imports: [ BusinessLogicsModule, SharedModule ], - controllers: [ ExpenseController ], - providers: [ ExpenseUpsertService, ExpensesArchivalService ], - exports: [ ExpensesArchivalService ], -}) - -export class ExpensesModule {} \ No newline at end of file diff --git a/src/modules/exports/csv-exports.module.ts b/src/modules/exports/csv-exports.module.ts index 0c9f00b..fa0c7f1 100644 --- a/src/modules/exports/csv-exports.module.ts +++ b/src/modules/exports/csv-exports.module.ts @@ -1,7 +1,7 @@ import { Module } from "@nestjs/common"; import { CsvExportController } from "./controllers/csv-exports.controller"; import { CsvExportService } from "./services/csv-exports.service"; -import { SharedModule } from "../../Time_And_Attendance/modules/shared/shared.module"; +import { SharedModule } from "../../time-and-attendance/modules/shared/shared.module"; @Module({ providers:[CsvExportService, SharedModule], diff --git a/src/modules/preferences/preferences.module.ts b/src/modules/preferences/preferences.module.ts index 59031ba..65deb82 100644 --- a/src/modules/preferences/preferences.module.ts +++ b/src/modules/preferences/preferences.module.ts @@ -1,7 +1,7 @@ import { Module } from "@nestjs/common"; import { PreferencesController } from "./controllers/preferences.controller"; import { PreferencesService } from "./services/preferences.service"; -import { SharedModule } from "../../Time_And_Attendance/modules/shared/shared.module"; +import { SharedModule } from "../../time-and-attendance/modules/shared/shared.module"; @Module({ imports: [SharedModule], diff --git a/src/modules/preferences/services/preferences.service.ts b/src/modules/preferences/services/preferences.service.ts index 2677573..2ff02ac 100644 --- a/src/modules/preferences/services/preferences.service.ts +++ b/src/modules/preferences/services/preferences.service.ts @@ -2,7 +2,7 @@ import { Injectable } from "@nestjs/common"; import { Preferences } from "@prisma/client"; import { PrismaService } from "src/prisma/prisma.service"; import { PreferencesDto } from "../dtos/preferences.dto"; -import { EmailToIdResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; @Injectable() export class PreferencesService { diff --git a/src/modules/timesheets/timesheets.module.ts b/src/modules/timesheets/timesheets.module.ts deleted file mode 100644 index e1c997e..0000000 --- a/src/modules/timesheets/timesheets.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { GetTimesheetsOverviewService } from '../../Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service'; -import { TimesheetArchiveService } from '../../Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-archive.service'; -import { BusinessLogicsModule } from 'src/modules/business-logics/business-logics.module'; -import { TimesheetController } from '../../Time_And_Attendance/modules/time-tracker/timesheets/controllers/timesheet.controller'; -import { SharedModule } from '../../Time_And_Attendance/modules/shared/shared.module'; -import { ShiftsModule } from '../../Time_And_Attendance/modules/time-tracker/shifts/shifts.module'; -import { Module } from '@nestjs/common'; - -@Module({ - imports: [ - BusinessLogicsModule, - SharedModule, - ShiftsModule, - ], - controllers: [TimesheetController], - providers: [ - TimesheetArchiveService, - GetTimesheetsOverviewService, - SharedModule, - ], - exports: [], -}) -export class TimesheetsModule {} diff --git a/src/Time_And_Attendance/domains/business-logics.module.ts b/src/time-and-attendance/domains/business-logics.module.ts similarity index 100% rename from src/Time_And_Attendance/domains/business-logics.module.ts rename to src/time-and-attendance/domains/business-logics.module.ts diff --git a/src/Time_And_Attendance/domains/services/after-hours.service.ts b/src/time-and-attendance/domains/services/after-hours.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/after-hours.service.ts rename to src/time-and-attendance/domains/services/after-hours.service.ts diff --git a/src/Time_And_Attendance/domains/services/holiday.service.ts b/src/time-and-attendance/domains/services/holiday.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/holiday.service.ts rename to src/time-and-attendance/domains/services/holiday.service.ts diff --git a/src/Time_And_Attendance/domains/services/mileage.service.ts b/src/time-and-attendance/domains/services/mileage.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/mileage.service.ts rename to src/time-and-attendance/domains/services/mileage.service.ts diff --git a/src/Time_And_Attendance/domains/services/overtime.service.ts b/src/time-and-attendance/domains/services/overtime.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/overtime.service.ts rename to src/time-and-attendance/domains/services/overtime.service.ts diff --git a/src/Time_And_Attendance/domains/services/sick-leave.service.ts b/src/time-and-attendance/domains/services/sick-leave.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/sick-leave.service.ts rename to src/time-and-attendance/domains/services/sick-leave.service.ts diff --git a/src/Time_And_Attendance/domains/services/vacation.service.ts b/src/time-and-attendance/domains/services/vacation.service.ts similarity index 100% rename from src/Time_And_Attendance/domains/services/vacation.service.ts rename to src/time-and-attendance/domains/services/vacation.service.ts diff --git a/src/modules/expenses/controllers/expense.controller.ts b/src/time-and-attendance/modules/expenses/controllers/expense.controller.ts similarity index 91% rename from src/modules/expenses/controllers/expense.controller.ts rename to src/time-and-attendance/modules/expenses/controllers/expense.controller.ts index e5e5f56..b7a3736 100644 --- a/src/modules/expenses/controllers/expense.controller.ts +++ b/src/time-and-attendance/modules/expenses/controllers/expense.controller.ts @@ -2,7 +2,7 @@ import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post } from import { PrismaService } from "src/prisma/prisma.service"; import { ExpenseDto } from "../dtos/expense.dto"; import { CreateResult, ExpenseUpsertService, UpdateResult } from "../services/expense-upsert.service"; -import { updateExpenseDto } from "src/modules/expenses/dtos/update-expense.dto"; +import { updateExpenseDto } from "src/time-and-attendance/modules/expenses/dtos/update-expense.dto"; @Controller('expense') diff --git a/src/modules/expenses/dtos/expense.dto.ts b/src/time-and-attendance/modules/expenses/dtos/expense.dto.ts similarity index 100% rename from src/modules/expenses/dtos/expense.dto.ts rename to src/time-and-attendance/modules/expenses/dtos/expense.dto.ts diff --git a/src/modules/expenses/dtos/get-expense.dto.ts b/src/time-and-attendance/modules/expenses/dtos/get-expense.dto.ts similarity index 100% rename from src/modules/expenses/dtos/get-expense.dto.ts rename to src/time-and-attendance/modules/expenses/dtos/get-expense.dto.ts diff --git a/src/modules/expenses/dtos/update-expense.dto.ts b/src/time-and-attendance/modules/expenses/dtos/update-expense.dto.ts similarity index 100% rename from src/modules/expenses/dtos/update-expense.dto.ts rename to src/time-and-attendance/modules/expenses/dtos/update-expense.dto.ts diff --git a/src/time-and-attendance/modules/expenses/expenses.module.ts b/src/time-and-attendance/modules/expenses/expenses.module.ts new file mode 100644 index 0000000..923ce3e --- /dev/null +++ b/src/time-and-attendance/modules/expenses/expenses.module.ts @@ -0,0 +1,15 @@ +import { ExpensesArchivalService } from "./services/expenses-archival.service"; +import { ExpenseUpsertService } from "src/time-and-attendance/modules/expenses/services/expense-upsert.service"; +import { ExpenseController } from "src/time-and-attendance/modules/expenses/controllers/expense.controller"; +import { Module } from "@nestjs/common"; +import { BusinessLogicsModule } from "src/time-and-attendance/domains/business-logics.module"; +import { SharedModule } from "src/time-and-attendance/modules/shared/shared.module"; + +@Module({ + imports: [ BusinessLogicsModule, SharedModule ], + controllers: [ ExpenseController ], + providers: [ ExpenseUpsertService, ExpensesArchivalService ], + exports: [ ExpensesArchivalService ], +}) + +export class ExpensesModule {} \ No newline at end of file diff --git a/src/modules/expenses/helpers/expenses-date-time-helpers.ts b/src/time-and-attendance/modules/expenses/helpers/expenses-date-time-helpers.ts similarity index 100% rename from src/modules/expenses/helpers/expenses-date-time-helpers.ts rename to src/time-and-attendance/modules/expenses/helpers/expenses-date-time-helpers.ts diff --git a/src/modules/expenses/services/expense-upsert.service.ts b/src/time-and-attendance/modules/expenses/services/expense-upsert.service.ts similarity index 100% rename from src/modules/expenses/services/expense-upsert.service.ts rename to src/time-and-attendance/modules/expenses/services/expense-upsert.service.ts diff --git a/src/modules/expenses/services/expenses-archival.service.ts b/src/time-and-attendance/modules/expenses/services/expenses-archival.service.ts similarity index 100% rename from src/modules/expenses/services/expenses-archival.service.ts rename to src/time-and-attendance/modules/expenses/services/expenses-archival.service.ts diff --git a/src/modules/expenses/~misc_deprecated-files/create-expense.dto.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/create-expense.dto.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/create-expense.dto.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/create-expense.dto.ts diff --git a/src/modules/expenses/~misc_deprecated-files/expenses-command.service.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses-command.service.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/expenses-command.service.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses-command.service.ts diff --git a/src/modules/expenses/~misc_deprecated-files/expenses-query.service.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses-query.service.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/expenses-query.service.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses-query.service.ts diff --git a/src/modules/expenses/~misc_deprecated-files/expenses.controller.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.controller.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/expenses.controller.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.controller.ts diff --git a/src/modules/expenses/~misc_deprecated-files/expenses.types.interfaces.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.types.interfaces.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/expenses.types.interfaces.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.types.interfaces.ts diff --git a/src/modules/expenses/~misc_deprecated-files/expenses.utils.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.utils.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/expenses.utils.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/expenses.utils.ts diff --git a/src/modules/expenses/~misc_deprecated-files/search-expense.dto.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/search-expense.dto.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/search-expense.dto.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/search-expense.dto.ts diff --git a/src/modules/expenses/~misc_deprecated-files/update-expense.dto.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/update-expense.dto.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/update-expense.dto.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/update-expense.dto.ts diff --git a/src/modules/expenses/~misc_deprecated-files/upsert-expense.dto.ts b/src/time-and-attendance/modules/expenses/~misc_deprecated-files/upsert-expense.dto.ts similarity index 100% rename from src/modules/expenses/~misc_deprecated-files/upsert-expense.dto.ts rename to src/time-and-attendance/modules/expenses/~misc_deprecated-files/upsert-expense.dto.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/controllers/leave-requests.controller.ts b/src/time-and-attendance/modules/leave-requests/controllers/leave-requests.controller.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/controllers/leave-requests.controller.ts rename to src/time-and-attendance/modules/leave-requests/controllers/leave-requests.controller.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/dtos/leave-request-view.dto.ts b/src/time-and-attendance/modules/leave-requests/dtos/leave-request-view.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/dtos/leave-request-view.dto.ts rename to src/time-and-attendance/modules/leave-requests/dtos/leave-request-view.dto.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/dtos/upsert-leave-request.dto.ts b/src/time-and-attendance/modules/leave-requests/dtos/upsert-leave-request.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/dtos/upsert-leave-request.dto.ts rename to src/time-and-attendance/modules/leave-requests/dtos/upsert-leave-request.dto.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/leave-requests.module.ts b/src/time-and-attendance/modules/leave-requests/leave-requests.module.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/leave-requests.module.ts rename to src/time-and-attendance/modules/leave-requests/leave-requests.module.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/mappers/leave-requests-archive.mapper.ts b/src/time-and-attendance/modules/leave-requests/mappers/leave-requests-archive.mapper.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/mappers/leave-requests-archive.mapper.ts rename to src/time-and-attendance/modules/leave-requests/mappers/leave-requests-archive.mapper.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/mappers/leave-requests.mapper.ts b/src/time-and-attendance/modules/leave-requests/mappers/leave-requests.mapper.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/mappers/leave-requests.mapper.ts rename to src/time-and-attendance/modules/leave-requests/mappers/leave-requests.mapper.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/services/holiday-leave-requests.service.ts b/src/time-and-attendance/modules/leave-requests/services/holiday-leave-requests.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/services/holiday-leave-requests.service.ts rename to src/time-and-attendance/modules/leave-requests/services/holiday-leave-requests.service.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/services/leave-request.service.ts b/src/time-and-attendance/modules/leave-requests/services/leave-request.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/services/leave-request.service.ts rename to src/time-and-attendance/modules/leave-requests/services/leave-request.service.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/services/sick-leave-requests.service.ts b/src/time-and-attendance/modules/leave-requests/services/sick-leave-requests.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/services/sick-leave-requests.service.ts rename to src/time-and-attendance/modules/leave-requests/services/sick-leave-requests.service.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/services/vacation-leave-requests.service.ts b/src/time-and-attendance/modules/leave-requests/services/vacation-leave-requests.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/services/vacation-leave-requests.service.ts rename to src/time-and-attendance/modules/leave-requests/services/vacation-leave-requests.service.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/utils/leave-request.transform.ts b/src/time-and-attendance/modules/leave-requests/utils/leave-request.transform.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/utils/leave-request.transform.ts rename to src/time-and-attendance/modules/leave-requests/utils/leave-request.transform.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/utils/leave-request.util.ts b/src/time-and-attendance/modules/leave-requests/utils/leave-request.util.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/utils/leave-request.util.ts rename to src/time-and-attendance/modules/leave-requests/utils/leave-request.util.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/utils/leave-requests-archive.select.ts b/src/time-and-attendance/modules/leave-requests/utils/leave-requests-archive.select.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/utils/leave-requests-archive.select.ts rename to src/time-and-attendance/modules/leave-requests/utils/leave-requests-archive.select.ts diff --git a/src/Time_And_Attendance/modules/leave-requests/utils/leave-requests.select.ts b/src/time-and-attendance/modules/leave-requests/utils/leave-requests.select.ts similarity index 100% rename from src/Time_And_Attendance/modules/leave-requests/utils/leave-requests.select.ts rename to src/time-and-attendance/modules/leave-requests/utils/leave-requests.select.ts diff --git a/src/Time_And_Attendance/modules/pay-period/controllers/pay-periods.controller.ts b/src/time-and-attendance/modules/pay-period/controllers/pay-periods.controller.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/controllers/pay-periods.controller.ts rename to src/time-and-attendance/modules/pay-period/controllers/pay-periods.controller.ts diff --git a/src/Time_And_Attendance/modules/pay-period/dtos/bulk-crew-approval.dto.ts b/src/time-and-attendance/modules/pay-period/dtos/bulk-crew-approval.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/dtos/bulk-crew-approval.dto.ts rename to src/time-and-attendance/modules/pay-period/dtos/bulk-crew-approval.dto.ts diff --git a/src/Time_And_Attendance/modules/pay-period/dtos/bundle-pay-period.dto.ts b/src/time-and-attendance/modules/pay-period/dtos/bundle-pay-period.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/dtos/bundle-pay-period.dto.ts rename to src/time-and-attendance/modules/pay-period/dtos/bundle-pay-period.dto.ts diff --git a/src/Time_And_Attendance/modules/pay-period/dtos/overview-employee-period.dto.ts b/src/time-and-attendance/modules/pay-period/dtos/overview-employee-period.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/dtos/overview-employee-period.dto.ts rename to src/time-and-attendance/modules/pay-period/dtos/overview-employee-period.dto.ts diff --git a/src/Time_And_Attendance/modules/pay-period/dtos/overview-pay-period.dto.ts b/src/time-and-attendance/modules/pay-period/dtos/overview-pay-period.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/dtos/overview-pay-period.dto.ts rename to src/time-and-attendance/modules/pay-period/dtos/overview-pay-period.dto.ts diff --git a/src/Time_And_Attendance/modules/pay-period/dtos/pay-period.dto.ts b/src/time-and-attendance/modules/pay-period/dtos/pay-period.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/dtos/pay-period.dto.ts rename to src/time-and-attendance/modules/pay-period/dtos/pay-period.dto.ts diff --git a/src/Time_And_Attendance/modules/pay-period/mappers/pay-periods.mapper.ts b/src/time-and-attendance/modules/pay-period/mappers/pay-periods.mapper.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/mappers/pay-periods.mapper.ts rename to src/time-and-attendance/modules/pay-period/mappers/pay-periods.mapper.ts diff --git a/src/Time_And_Attendance/modules/pay-period/pay-periods.module.ts b/src/time-and-attendance/modules/pay-period/pay-periods.module.ts similarity index 68% rename from src/Time_And_Attendance/modules/pay-period/pay-periods.module.ts rename to src/time-and-attendance/modules/pay-period/pay-periods.module.ts index fabd257..6e15221 100644 --- a/src/Time_And_Attendance/modules/pay-period/pay-periods.module.ts +++ b/src/time-and-attendance/modules/pay-period/pay-periods.module.ts @@ -1,14 +1,13 @@ -import { PrismaModule } from "src/prisma/prisma.module"; -import { PayPeriodsController } from "./controllers/pay-periods.controller"; -import { Module } from "@nestjs/common"; import { PayPeriodsQueryService } from "./services/pay-periods-query.service"; -import { TimesheetsModule } from "../time-tracker/timesheets/timesheets.module"; -import { SharedModule } from "../shared/shared.module"; +import { BusinessLogicsModule } from "src/time-and-attendance/domains/business-logics.module"; +import { PayPeriodsController } from "./controllers/pay-periods.controller"; import { PrismaService } from "src/prisma/prisma.service"; -import { BusinessLogicsModule } from "../../../modules/business-logics/business-logics.module"; +import { PrismaModule } from "src/prisma/prisma.module"; +import { SharedModule } from "../shared/shared.module"; +import { Module } from "@nestjs/common"; @Module({ - imports: [PrismaModule, TimesheetsModule, SharedModule, BusinessLogicsModule], + imports: [PrismaModule, SharedModule, BusinessLogicsModule], providers: [ PayPeriodsQueryService, PrismaService, diff --git a/src/Time_And_Attendance/modules/pay-period/services/pay-periods-command.service.ts b/src/time-and-attendance/modules/pay-period/services/pay-periods-command.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/services/pay-periods-command.service.ts rename to src/time-and-attendance/modules/pay-period/services/pay-periods-command.service.ts diff --git a/src/Time_And_Attendance/modules/pay-period/services/pay-periods-query.service.ts b/src/time-and-attendance/modules/pay-period/services/pay-periods-query.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/services/pay-periods-query.service.ts rename to src/time-and-attendance/modules/pay-period/services/pay-periods-query.service.ts diff --git a/src/Time_And_Attendance/modules/pay-period/utils/pay-year.util.ts b/src/time-and-attendance/modules/pay-period/utils/pay-year.util.ts similarity index 100% rename from src/Time_And_Attendance/modules/pay-period/utils/pay-year.util.ts rename to src/time-and-attendance/modules/pay-period/utils/pay-year.util.ts diff --git a/src/Time_And_Attendance/modules/shared/constants/date-time.constant.ts b/src/time-and-attendance/modules/shared/constants/date-time.constant.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/constants/date-time.constant.ts rename to src/time-and-attendance/modules/shared/constants/date-time.constant.ts diff --git a/src/Time_And_Attendance/modules/shared/constants/regex.constant.ts b/src/time-and-attendance/modules/shared/constants/regex.constant.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/constants/regex.constant.ts rename to src/time-and-attendance/modules/shared/constants/regex.constant.ts diff --git a/src/Time_And_Attendance/modules/shared/constants/utils.constant.ts b/src/time-and-attendance/modules/shared/constants/utils.constant.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/constants/utils.constant.ts rename to src/time-and-attendance/modules/shared/constants/utils.constant.ts diff --git a/src/Time_And_Attendance/modules/shared/helpers/date-time.helpers.ts b/src/time-and-attendance/modules/shared/helpers/date-time.helpers.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/helpers/date-time.helpers.ts rename to src/time-and-attendance/modules/shared/helpers/date-time.helpers.ts diff --git a/src/Time_And_Attendance/modules/shared/interfaces/shifts.interface.ts b/src/time-and-attendance/modules/shared/interfaces/shifts.interface.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/interfaces/shifts.interface.ts rename to src/time-and-attendance/modules/shared/interfaces/shifts.interface.ts diff --git a/src/Time_And_Attendance/modules/shared/selects/expenses.select.ts b/src/time-and-attendance/modules/shared/selects/expenses.select.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/selects/expenses.select.ts rename to src/time-and-attendance/modules/shared/selects/expenses.select.ts diff --git a/src/Time_And_Attendance/modules/shared/selects/pay-periods.select.ts b/src/time-and-attendance/modules/shared/selects/pay-periods.select.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/selects/pay-periods.select.ts rename to src/time-and-attendance/modules/shared/selects/pay-periods.select.ts diff --git a/src/Time_And_Attendance/modules/shared/selects/shifts.select.ts b/src/time-and-attendance/modules/shared/selects/shifts.select.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/selects/shifts.select.ts rename to src/time-and-attendance/modules/shared/selects/shifts.select.ts diff --git a/src/Time_And_Attendance/modules/shared/shared.module.ts b/src/time-and-attendance/modules/shared/shared.module.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/shared.module.ts rename to src/time-and-attendance/modules/shared/shared.module.ts diff --git a/src/Time_And_Attendance/modules/shared/types/upsert-actions.types.ts b/src/time-and-attendance/modules/shared/types/upsert-actions.types.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/types/upsert-actions.types.ts rename to src/time-and-attendance/modules/shared/types/upsert-actions.types.ts diff --git a/src/Time_And_Attendance/modules/shared/utils/resolve-bank-type-id.utils.ts b/src/time-and-attendance/modules/shared/utils/resolve-bank-type-id.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/utils/resolve-bank-type-id.utils.ts rename to src/time-and-attendance/modules/shared/utils/resolve-bank-type-id.utils.ts diff --git a/src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils.ts b/src/time-and-attendance/modules/shared/utils/resolve-email-id.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils.ts rename to src/time-and-attendance/modules/shared/utils/resolve-email-id.utils.ts diff --git a/src/Time_And_Attendance/modules/shared/utils/resolve-full-name.utils.ts b/src/time-and-attendance/modules/shared/utils/resolve-full-name.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/utils/resolve-full-name.utils.ts rename to src/time-and-attendance/modules/shared/utils/resolve-full-name.utils.ts diff --git a/src/Time_And_Attendance/modules/shared/utils/resolve-shifts-id.utils.ts b/src/time-and-attendance/modules/shared/utils/resolve-shifts-id.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/shared/utils/resolve-shifts-id.utils.ts rename to src/time-and-attendance/modules/shared/utils/resolve-shifts-id.utils.ts diff --git a/src/Time_And_Attendance/modules/shared/utils/resolve-timesheet.utils.ts b/src/time-and-attendance/modules/shared/utils/resolve-timesheet.utils.ts similarity index 94% rename from src/Time_And_Attendance/modules/shared/utils/resolve-timesheet.utils.ts rename to src/time-and-attendance/modules/shared/utils/resolve-timesheet.utils.ts index 2c5e515..11c89f2 100644 --- a/src/Time_And_Attendance/modules/shared/utils/resolve-timesheet.utils.ts +++ b/src/time-and-attendance/modules/shared/utils/resolve-timesheet.utils.ts @@ -1,6 +1,6 @@ import { Injectable, NotFoundException } from "@nestjs/common"; import { Prisma, PrismaClient } from "@prisma/client"; -import { weekStartSunday } from "src/Time_And_Attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers"; +import { weekStartSunday } from "src/time-and-attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers"; import { PrismaService } from "src/prisma/prisma.service"; import { EmailToIdResolver } from "./resolve-email-id.utils"; diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts similarity index 96% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts index 0efb934..79a8976 100644 --- a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts +++ b/src/time-and-attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller.ts @@ -1,7 +1,7 @@ import { BadRequestException, Body, Controller, Get, NotFoundException, Param, Post, Put, Query } from "@nestjs/common"; import { SchedulePresetsDto } from "../dtos/create-schedule-presets.dto"; import { SchedulePresetsCommandService } from "../services/schedule-presets-command.service"; -import { UpsertAction } from "src/Time_And_Attendance/modules/shared/types/upsert-actions.types"; +import { UpsertAction } from "src/time-and-attendance/modules/shared/types/upsert-actions.types"; import { SchedulePresetsQueryService } from "../services/schedule-presets-query.service"; @Controller('schedule-presets') diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-preset-shifts.dto.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-preset-shifts.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-preset-shifts.dto.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-preset-shifts.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-presets.dto.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-presets.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-presets.dto.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/dtos/create-schedule-presets.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/mappers/schedule-presets.mappers.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/mappers/schedule-presets.mappers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/mappers/schedule-presets.mappers.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/mappers/schedule-presets.mappers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts similarity index 91% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts index 2e25a6d..8194655 100644 --- a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts +++ b/src/time-and-attendance/modules/time-tracker/schedule-presets/schedule-presets.module.ts @@ -4,7 +4,7 @@ import { SchedulePresetsQueryService } from "./services/schedule-presets-query.s import { SchedulePresetsController } from "./controller/schedule-presets.controller"; import { PrismaService } from "src/prisma/prisma.service"; import { SchedulePresetsApplyService } from "./services/schedule-presets-apply.service"; -import { SharedModule } from "../shared/shared.module"; +import { SharedModule } from "src/time-and-attendance/modules/shared/shared.module"; @Module({ imports: [SharedModule], diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts similarity index 98% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts index e2e8dbf..98bde74 100644 --- a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts +++ b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-apply.service.ts @@ -1,5 +1,5 @@ import { BadRequestException, ConflictException, Injectable, NotFoundException } from "@nestjs/common"; -import { EmailToIdResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; import { PrismaService } from "src/prisma/prisma.service"; import { ApplyResult } from "../types/schedule-presets.types"; import { Prisma, Weekday } from "@prisma/client"; diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts similarity index 98% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts index 5c1cb2c..3803004 100644 --- a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts +++ b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service.ts @@ -1,7 +1,7 @@ import { BadRequestException, ConflictException, Injectable, NotFoundException } from "@nestjs/common"; -import { BankCodesResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-bank-type-id.utils"; -import { EmailToIdResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils"; -import { UpsertAction } from "src/Time_And_Attendance/modules/shared/types/upsert-actions.types"; +import { BankCodesResolver } from "src/time-and-attendance/modules/shared/utils/resolve-bank-type-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; +import { UpsertAction } from "src/time-and-attendance/modules/shared/types/upsert-actions.types"; import { PrismaService } from "src/prisma/prisma.service"; import { SchedulePresetsDto } from "../dtos/create-schedule-presets.dto"; import { Prisma, Weekday } from "@prisma/client"; diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts similarity index 96% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts index 7b87cef..e406151 100644 --- a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts +++ b/src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service.ts @@ -1,5 +1,5 @@ import { Injectable, NotFoundException } from "@nestjs/common"; -import { EmailToIdResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; import { PrismaService } from "src/prisma/prisma.service"; import { PresetResponse, ShiftResponse } from "../types/schedule-presets.types"; import { Prisma } from "@prisma/client"; diff --git a/src/Time_And_Attendance/modules/time-tracker/schedule-presets/types/schedule-presets.types.ts b/src/time-and-attendance/modules/time-tracker/schedule-presets/types/schedule-presets.types.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/schedule-presets/types/schedule-presets.types.ts rename to src/time-and-attendance/modules/time-tracker/schedule-presets/types/schedule-presets.types.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/controllers/shift.controller.ts b/src/time-and-attendance/modules/time-tracker/shifts/controllers/shift.controller.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/controllers/shift.controller.ts rename to src/time-and-attendance/modules/time-tracker/shifts/controllers/shift.controller.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/dtos/get-shift.dto.ts b/src/time-and-attendance/modules/time-tracker/shifts/dtos/get-shift.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/dtos/get-shift.dto.ts rename to src/time-and-attendance/modules/time-tracker/shifts/dtos/get-shift.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/dtos/shift.dto.ts b/src/time-and-attendance/modules/time-tracker/shifts/dtos/shift.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/dtos/shift.dto.ts rename to src/time-and-attendance/modules/time-tracker/shifts/dtos/shift.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/dtos/update-shift.dto.ts b/src/time-and-attendance/modules/time-tracker/shifts/dtos/update-shift.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/dtos/update-shift.dto.ts rename to src/time-and-attendance/modules/time-tracker/shifts/dtos/update-shift.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers.ts b/src/time-and-attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers.ts rename to src/time-and-attendance/modules/time-tracker/shifts/helpers/shifts-date-time-helpers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-archival.service.ts b/src/time-and-attendance/modules/time-tracker/shifts/services/shifts-archival.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-archival.service.ts rename to src/time-and-attendance/modules/time-tracker/shifts/services/shifts-archival.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-get.service.ts b/src/time-and-attendance/modules/time-tracker/shifts/services/shifts-get.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-get.service.ts rename to src/time-and-attendance/modules/time-tracker/shifts/services/shifts-get.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts b/src/time-and-attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts similarity index 99% rename from src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts rename to src/time-and-attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts index cc0e790..a7ec458 100644 --- a/src/Time_And_Attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts +++ b/src/time-and-attendance/modules/time-tracker/shifts/services/shifts-upsert.service.ts @@ -1,6 +1,6 @@ import { toDateFromString, toHHmmFromString, toStringFromDate, toStringFromHHmm } from "../helpers/shifts-date-time-helpers"; import { BadRequestException, ConflictException, Injectable, NotFoundException } from "@nestjs/common"; -import { OvertimeService, WeekOvertimeSummary } from "src/modules/business-logics/services/overtime.service"; +import { OvertimeService, WeekOvertimeSummary } from "src/time-and-attendance/domains/services/overtime.service"; import { updateShiftDto } from "../dtos/update-shift.dto"; import { PrismaService } from "src/prisma/prisma.service"; import { GetShiftDto } from "../dtos/get-shift.dto"; diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/shifts.module.ts b/src/time-and-attendance/modules/time-tracker/shifts/shifts.module.ts similarity index 89% rename from src/Time_And_Attendance/modules/time-tracker/shifts/shifts.module.ts rename to src/time-and-attendance/modules/time-tracker/shifts/shifts.module.ts index 5d33c35..00fe148 100644 --- a/src/Time_And_Attendance/modules/time-tracker/shifts/shifts.module.ts +++ b/src/time-and-attendance/modules/time-tracker/shifts/shifts.module.ts @@ -1,5 +1,5 @@ import { ShiftsArchivalService } from './services/shifts-archival.service'; -import { BusinessLogicsModule } from 'src/modules/business-logics/business-logics.module'; +import { BusinessLogicsModule } from 'src/time-and-attendance/domains/business-logics.module'; import { NotificationsModule } from '../../../../modules/notifications/notifications.module'; import { ShiftsUpsertService } from './services/shifts-upsert.service'; import { ShiftsGetService } from './services/shifts-get.service'; diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/get-shift-overview.dto.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/get-shift-overview.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/get-shift-overview.dto.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/get-shift-overview.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-command.service.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-command.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-command.service.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-command.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-overview-row.interface.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-overview-row.interface.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-overview-row.interface.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-overview-row.interface.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-query.service.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-query.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-query.service.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-query.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-upsert.types.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-upsert.types.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-upsert.types.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts-upsert.types.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.controller.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.controller.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.controller.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.controller.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.helpers.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.helpers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.helpers.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.helpers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.utils.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.utils.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/shifts.utils.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/upsert-shift.dto.ts b/src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/upsert-shift.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/shifts/~misc_deprecated-files/upsert-shift.dto.ts rename to src/time-and-attendance/modules/time-tracker/shifts/~misc_deprecated-files/upsert-shift.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts b/src/time-and-attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts similarity index 94% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts index 61eef3a..7eb7209 100644 --- a/src/Time_And_Attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts +++ b/src/time-and-attendance/modules/time-tracker/timesheets/controllers/timesheet.controller.ts @@ -1,4 +1,4 @@ -import { EmailToIdResolver } from "src/Time_And_Attendance/modules/shared/utils/resolve-email-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; import { GetTimesheetsOverviewService } from "../services/timesheet-get-overview.service"; import { BadRequestException, Controller, Get, Query} from "@nestjs/common"; diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/dtos/timesheet.dto.ts b/src/time-and-attendance/modules/time-tracker/timesheets/dtos/timesheet.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/dtos/timesheet.dto.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/dtos/timesheet.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/helpers/timesheets-date-time-helpers.ts b/src/time-and-attendance/modules/time-tracker/timesheets/helpers/timesheets-date-time-helpers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/helpers/timesheets-date-time-helpers.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/helpers/timesheets-date-time-helpers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-approval.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-approval.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-approval.service.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-approval.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-archive.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-archive.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-archive.service.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-archive.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/timesheets.module.ts b/src/time-and-attendance/modules/time-tracker/timesheets/timesheets.module.ts similarity index 70% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/timesheets.module.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/timesheets.module.ts index 001fb19..930c70f 100644 --- a/src/Time_And_Attendance/modules/time-tracker/timesheets/timesheets.module.ts +++ b/src/time-and-attendance/modules/time-tracker/timesheets/timesheets.module.ts @@ -1,17 +1,11 @@ import { GetTimesheetsOverviewService } from './services/timesheet-get-overview.service'; import { TimesheetArchiveService } from './services/timesheet-archive.service'; -import { BusinessLogicsModule } from 'src/modules/business-logics/business-logics.module'; import { TimesheetController } from './controllers/timesheet.controller'; import { SharedModule } from '../../shared/shared.module'; -import { ShiftsModule } from '../shifts/shifts.module'; import { Module } from '@nestjs/common'; @Module({ - imports: [ - BusinessLogicsModule, - SharedModule, - ShiftsModule, - ], + imports: [], controllers: [TimesheetController], providers: [ TimesheetArchiveService, diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/create-timesheet.dto.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/create-timesheet.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/create-timesheet.dto.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/create-timesheet.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/search-timesheet.dto.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/search-timesheet.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/search-timesheet.dto.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/search-timesheet.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet-period.dto.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet-period.dto.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet-period.dto.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet-period.dto.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.helpers.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.helpers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.helpers.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.helpers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.mappers.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.mappers.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.mappers.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.mappers.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.selectors.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.selectors.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.selectors.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.selectors.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.types.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.types.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.types.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.types.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.utils.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.utils.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.utils.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheet.utils.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-command.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-command.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-command.service.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-command.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-query.service.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-query.service.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-query.service.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets-query.service.ts diff --git a/src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets.controller.ts b/src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets.controller.ts similarity index 100% rename from src/Time_And_Attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets.controller.ts rename to src/time-and-attendance/modules/time-tracker/timesheets/~misc_deprecated-files/timesheets.controller.ts diff --git a/src/time-and-attendance/time-and-attendance.module.ts b/src/time-and-attendance/time-and-attendance.module.ts new file mode 100644 index 0000000..ebcbd05 --- /dev/null +++ b/src/time-and-attendance/time-and-attendance.module.ts @@ -0,0 +1,42 @@ +import { Module } from "@nestjs/common"; +import { ExpensesArchiveController } from "src/modules/archival/controllers/expenses-archive.controller"; +import { BusinessLogicsModule } from "src/time-and-attendance/domains/business-logics.module"; +import { ExpenseController } from "src/time-and-attendance/modules/expenses/controllers/expense.controller"; +import { ExpenseUpsertService } from "src/time-and-attendance/modules/expenses/services/expense-upsert.service"; +import { ExpensesArchivalService } from "src/time-and-attendance/modules/expenses/services/expenses-archival.service"; +import { PayperiodsModule } from "src/time-and-attendance/modules/pay-period/pay-periods.module"; +import { BankCodesResolver } from "src/time-and-attendance/modules/shared/utils/resolve-bank-type-id.utils"; +import { EmailToIdResolver } from "src/time-and-attendance/modules/shared/utils/resolve-email-id.utils"; +import { SchedulePresetsController } from "src/time-and-attendance/modules/time-tracker/schedule-presets/controller/schedule-presets.controller"; +import { SchedulePresetsCommandService } from "src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-command.service"; +import { SchedulePresetsQueryService } from "src/time-and-attendance/modules/time-tracker/schedule-presets/services/schedule-presets-query.service"; +import { ShiftController } from "src/time-and-attendance/modules/time-tracker/shifts/controllers/shift.controller"; +import { ShiftsGetService } from "src/time-and-attendance/modules/time-tracker/shifts/services/shifts-get.service"; +import { ShiftsUpsertService } from "src/time-and-attendance/modules/time-tracker/shifts/services/shifts-upsert.service"; +import { TimesheetController } from "src/time-and-attendance/modules/time-tracker/timesheets/controllers/timesheet.controller"; +import { GetTimesheetsOverviewService } from "src/time-and-attendance/modules/time-tracker/timesheets/services/timesheet-get-overview.service"; + +@Module({ + imports: [BusinessLogicsModule, PayperiodsModule], + controllers: [ + TimesheetController, + ShiftController, + SchedulePresetsController, + ExpenseController, + ExpensesArchiveController, + // LeaveRequestController, + + ], + providers: [ + GetTimesheetsOverviewService, + ShiftsGetService, + ShiftsUpsertService, + ExpenseUpsertService, + ExpensesArchivalService, + EmailToIdResolver, + SchedulePresetsCommandService, + BankCodesResolver, + SchedulePresetsQueryService, + ], + exports: [], +}) export class TimeAndAttendanceModule{}; \ No newline at end of file