view data fixes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface AnalyticsDashboardInputViewData extends ViewData {
|
||||
totalUsers: number;
|
||||
activeUsers: number;
|
||||
totalRaces: number;
|
||||
totalLeagues: number;
|
||||
}
|
||||
8
apps/website/lib/view-data/AnalyticsMetricsViewData.ts
Normal file
8
apps/website/lib/view-data/AnalyticsMetricsViewData.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface AnalyticsMetricsViewData extends ViewData {
|
||||
pageViews: number;
|
||||
uniqueVisitors: number;
|
||||
averageSessionDuration: number;
|
||||
bounceRate: number;
|
||||
}
|
||||
47
apps/website/lib/view-data/BillingViewData.ts
Normal file
47
apps/website/lib/view-data/BillingViewData.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface BillingViewData extends ViewData {
|
||||
paymentMethods: Array<{
|
||||
id: string;
|
||||
type: 'card' | 'bank' | 'sepa';
|
||||
last4: string;
|
||||
brand?: string;
|
||||
isDefault: boolean;
|
||||
expiryMonth?: number;
|
||||
expiryYear?: number;
|
||||
bankName?: string;
|
||||
displayLabel: string;
|
||||
expiryDisplay: string | null;
|
||||
}>;
|
||||
invoices: Array<{
|
||||
id: string;
|
||||
invoiceNumber: string;
|
||||
date: string;
|
||||
dueDate: string;
|
||||
amount: number;
|
||||
vatAmount: number;
|
||||
totalAmount: number;
|
||||
status: 'paid' | 'pending' | 'overdue' | 'failed';
|
||||
description: string;
|
||||
sponsorshipType: 'league' | 'team' | 'driver' | 'race' | 'platform';
|
||||
pdfUrl: string;
|
||||
formattedTotalAmount: string;
|
||||
formattedVatAmount: string;
|
||||
formattedDate: string;
|
||||
isOverdue: boolean;
|
||||
}>;
|
||||
stats: {
|
||||
totalSpent: number;
|
||||
pendingAmount: number;
|
||||
nextPaymentDate: string;
|
||||
nextPaymentAmount: number;
|
||||
activeSponsorships: number;
|
||||
averageMonthlySpend: number;
|
||||
formattedTotalSpent: string;
|
||||
formattedPendingAmount: string;
|
||||
formattedNextPaymentAmount: string;
|
||||
formattedAverageMonthlySpend: string;
|
||||
formattedNextPaymentDate: string;
|
||||
};
|
||||
}
|
||||
14
apps/website/lib/view-data/CreateTeamViewData.ts
Normal file
14
apps/website/lib/view-data/CreateTeamViewData.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* CreateTeamViewData
|
||||
*
|
||||
* ViewData for the create team result page.
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
*/
|
||||
|
||||
export interface CreateTeamViewData extends ViewData {
|
||||
teamId: string;
|
||||
success: boolean;
|
||||
successMessage: string;
|
||||
}
|
||||
38
apps/website/lib/view-data/DashboardStatsViewData.ts
Normal file
38
apps/website/lib/view-data/DashboardStatsViewData.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* DashboardStatsViewData
|
||||
*
|
||||
* ViewData for DashboardStatsViewModel.
|
||||
* Template-ready data structure with only primitives.
|
||||
*/
|
||||
|
||||
export interface DashboardStatsViewData extends ViewData {
|
||||
totalUsers: number;
|
||||
activeUsers: number;
|
||||
suspendedUsers: number;
|
||||
deletedUsers: number;
|
||||
systemAdmins: number;
|
||||
recentLogins: number;
|
||||
newUsersToday: number;
|
||||
userGrowth: {
|
||||
label: string;
|
||||
value: number;
|
||||
color: string;
|
||||
}[];
|
||||
roleDistribution: {
|
||||
label: string;
|
||||
value: number;
|
||||
color: string;
|
||||
}[];
|
||||
statusDistribution: {
|
||||
active: number;
|
||||
suspended: number;
|
||||
deleted: number;
|
||||
};
|
||||
activityTimeline: {
|
||||
date: string;
|
||||
newUsers: number;
|
||||
logins: number;
|
||||
}[];
|
||||
}
|
||||
Reference in New Issue
Block a user