From 63cc2a4458dba91d047ef01fba01512653665452 Mon Sep 17 00:00:00 2001 From: Nic D Date: Thu, 15 Jan 2026 10:17:45 -0500 Subject: [PATCH] fix(chatbot): changed session id to be unique with user email instead of using testing for everything --- src/chatbot/chatbot.service.ts | 3 +-- src/time-and-attendance/domains/services/sick-leave.service.ts | 2 +- .../services/schedule-presets-delete.service.ts | 3 --- .../timesheets/services/timesheet-employee-overview.service.ts | 1 - src/time-and-attendance/timesheets/timesheet.mapper.ts | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/chatbot/chatbot.service.ts b/src/chatbot/chatbot.service.ts index a908a2f..ed95920 100644 --- a/src/chatbot/chatbot.service.ts +++ b/src/chatbot/chatbot.service.ts @@ -11,9 +11,8 @@ export class ChatbotService { sessionId: string = 'testing'; async pingExternalApi(body: UserMessageDto, email: string): Promise { - const { data } = await firstValueFrom(this.httpService.post('https://n8nai.targo.ca/webhook/chatty-Mcbot', { userInput: body.userInput, userId: email, sessionId: this.sessionId })); + const { data } = await firstValueFrom(this.httpService.post('https://n8nai.targo.ca/webhook/chatty-Mcbot', { userInput: body.userInput, userId: email, sessionId: email })); - console.log(data); return { text: data[0].output, sent: false, diff --git a/src/time-and-attendance/domains/services/sick-leave.service.ts b/src/time-and-attendance/domains/services/sick-leave.service.ts index ee41700..b7f17ea 100644 --- a/src/time-and-attendance/domains/services/sick-leave.service.ts +++ b/src/time-and-attendance/domains/services/sick-leave.service.ts @@ -113,7 +113,7 @@ export class SickLeaveService { takeSickLeaveHours = async (employee_id: number, asked_hours: number): Promise> => { if (asked_hours <= 0) return { success: false, error: 'INVALID_BANKING_HOURS' }; - console.log('also got here') + try { const result = await this.prisma.$transaction(async (tx) => { const employee = await this.prisma.employees.findUnique({ diff --git a/src/time-and-attendance/schedule-presets/services/schedule-presets-delete.service.ts b/src/time-and-attendance/schedule-presets/services/schedule-presets-delete.service.ts index 62730c1..20b650a 100644 --- a/src/time-and-attendance/schedule-presets/services/schedule-presets-delete.service.ts +++ b/src/time-and-attendance/schedule-presets/services/schedule-presets-delete.service.ts @@ -10,14 +10,12 @@ export class SchedulePresetDeleteService { // DELETE //_________________________________________________________________ async deletePreset(preset_id: number): Promise> { - console.log('preset_id received: ', preset_id) const preset = await this.prisma.schedulePresets.findUnique({ where: { id: preset_id }, select: { id: true }, }); if (!preset) return { success: false, error: `SCHEDULE_PRESET_NOT_FOUND` }; - console.log('preset found: ', preset.id) const updated_employees = await this.prisma.employees.updateMany({ where: { schedule_preset_id: preset_id }, @@ -25,7 +23,6 @@ export class SchedulePresetDeleteService { schedule_preset_id: 0, }, }); - console.log('employee schedule id updated', updated_employees); await this.prisma.$transaction(async (tx) => { await tx.schedulePresetShifts.deleteMany({ where: { preset_id: preset_id } }); diff --git a/src/time-and-attendance/timesheets/services/timesheet-employee-overview.service.ts b/src/time-and-attendance/timesheets/services/timesheet-employee-overview.service.ts index 8ce539d..17dd885 100644 --- a/src/time-and-attendance/timesheets/services/timesheet-employee-overview.service.ts +++ b/src/time-and-attendance/timesheets/services/timesheet-employee-overview.service.ts @@ -33,7 +33,6 @@ export class GetTimesheetsOverviewService { //loads the timesheets related to the fetched pay-period let rows = await this.loadTimesheets(employee_id.data, period.period_start, period.period_end); - console.log(rows); //Normalized dates from pay-period strings const normalized_start = toDateFromString(period.period_start); diff --git a/src/time-and-attendance/timesheets/timesheet.mapper.ts b/src/time-and-attendance/timesheets/timesheet.mapper.ts index 52940c5..217aa57 100644 --- a/src/time-and-attendance/timesheets/timesheet.mapper.ts +++ b/src/time-and-attendance/timesheets/timesheet.mapper.ts @@ -92,7 +92,6 @@ export const mapOneTimesheet = async (timesheet: Prisma.TimesheetsGetPayload<{ daily_hours[subgroup] += hours; weekly_hours[subgroup] += hours; } - console.log('date: ', shift.date, ', hours worked: ', hours, ', type: ', subgroup, ', current weekly overtime: ', weekly_hours['overtime']); }