feat(dashboard): doctor/clinic dashboard matching Figma layout
Restructure to Figma: 4 stat cards (today appts, today/week payments, total patients) -> two charts (revenue area + patient-count vertical bars) -> today appointments table. Add today/week payments, total patients, and 7-day revenue/appointments series to doctor + clinic dashboard endpoints. Add SvgVBars chart. Update dashboard.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+23
-2
@@ -36,7 +36,18 @@ Returns stats and today's schedule for the authenticated clinic owner.
|
||||
"pending_invitations": 2,
|
||||
"sms_wallet_balance": 50000,
|
||||
"unique_patients_count": 34,
|
||||
"revenue_period_rials": 12500000
|
||||
"total_patients": 210,
|
||||
"revenue_period_rials": 12500000,
|
||||
"today_payments_rials": 5225000,
|
||||
"week_payments_rials": 560000200
|
||||
},
|
||||
"charts": {
|
||||
"revenue_by_day": [
|
||||
{ "label": "۷ خرداد", "amount_rials": 3200000 }
|
||||
],
|
||||
"appointments_by_day": [
|
||||
{ "label": "۷ خرداد", "count": 9 }
|
||||
]
|
||||
},
|
||||
"period": { "from": 1717200000, "to": 1719792000 },
|
||||
"today_appointments": [
|
||||
@@ -62,7 +73,10 @@ Returns stats and today's schedule for the authenticated clinic owner.
|
||||
**Field notes:**
|
||||
- `sms_wallet_balance` — current SMS wallet balance in Rials (0 if wallet not yet created)
|
||||
- `unique_patients_count` — distinct patients with at least one session in the `from`–`to` period
|
||||
- `total_patients` — distinct patients ever (no period filter)
|
||||
- `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`
|
||||
- `doctors` — all doctors belonging to this clinic; each includes their appointment count for today
|
||||
|
||||
@@ -106,7 +120,14 @@ Returns stats and today's schedule for the authenticated doctor.
|
||||
"total_ratings": 34,
|
||||
"sms_wallet_balance": 25000,
|
||||
"unique_patients_count": 18,
|
||||
"revenue_period_rials": 6800000
|
||||
"total_patients": 140,
|
||||
"revenue_period_rials": 6800000,
|
||||
"today_payments_rials": 5225000,
|
||||
"week_payments_rials": 42000000
|
||||
},
|
||||
"charts": {
|
||||
"revenue_by_day": [ { "label": "۷ خرداد", "amount_rials": 3200000 } ],
|
||||
"appointments_by_day": [ { "label": "۷ خرداد", "count": 4 } ]
|
||||
},
|
||||
"period": { "from": 1717200000, "to": 1719792000 },
|
||||
"today_appointments": [
|
||||
|
||||
Reference in New Issue
Block a user