diff --git a/src/time-and-attendance/paid-time-off/paid-time-off.service.ts b/src/time-and-attendance/paid-time-off/paid-time-off.service.ts index f239aa4..2e05fd0 100644 --- a/src/time-and-attendance/paid-time-off/paid-time-off.service.ts +++ b/src/time-and-attendance/paid-time-off/paid-time-off.service.ts @@ -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); } } diff --git a/src/time-and-attendance/shifts/services/shifts-delete.service.ts b/src/time-and-attendance/shifts/services/shifts-delete.service.ts index 9d96516..a0c161b 100644 --- a/src/time-and-attendance/shifts/services/shifts-delete.service.ts +++ b/src/time-and-attendance/shifts/services/shifts-delete.service.ts @@ -18,7 +18,6 @@ export class ShiftsDeleteService { //blocs deletion if approved async deleteShift(shift_id: number): Promise> { 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 }; });