view data fixes

This commit is contained in:
2026-01-23 15:30:23 +01:00
parent e22033be38
commit f8099f04bc
213 changed files with 3466 additions and 3003 deletions

View File

@@ -9,19 +9,18 @@ import { AnalyticsDashboardInputViewData } from "../view-data/AnalyticsDashboard
import { ViewModel } from "../contracts/view-models/ViewModel";
export class AnalyticsDashboardViewModel extends ViewModel {
readonly totalUsers: number;
readonly activeUsers: number;
readonly totalRaces: number;
readonly totalLeagues: number;
private readonly data: AnalyticsDashboardInputViewData;
constructor(viewData: AnalyticsDashboardInputViewData) {
constructor(data: AnalyticsDashboardInputViewData) {
super();
this.totalUsers = viewData.totalUsers;
this.activeUsers = viewData.activeUsers;
this.totalRaces = viewData.totalRaces;
this.totalLeagues = viewData.totalLeagues;
this.data = data;
}
get totalUsers(): number { return this.data.totalUsers; }
get activeUsers(): number { return this.data.activeUsers; }
get totalRaces(): number { return this.data.totalRaces; }
get totalLeagues(): number { return this.data.totalLeagues; }
/** UI-specific: User engagement rate */
get userEngagementRate(): number {
return this.totalUsers > 0 ? (this.activeUsers / this.totalUsers) * 100 : 0;