fix(employees): added phone, adress and 1st work day to findOwnProfil function

This commit is contained in:
Matthieu Haineault 2025-12-01 11:39:27 -05:00
parent 50ecd12aa8
commit c155df14da

View File

@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common";
import { Users } from "@prisma/client";
import { Result } from "src/common/errors/result-error.factory";
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
import { toStringFromDate } from "src/common/utils/date-utils";
import { EmployeeDetailedDto } from "src/identity-and-account/employees/dtos/employee-detailed.dto";
import { EmployeeDto } from "src/identity-and-account/employees/dtos/employee.dto";
import { PrismaService } from "src/prisma/prisma.service";
@ -67,8 +68,11 @@ export class EmployeesService {
first_name: true,
last_name: true,
email: true,
phone_number: true,
residence: true,
},
},
first_work_day: true,
company_code: true,
job_title: true,
external_payroll_id: true,
@ -76,7 +80,8 @@ export class EmployeesService {
select: {
id: true, user: {
select: {
first_name: true, last_name: true
first_name: true,
last_name: true,
},
},
},
@ -99,6 +104,9 @@ export class EmployeesService {
company_name: company_name,
job_title: existing_profile.job_title ?? '',
external_payroll_id: existing_profile.external_payroll_id,
phone_number: existing_profile.user.phone_number,
residence: existing_profile.user.phone_number,
first_work_day: toStringFromDate(existing_profile.first_work_day),
}
}
}