feat: add collaboratorUserId to appointment model and update dashboard filtering logic
This commit is contained in:
@@ -245,6 +245,7 @@ export interface AppointmentEventByClient {
|
||||
serviceName: string;
|
||||
serviceDescription: string;
|
||||
collaboratorId: string;
|
||||
collaboratorUserId: string;
|
||||
collaboratorName: string;
|
||||
collaboratorAvatar: string;
|
||||
appointmentDate: string;
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -152,6 +152,7 @@ export interface AppointmentEventByClient {
|
||||
serviceName: string;
|
||||
serviceDescription: string;
|
||||
collaboratorId: string;
|
||||
collaboratorUserId: string;
|
||||
collaboratorName: string;
|
||||
collaboratorAvatar: string;
|
||||
appointmentDate: string;
|
||||
|
||||
@@ -343,7 +343,7 @@ function DashboardContent() {
|
||||
);
|
||||
const showNoOrganizationStarterContent = Boolean(displayedPlan && organizations.length === 0);
|
||||
const agendaItems = dashboardData?.personalAgenda ?? [];
|
||||
const filteredAgendaItems = agendaItems.filter(item => !showOnlyMine || item.collaboratorId === SessionInfo.userId);
|
||||
const filteredAgendaItems = agendaItems.filter(item => !showOnlyMine || item.collaboratorUserId === SessionInfo.userId);
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={turnosXpressTheme}>
|
||||
@@ -601,7 +601,7 @@ function DashboardContent() {
|
||||
<h3 style={{ margin: 0 }}>
|
||||
{showOnlyMine ? "Mi Agenda de Hoy" : "Agenda General de Hoy"}
|
||||
</h3>
|
||||
<span className={style.agendaCounter}>{agendaItems.length}</span>
|
||||
<span className={style.agendaCounter}>{filteredAgendaItems.length}</span>
|
||||
</div>
|
||||
<span className={style.agendaToggleIcon}>{isAgendaCollapsed ? "+" : "−"}</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user