refactor(employee): switched phone_number type from number to string

This commit is contained in:
Matthieu Haineault 2025-08-26 12:50:11 -04:00
parent 72f6cc8a9e
commit 7b86b8c662
6 changed files with 9 additions and 8 deletions

View File

@ -19,7 +19,7 @@ model Users {
first_name String
last_name String
email String @unique
phone_number Int @unique
phone_number String @unique
residence String?
role Roles @default(GUEST)

View File

@ -62,10 +62,9 @@ export class CreateEmployeeDto {
example: '82538437464',
description: 'Employee`s phone number',
})
@Type(() => Number)
@IsInt()
@IsString()
@IsPositive()
phone_number: number;
phone_number: string;
@ApiProperty({
example: '1 Bagshot Row, Hobbiton, The Shire, Middle-earth',

View File

@ -6,7 +6,7 @@ export class EmployeeProfileItemDto {
company_name: number | null;
job_title: string | null;
email: string | null;
phone_number: number;
phone_number: string;
first_work_day: string;
last_work_day?: string | null;
residence: string | null;

View File

@ -18,5 +18,5 @@ export class UpdateEmployeeDto extends PartialType(CreateEmployeeDto) {
supervisor_id?: number;
@Max(2147483647)
phone_number: number;
phone_number: string;
}

View File

@ -113,12 +113,13 @@ export class PayPeriodsQueryService {
payday : period.payday,
pay_year : period.pay_year,
label : period.label,
//add is_approved
}, { filtered_employee_ids: crew_ids, seed_names });
}
private async buildOverview(
period: { period_start: string | Date; period_end: string | Date; payday: string | Date;
period_no: number; pay_year: number; label: string; },
period_no: number; pay_year: number; label: string; }, //add is_approved
options?: { filtered_employee_ids?: number[]; seed_names?: Map<number, {name: string, email: string}>}
): Promise<PayPeriodOverviewDto> {
const toDateString = (d: Date) => d.toISOString().slice(0, 10);
@ -287,6 +288,7 @@ export class PayPeriodsQueryService {
period_start: period.period_start,
period_end: period.period_end,
label: period.label,
//add is_approved
}));
}

View File

@ -30,7 +30,7 @@ export class UserDto {
example: 5141234567,
description: 'Unique phone number',
})
phone_number: number;
phone_number: string;
@ApiProperty({
example: 'Minas Tirith, Gondor',