fix(business-logics): small ajustments

This commit is contained in:
Matthieu Haineault 2026-01-07 15:46:29 -05:00
parent 4646b2f445
commit bae8a037f7
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export class HolidayService {
const window_start = new Date(holiday_week_start.getTime() - 4 * MS_PER_WEEK);
const window_end = new Date(holiday_week_start.getTime() - 1);
const valid_codes = ['G1', 'G43', 'G56', 'G104', 'G105', 'G700'];
const valid_codes = ['G1', 'G43', 'G56', 'G104', 'G105', 'G305', 'G700'];
const shifts = await this.prisma.shifts.findMany({
where: {
timesheet: { employee_id: employee_id },
@ -67,7 +67,7 @@ export class HolidayService {
async calculateHolidayPay(email: string, holiday_date: Date, modifier: number): Promise<Result<number, string>> {
const average_daily_hours = await this.computeHoursPrevious4WeeksByEmail(email, holiday_date);
if (!average_daily_hours.success) return { success: false, error: average_daily_hours.error };
const daily_rate = (Math.min(average_daily_hours.data, 8)) * modifier;
return { success: true, data: daily_rate };
}

View File

@ -27,7 +27,7 @@ type WeekOvertimeSummary = {
@Injectable()
export class OvertimeService {
private INCLUDED_TYPES = ['EMERGENCY', 'EVENING', 'OVERTIME', 'REGULAR'] as const; // included types for weekly overtime calculation
private INCLUDED_TYPES = ['EMERGENCY', 'EVENING', 'OVERTIME', 'REGULAR', 'HOLIDAY'] as const; // included types for weekly overtime calculation
constructor(private prisma: PrismaService) { }