feature: users with treatment edit permission should now have working hours defined. the appointment grid is now being drawn based on the doctor's working hours.

This commit is contained in:
2026-06-10 19:44:09 +03:30
parent 468572a50f
commit 48ecfd05e1
22 changed files with 1571 additions and 116 deletions

View File

@@ -1,5 +1,6 @@
import { apiClient } from './client';
import type { AppointmentColumnProvider, AppointmentRecord } from '@/types/appointment';
import { toDateInputValue } from '@/components/appointments/appointmentTime';
export interface CreateAppointmentBody {
patientId: string;
@@ -12,8 +13,11 @@ export interface CreateAppointmentBody {
export type UpdateAppointmentBody = Partial<CreateAppointmentBody>;
export const appointmentsApi = {
columnProviders: async (): Promise<{ success: boolean; data: AppointmentColumnProvider[] }> => {
const response = await apiClient.get('/appointments/column-providers');
columnProviders: async (
scheduleDate?: Date,
): Promise<{ success: boolean; data: AppointmentColumnProvider[] }> => {
const params = scheduleDate ? { date: toDateInputValue(scheduleDate) } : undefined;
const response = await apiClient.get('/appointments/column-providers', { params });
return response.data;
},