clean(banking): removed debug comments

This commit is contained in:
Matthieu Haineault 2026-01-14 10:38:49 -05:00
parent 8a2e67cbc8
commit e259851b87
2 changed files with 3 additions and 10 deletions

View File

@ -97,19 +97,16 @@ export class PaidTimeOFfBankHoursService {
if (ajusted_hours < 0) ajusted_hours = 0;
const config = paid_time_off_mapping[type];
console.log('even got in here!')
const last_updated = new Date();
console.log('config operation: ', config.operation, ' . config field: ', config.field, ' . Last updated: ', last_updated)
//the problem comes from this prisma query
const update = await this.prisma.paidTimeOff.update({
await this.prisma.paidTimeOff.update({
where: { employee_id },
data: {
[config.field]: { [config.operation]: ajusted_hours },
last_updated: last_updated,
},
});
console.log('update infos: ', update);
}
}

View File

@ -18,7 +18,6 @@ export class ShiftsDeleteService {
//blocs deletion if approved
async deleteShift(shift_id: number): Promise<Result<number, string>> {
try {
console.log('shift id: ', shift_id)
return await this.prisma.$transaction(async (tx) => {
const shift = await tx.shifts.findUnique({
where: { id: shift_id },
@ -35,17 +34,14 @@ export class ShiftsDeleteService {
if (!shift) return { success: false, error: `SHIFT_NOT_FOUND` };
if (shift.is_approved) return { success: false, error: 'APPROUVED_SHIFT' };
console.log('got here')
//call to ajust paid_time_off hour banks
//this needs troubleshooting. returns try catch error message
//call to ajust paid_time_off hour banks
await this.paidTimeOffService.updatePaidTimeoffBankHoursWhenShiftDelete(
shift.start_time,
shift.end_time,
shift.bank_code.type,
shift.timesheet.employee_id
);
console.log('also got here')
await tx.shifts.delete({ where: { id: shift_id } });
return { success: true, data: shift.id };
});