diff --git a/src/time-and-attendance/domains/services/holiday.service.ts b/src/time-and-attendance/domains/services/holiday.service.ts index d800510..925a38e 100644 --- a/src/time-and-attendance/domains/services/holiday.service.ts +++ b/src/time-and-attendance/domains/services/holiday.service.ts @@ -30,23 +30,16 @@ export class HolidayService { holiday_date: Date ): Promise> { try { - const valid_codes = ['G1', 'G43', 'G140', 'G104', 'G105', 'G305', 'G700', 'G720']; + const valid_codes = ['G1', 'G43', 'G48', 'G104', 'G105', 'G109', 'G140', 'G720']; const holiday_week_start = getWeekStart(holiday_date); const window_start = new Date(holiday_week_start.getTime() - 4 * MS_PER_WEEK); const window_end = new Date(holiday_week_start.getTime() - 1); const employee = await this.prisma.employees.findFirst({ - where: { - external_payroll_id, - company_code, - }, - select: { - id: true, - } + where: { external_payroll_id, company_code } }); - if (!employee) - return { success: false, error: 'EMPLOYEE_NOT_FOUND' }; + if (!employee) return { success: false, error: 'EMPLOYEE_NOT_FOUND' }; const shifts = await this.prisma.shifts.findMany({ where: { @@ -61,8 +54,7 @@ export class HolidayService { for (const shift of shifts) { const hours = computeHours(shift.start_time, shift.end_time); - if (hours <= 0) - continue; + if (hours <= 0) continue; const shift_week_start = getWeekStart(shift.date); const key = shift_week_start.getTime();