From 3b01aa37482bdb5fd8ddf4f22cea0106f92a51fa Mon Sep 17 00:00:00 2001 From: "Nic D." <91558719+Venti-Bear@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:00:20 -0500 Subject: [PATCH] fix(create-employee): date was passed directly as string, fixed to pass date object. --- .../employees/services/employees-create.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/identity-and-account/employees/services/employees-create.service.ts b/src/identity-and-account/employees/services/employees-create.service.ts index 31a3560..e02691c 100644 --- a/src/identity-and-account/employees/services/employees-create.service.ts +++ b/src/identity-and-account/employees/services/employees-create.service.ts @@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common"; import { Users } from "@prisma/client"; import { Result } from "src/common/errors/result-error.factory"; import { toBooleanFromString } from "src/common/mappers/module-access.mapper"; +import { toDateFromString } from "src/common/utils/date-utils"; import { EmployeeDetailedDto } from "src/identity-and-account/employees/employee-detailed.dto"; import { toCompanyCodeFromString } from "src/identity-and-account/employees/employee.utils"; import { PrismaService } from "src/prisma/prisma.service"; @@ -13,7 +14,8 @@ export class EmployeesCreateService { async createEmployee(dto: EmployeeDetailedDto): Promise> { const normalized_access = toBooleanFromString(dto.user_module_access); const supervisor_id = await this.toIdFromFullName(dto.supervisor_full_name); - const company_code = toCompanyCodeFromString(dto.company_name) + const company_code = toCompanyCodeFromString(dto.company_name); + const first_work_day = toDateFromString(dto.first_work_day); await this.prisma.$transaction(async (tx) => { const user: Users = await tx.users.create({ @@ -41,7 +43,7 @@ export class EmployeesCreateService { external_payroll_id: dto.external_payroll_id, company_code: company_code, job_title: dto.job_title, - first_work_day: dto.first_work_day, + first_work_day: first_work_day, is_supervisor: dto.is_supervisor, supervisor_id: supervisor_id, schedule_preset_id: dto.preset_id,