feat: port clinic dashboard components from clinic-pro-tauri
- Add NewAppointmentsTable for displaying today's appointments with status chips and formatted time. - Implement TauriCharts for bar and line charts representing patient counts and revenue. - Create TauriDashboardView to combine stat cards, charts, and new appointments list. - Introduce TauriStatCards for displaying key statistics with icons. - Add dashboardIcons for SVG icons used in stat cards. - Implement tests for DashboardPage to ensure correct rendering and API calls. - Create DashboardTodayAppointmentsTest to validate extended fields in today's appointments API response.
This commit is contained in:
@@ -54,8 +54,11 @@ Returns stats and today's schedule for the authenticated clinic owner.
|
||||
{
|
||||
"uuid": "string",
|
||||
"patient_name": "string | null",
|
||||
"patient_mobile": "string | null",
|
||||
"doctor_name": "string",
|
||||
"service_name": "string | null",
|
||||
"slot_start": 1700000000,
|
||||
"slot_end": 1700001800,
|
||||
"status": "reserved"
|
||||
}
|
||||
],
|
||||
@@ -77,7 +80,7 @@ Returns stats and today's schedule for the authenticated clinic owner.
|
||||
- `revenue_period_rials` — sum of `final_price_rials` from all patient sessions in the period
|
||||
- `today_payments_rials` / `week_payments_rials` — revenue for today / the last 7 days
|
||||
- `charts.revenue_by_day` / `charts.appointments_by_day` — last 7 days series (Jalali day label); revenue drives the «میزان درآمد» area chart, appointments the «نمودار تعداد مراجعین» bar chart
|
||||
- `today_appointments` — up to 5 records, ordered by `slot_start ASC`
|
||||
- `today_appointments` — up to 5 records, ordered by `slot_start ASC`; each row carries `patient_mobile`, `doctor_name` (personnel), `service_name` (nullable — booked service item), and `slot_end` for the «لیست نوبتهای جدید» dashboard table
|
||||
- `doctors` — all doctors belonging to this clinic; each includes their appointment count for today
|
||||
|
||||
### Errors
|
||||
@@ -135,7 +138,10 @@ Returns stats and today's schedule for the authenticated doctor.
|
||||
"uuid": "string",
|
||||
"patient_name": "string | null",
|
||||
"patient_mobile": "string",
|
||||
"doctor_name": "string",
|
||||
"service_name": "string | null",
|
||||
"slot_start": 1700000000,
|
||||
"slot_end": 1700001800,
|
||||
"status": "reserved"
|
||||
}
|
||||
],
|
||||
@@ -151,7 +157,7 @@ Returns stats and today's schedule for the authenticated doctor.
|
||||
```
|
||||
|
||||
**Field notes:**
|
||||
- `today_appointments` — up to 10 records, ordered by `slot_start ASC`
|
||||
- `today_appointments` — up to 10 records, ordered by `slot_start ASC`; each row carries `patient_mobile`, `doctor_name`, `service_name` (nullable), and `slot_end` for the dashboard appointments table
|
||||
- `avg_rating` — rounded to 1 decimal; `null` if no ratings yet
|
||||
- `clinics` — all clinics the doctor belongs to
|
||||
- `sms_wallet_balance`, `unique_patients_count`, `revenue_period_rials` — same semantics as clinic dashboard
|
||||
|
||||
Reference in New Issue
Block a user