feat(metrics): per-staff performance view in dashboard

GET /v1/metrics/staff returns bookings, completed, cancelled,
utilization, and revenue per staff member over a trailing window
(default 30d, max 365d). Appointment bookings only — class sessions
have no staff assignment. All active staff appear, including
zero-booking rows.

Staff page gains a localized Performance panel; demo mode seeds
trailing-window bookings and matching metric rows.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-18 16:34:45 +02:00
1 parent 4674203502
commit 76e45d4178
11 files changed
+496 -3

No files matched your search

+18
View File
@@ -556,6 +556,24 @@ type ActivityFeedResponse struct {
Events []ActivityEvent `json:"events"`
}
// StaffMetric aggregates appointment workload for one staff member over a
// trailing window. Class bookings carry no staff assignment and are excluded.
type StaffMetric struct {
StaffID string `json:"staffId"`
DisplayName string `json:"displayName"`
Bookings int `json:"bookings"`
Completed int `json:"completed"`
Cancelled int `json:"cancelled"`
UtilizationPercent int `json:"utilizationPercent"`
RevenueCents int64 `json:"revenueCents"`
}
type StaffMetricsResponse struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
Staff []StaffMetric `json:"staff"`
}
// ============================================
// ADMIN MODELS
// ============================================