feat: add collaboratorUserId to appointment model and update dashboard filtering logic

This commit is contained in:
2026-07-21 10:34:52 -03:00
parent a9afb13d15
commit 40090cdec5
4 changed files with 10 additions and 2 deletions
@@ -1313,6 +1313,7 @@ class AppointmentManager implements IAppointmentsManager {
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: employee.id,
collaboratorUserId: String(employee.userId),
collaboratorName: collaboratorFullName,
collaboratorAvatar: collaboratorAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),
@@ -1422,6 +1423,7 @@ class AppointmentManager implements IAppointmentsManager {
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: employee.id,
collaboratorUserId: String(employee.userId),
collaboratorName: employeeFullName,
collaboratorAvatar: employeeAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),
@@ -1531,6 +1533,7 @@ class AppointmentManager implements IAppointmentsManager {
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: employee.id,
collaboratorUserId: String(employee.userId),
collaboratorName: employeeFullName,
collaboratorAvatar: employeeAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),
@@ -1649,6 +1652,7 @@ class AppointmentManager implements IAppointmentsManager {
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: String(employee.id || (employee as any)._id),
collaboratorUserId: String(employee.userId),
collaboratorName: employeeFullName,
collaboratorAvatar: employeeAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),
@@ -1766,6 +1770,7 @@ class AppointmentManager implements IAppointmentsManager {
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: employee.id,
collaboratorUserId: String(employee.userId),
collaboratorName: employeeFullName,
collaboratorAvatar: employeeAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),
@@ -1893,6 +1898,7 @@ public async findAppointmentsByCollaboratorPaginated(
serviceName: service.name,
serviceDescription: service.description,
collaboratorId: String(employee.id || (employee as any)._id),
collaboratorUserId: String(employee.userId),
collaboratorName: employeeFullName,
collaboratorAvatar: employeeAvatar,
appointmentDate: dayjs(appointment.start).toISOString(),