mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-28 15:51:15 +00:00
feat(dashboard): real business metrics with week-over-week trends
Dashboard KPIs were three flat counters with no trend data — the cards rendered a neutral dash where the design intends movement indicators. Summary now queries three trailing windows and emits four KPIs with real deltas: bookings this week, completed (new CompletedCount metric in both repositories), cancellations, and utilization in percentage points. KPI labels localize in the frontend via a code-to-key map so Czech operators no longer see English labels on live data. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
668a54ae1d
commit
0dc26e0c16
10 files changed
+141
-8
No files matched your search
@@ -295,6 +295,9 @@ const dictionaries = {
|
||||
"dashboard.kpi.bookings": "Celkem rezervací",
|
||||
"dashboard.kpi.cancelled": "Zrušených",
|
||||
"dashboard.kpi.completed": "Dokončených",
|
||||
"dashboard.kpi.bookingsThisWeek": "Rezervace tento týden",
|
||||
"dashboard.kpi.cancellations": "Zrušení",
|
||||
"dashboard.kpi.utilization": "Vytížení",
|
||||
"dashboard.kpi.newClients": "Noví klienti",
|
||||
"dashboard.recentActivity": "Nedávná aktivita",
|
||||
"dashboard.upcomingBookings": "Nadcházející rezervace",
|
||||
@@ -867,6 +870,9 @@ const dictionaries = {
|
||||
"dashboard.kpi.bookings": "Total Bookings",
|
||||
"dashboard.kpi.cancelled": "Cancelled",
|
||||
"dashboard.kpi.completed": "Completed",
|
||||
"dashboard.kpi.bookingsThisWeek": "Bookings this week",
|
||||
"dashboard.kpi.cancellations": "Cancellations",
|
||||
"dashboard.kpi.utilization": "Utilization",
|
||||
"dashboard.kpi.newClients": "New Clients",
|
||||
"dashboard.recentActivity": "Recent Activity",
|
||||
"dashboard.upcomingBookings": "Upcoming Bookings",
|
||||
|
||||
@@ -211,8 +211,17 @@ export function DashboardDataProvider(props: { children: any }) {
|
||||
};
|
||||
};
|
||||
|
||||
const kpiLabelKeys: Record<string, string> = {
|
||||
bookings_this_week: "dashboard.kpi.bookingsThisWeek",
|
||||
completed: "dashboard.kpi.completed",
|
||||
cancellations: "dashboard.kpi.cancellations",
|
||||
utilization: "dashboard.kpi.utilization",
|
||||
};
|
||||
const normalizedKpis = createMemo(() => (resolvedSummary()?.kpis ?? []).map((kpi: any) => ({
|
||||
...kpi, trend: kpi.trend ?? "neutral", change: kpi.change ?? "—",
|
||||
...kpi,
|
||||
label: kpi.code && kpiLabelKeys[kpi.code] ? i18n.t(kpiLabelKeys[kpi.code]) : kpi.label,
|
||||
trend: kpi.trend ?? "neutral",
|
||||
change: kpi.change ?? "—",
|
||||
})));
|
||||
|
||||
const normalizedUpcomingBookings = createMemo(() => (resolvedSummary()?.upcomingBookings ?? []).map((booking: any) => ({
|
||||
|
||||
Reference in new issue
Block a user