feat: org-scoped appointments backend, wire appointments page

Add the appointments table, validation, service and CRUD routes
(/api/appointments, RBAC-gated) and the matching frontend data module.
The appointments page now loads and persists real data; KPIs are computed
from it and the schedule/calendar anchor to the real current date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-07 19:33:37 +03:00
parent 128ce36df2
commit dec04ec506
14 changed files with 2004 additions and 142 deletions
+22
View File
@@ -0,0 +1,22 @@
// The canonical Appointment shape returned by the API. Mirrors the frontend
// `lib/appointments.ts` Appointment type. Patient fields are denormalized for
// display; `fileNumber` links back to a patient record when set.
export type AppointmentStatus =
| "confirmed"
| "checked-in"
| "completed"
| "cancelled";
export type Appointment = {
id: string;
fileNumber: string;
name: string;
initials: string;
date: string; // ISO YYYY-MM-DD
time: string; // HH:mm
type: string;
provider: string;
status: AppointmentStatus;
createdAt: string;
updatedAt: string;
};