view data fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
import { ActionItem } from '@/lib/queries/ActionsPageQuery';
|
||||
|
||||
export interface ActionsViewData {
|
||||
|
||||
export interface ActionsViewData extends ViewData {
|
||||
actions: ActionItem[];
|
||||
}
|
||||
|
||||
14
apps/website/lib/view-data/ActivityItemViewData.ts
Normal file
14
apps/website/lib/view-data/ActivityItemViewData.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* ActivityItemViewData
|
||||
*
|
||||
* ViewData for activity item rendering.
|
||||
*/
|
||||
export interface ActivityItemViewData extends ViewData {
|
||||
id: string;
|
||||
type: string;
|
||||
message: string;
|
||||
time: string;
|
||||
impressions?: number;
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* AdminDashboardViewData
|
||||
*
|
||||
*
|
||||
* ViewData for AdminDashboardTemplate.
|
||||
* Template-ready data structure with only primitives.
|
||||
*/
|
||||
export interface AdminDashboardViewData {
|
||||
|
||||
export interface AdminDashboardViewData extends ViewData {
|
||||
stats: {
|
||||
totalUsers: number;
|
||||
activeUsers: number;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* AdminUsersViewData
|
||||
*
|
||||
*
|
||||
* ViewData for AdminUsersTemplate.
|
||||
* Template-ready data structure with only primitives.
|
||||
*/
|
||||
export interface AdminUsersViewData {
|
||||
|
||||
export interface AdminUsersViewData extends ViewData {
|
||||
users: Array<{
|
||||
id: string;
|
||||
email: string;
|
||||
|
||||
13
apps/website/lib/view-data/AnalyticsDashboardViewData.ts
Normal file
13
apps/website/lib/view-data/AnalyticsDashboardViewData.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface AnalyticsDashboardViewData extends ViewData {
|
||||
metrics: {
|
||||
totalUsers: number;
|
||||
activeUsers: number;
|
||||
totalRaces: number;
|
||||
totalLeagues: number;
|
||||
userEngagementRate: number;
|
||||
formattedEngagementRate: string;
|
||||
activityLevel: string;
|
||||
};
|
||||
}
|
||||
42
apps/website/lib/view-data/AvailableLeaguesViewData.ts
Normal file
42
apps/website/lib/view-data/AvailableLeaguesViewData.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface AvailableLeaguesViewData extends ViewData {
|
||||
leagues: AvailableLeagueViewData[];
|
||||
}
|
||||
|
||||
export interface AvailableLeagueViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
game: string;
|
||||
drivers: number;
|
||||
avgViewsPerRace: number;
|
||||
formattedAvgViews: string;
|
||||
mainSponsorSlot: {
|
||||
available: boolean;
|
||||
price: number;
|
||||
};
|
||||
secondarySlots: {
|
||||
available: number;
|
||||
total: number;
|
||||
price: number;
|
||||
};
|
||||
cpm: number;
|
||||
formattedCpm: string;
|
||||
hasAvailableSlots: boolean;
|
||||
rating: number;
|
||||
tier: 'premium' | 'standard' | 'starter';
|
||||
tierConfig: {
|
||||
color: string;
|
||||
bgColor: string;
|
||||
border: string;
|
||||
icon: string;
|
||||
};
|
||||
nextRace?: string;
|
||||
seasonStatus: 'active' | 'upcoming' | 'completed';
|
||||
statusConfig: {
|
||||
color: string;
|
||||
bg: string;
|
||||
label: string;
|
||||
};
|
||||
description: string;
|
||||
}
|
||||
12
apps/website/lib/view-data/AvatarGenerationViewData.ts
Normal file
12
apps/website/lib/view-data/AvatarGenerationViewData.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
/**
|
||||
* AvatarGenerationViewData
|
||||
*
|
||||
* ViewData for avatar generation process.
|
||||
*/
|
||||
export interface AvatarGenerationViewData extends ViewData {
|
||||
success: boolean;
|
||||
avatarUrls: string[];
|
||||
errorMessage?: string;
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* AvatarViewData
|
||||
*
|
||||
* ViewData for avatar media rendering.
|
||||
*/
|
||||
export interface AvatarViewData {
|
||||
|
||||
export interface AvatarViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* CategoryIconViewData
|
||||
*
|
||||
* ViewData for category icon media rendering.
|
||||
*/
|
||||
export interface CategoryIconViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface CategoryIconViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
14
apps/website/lib/view-data/CreateLeagueViewData.ts
Normal file
14
apps/website/lib/view-data/CreateLeagueViewData.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* CreateLeagueViewData
|
||||
*
|
||||
* ViewData for the create league result page.
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
*/
|
||||
|
||||
export interface CreateLeagueViewData extends ViewData {
|
||||
leagueId: string;
|
||||
success: boolean;
|
||||
successMessage: string;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* Dashboard ViewData
|
||||
*
|
||||
@@ -6,7 +8,8 @@
|
||||
* for display and ISO string timestamps for JSON serialization.
|
||||
*/
|
||||
|
||||
export interface DashboardViewData {
|
||||
|
||||
export interface DashboardViewData extends ViewData {
|
||||
currentDriver: {
|
||||
name: string;
|
||||
avatarUrl: string;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface DriverRankingItem {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface DriverRankingItem extends ViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
import type { DriverRankingItem } from './DriverRankingItem';
|
||||
import type { PodiumDriver } from './PodiumDriver';
|
||||
|
||||
export interface DriverRankingsViewData {
|
||||
|
||||
export interface DriverRankingsViewData extends ViewData {
|
||||
drivers: DriverRankingItem[];
|
||||
podium: PodiumDriver[];
|
||||
searchQuery: string;
|
||||
|
||||
18
apps/website/lib/view-data/ForgotPasswordViewData.ts
Normal file
18
apps/website/lib/view-data/ForgotPasswordViewData.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* Forgot Password View Data
|
||||
*
|
||||
* ViewData for the forgot password template.
|
||||
*/
|
||||
|
||||
|
||||
export interface ForgotPasswordViewData extends ViewData {
|
||||
returnTo: string;
|
||||
showSuccess: boolean;
|
||||
successMessage?: string;
|
||||
magicLink?: string;
|
||||
formState: any; // Will be managed by client component
|
||||
isSubmitting: boolean;
|
||||
submitError?: string;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/**
|
||||
* Health View Data Types
|
||||
*
|
||||
@@ -52,7 +53,9 @@ export interface HealthAlert {
|
||||
severityColor: string;
|
||||
}
|
||||
|
||||
export interface HealthViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface HealthViewData extends ViewData {
|
||||
overallStatus: HealthStatus;
|
||||
metrics: HealthMetrics;
|
||||
components: HealthComponent[];
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface LeaderboardDriverItem {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface LeaderboardDriverItem extends ViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface LeaderboardTeamItem {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface LeaderboardTeamItem extends ViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
tag: string;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
import type { LeaderboardDriverItem } from './LeaderboardDriverItem';
|
||||
import type { LeaderboardTeamItem } from './LeaderboardTeamItem';
|
||||
|
||||
export interface LeaderboardsViewData {
|
||||
|
||||
export interface LeaderboardsViewData extends ViewData {
|
||||
drivers: LeaderboardDriverItem[];
|
||||
teams: LeaderboardTeamItem[];
|
||||
}
|
||||
@@ -1,17 +1,10 @@
|
||||
export interface AdminScheduleRaceData {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface AdminScheduleRaceData extends ViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
track: string;
|
||||
car: string;
|
||||
scheduledAt: string; // ISO string
|
||||
}
|
||||
|
||||
export interface LeagueAdminScheduleViewData {
|
||||
published: boolean;
|
||||
races: AdminScheduleRaceData[];
|
||||
seasons: Array<{
|
||||
seasonId: string;
|
||||
name: string;
|
||||
}>;
|
||||
seasonId: string;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* LeagueCoverViewData
|
||||
*
|
||||
* ViewData for league cover media rendering.
|
||||
*/
|
||||
export interface LeagueCoverViewData {
|
||||
|
||||
export interface LeagueCoverViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -87,6 +87,7 @@ export interface RecentResult {
|
||||
finishedAt: string;
|
||||
}
|
||||
|
||||
|
||||
export interface LeagueDetailViewData extends ViewData {
|
||||
// Basic info
|
||||
leagueId: string;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* LeagueLogoViewData
|
||||
*
|
||||
* ViewData for league logo media rendering.
|
||||
* ViewData for league logoViewData extends ViewData {dering.
|
||||
*/
|
||||
export interface LeagueLogoViewData {
|
||||
|
||||
export interface LeagueLogoViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* LeagueRosterAdminViewData - Pure ViewData for RosterAdminPage
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
@@ -25,7 +27,8 @@ export interface JoinRequestData {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface LeagueRosterAdminViewData {
|
||||
|
||||
export interface LeagueRosterAdminViewData extends ViewData {
|
||||
leagueId: string;
|
||||
members: RosterMemberData[];
|
||||
joinRequests: JoinRequestData[];
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface RulebookScoringConfig {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface RulebookScoringConfig extends ViewData {
|
||||
scoringPresetName: string | null;
|
||||
gameName: string;
|
||||
championships: Array<{
|
||||
@@ -12,9 +15,4 @@ export interface RulebookScoringConfig {
|
||||
bonusSummary: string[];
|
||||
}>;
|
||||
dropPolicySummary: string;
|
||||
}
|
||||
|
||||
export interface LeagueRulebookViewData {
|
||||
scoringConfig: RulebookScoringConfig | null;
|
||||
positionPoints: Array<{ position: number; points: number }>;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* LeagueScheduleViewData - Pure ViewData for LeagueScheduleTemplate
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
@@ -12,7 +14,8 @@ export interface ScheduleRaceData {
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface LeagueScheduleViewData {
|
||||
|
||||
export interface LeagueScheduleViewData extends ViewData {
|
||||
leagueId: string;
|
||||
races: ScheduleRaceData[];
|
||||
seasons: Array<{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface LeagueSettingsViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface LeagueSettingsViewData extends ViewData {
|
||||
leagueId: string;
|
||||
league: {
|
||||
id: string;
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface LeagueSponsorshipsViewData {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface LeagueSponsorshipsViewData extends ViewData {
|
||||
leagueId: string;
|
||||
activeTab: 'overview' | 'editor';
|
||||
onTabChange: (tab: 'overview' | 'editor') => void;
|
||||
@@ -1,25 +1,4 @@
|
||||
/**
|
||||
* LeagueStandingsViewData - Pure ViewData for LeagueStandingsTemplate
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
*/
|
||||
|
||||
export interface StandingEntryData {
|
||||
driverId: string;
|
||||
position: number;
|
||||
totalPoints: number;
|
||||
racesFinished: number;
|
||||
racesStarted: number;
|
||||
avgFinish: number | null;
|
||||
penaltyPoints: number;
|
||||
bonusPoints: number;
|
||||
teamName?: string;
|
||||
// New fields from Phase 3
|
||||
positionChange: number;
|
||||
lastRacePoints: number;
|
||||
droppedRaceIds: string[];
|
||||
wins: number;
|
||||
podiums: number;
|
||||
}
|
||||
|
||||
export interface DriverData {
|
||||
id: string;
|
||||
@@ -36,15 +15,4 @@ export interface LeagueMembershipData {
|
||||
role: 'owner' | 'admin' | 'steward' | 'member';
|
||||
joinedAt: string;
|
||||
status: 'active' | 'pending' | 'banned';
|
||||
}
|
||||
|
||||
export interface LeagueStandingsViewData {
|
||||
standings: StandingEntryData[];
|
||||
drivers: DriverData[];
|
||||
memberships: LeagueMembershipData[];
|
||||
leagueId: string;
|
||||
currentDriverId: string | null;
|
||||
isAdmin: boolean;
|
||||
// New fields for team standings toggle
|
||||
isTeamChampionship?: boolean;
|
||||
}
|
||||
16
apps/website/lib/view-data/LeagueWalletViewData.ts
Normal file
16
apps/website/lib/view-data/LeagueWalletViewData.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface LeagueWalletTransactionViewData extends ViewData {
|
||||
id: string;
|
||||
type: 'deposit' | 'withdrawal' | 'sponsorship' | 'prize';
|
||||
amount: number;
|
||||
formattedAmount: string;
|
||||
amountColor: string;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
formattedDate: string;
|
||||
status: 'completed' | 'pending' | 'failed';
|
||||
statusColor: string;
|
||||
typeColor: string;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
/**
|
||||
* Leagues ViewData
|
||||
*
|
||||
@@ -6,7 +8,8 @@
|
||||
* for display and ISO string timestamps for JSON serialization.
|
||||
*/
|
||||
|
||||
export interface LeaguesViewData {
|
||||
|
||||
export interface LeaguesViewData extends ViewData {
|
||||
leagues: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
20
apps/website/lib/view-data/LoginViewData.ts
Normal file
20
apps/website/lib/view-data/LoginViewData.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Login View Data
|
||||
*
|
||||
* ViewData for the login template.
|
||||
*/
|
||||
|
||||
import { FormState } from '../builders/view-data/types/FormState';
|
||||
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface LoginViewData extends ViewData {
|
||||
returnTo: string;
|
||||
hasInsufficientPermissions: boolean;
|
||||
showPassword: boolean;
|
||||
showErrorDetails: boolean;
|
||||
formState: FormState;
|
||||
isSubmitting: boolean;
|
||||
submitError?: string;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import { MediaAsset } from '@/components/media/MediaGallery';
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
|
||||
export interface MediaViewData {
|
||||
|
||||
export interface MediaViewData extends ViewData {
|
||||
assets: MediaAsset[];
|
||||
categories: { label: string; value: string }[];
|
||||
title: string;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
export interface OnboardingPageViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface OnboardingPageViewData extends ViewData {
|
||||
isAlreadyOnboarded: boolean;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface PodiumDriver {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
|
||||
export interface PodiumDriverViewData extends ViewData {
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
@@ -1,3 +1,6 @@
|
||||
export interface ProfileLayoutViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ProfileLayoutViewData extends ViewData {
|
||||
// Empty for now
|
||||
}
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
* Pure, JSON-serializable data structure for Template rendering
|
||||
*/
|
||||
|
||||
export interface ProfileLeaguesLeagueViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ProfileLeaguesLeagueViewData extends ViewData {
|
||||
leagueId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
membershipRole: 'owner' | 'admin' | 'steward' | 'member';
|
||||
}
|
||||
|
||||
export interface ProfileLeaguesViewData {
|
||||
|
||||
export interface ProfileLeaguesViewData extends ViewData {
|
||||
ownedLeagues: ProfileLeaguesLeagueViewData[];
|
||||
memberLeagues: ProfileLeaguesLeagueViewData[];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface ProfileLiveryViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ProfileLiveryViewData extends ViewData {
|
||||
id: string;
|
||||
carId: string;
|
||||
carName: string;
|
||||
@@ -7,6 +10,7 @@ export interface ProfileLiveryViewData {
|
||||
isValidated: boolean;
|
||||
}
|
||||
|
||||
export interface ProfileLiveriesViewData {
|
||||
|
||||
export interface ProfileLiveriesViewData extends ViewData {
|
||||
liveries: ProfileLiveryViewData[];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface ProfileViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ProfileViewData extends ViewData {
|
||||
driver: {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface ProtestDetailViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ProtestDetailViewData extends ViewData {
|
||||
protestId: string;
|
||||
leagueId: string;
|
||||
status: string;
|
||||
@@ -5,6 +5,8 @@
|
||||
* JSON-serializable, template-ready data structure.
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface RaceDetailEntry {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -48,7 +50,8 @@ export interface RaceDetailRegistration {
|
||||
canRegister: boolean;
|
||||
}
|
||||
|
||||
export interface RaceDetailViewData {
|
||||
|
||||
export interface RaceDetailViewData extends ViewData {
|
||||
race: RaceDetailRace;
|
||||
league?: RaceDetailLeague;
|
||||
entryList: RaceDetailEntry[];
|
||||
@@ -5,6 +5,8 @@
|
||||
* JSON-serializable, template-ready data structure.
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface RaceResultsResult {
|
||||
position: number;
|
||||
driverId: string;
|
||||
@@ -29,7 +31,8 @@ export interface RaceResultsPenalty {
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface RaceResultsViewData {
|
||||
|
||||
export interface RaceResultsViewData extends ViewData {
|
||||
raceTrack?: string;
|
||||
raceScheduledAt?: string;
|
||||
totalDrivers?: number;
|
||||
@@ -5,6 +5,8 @@
|
||||
* JSON-serializable, template-ready data structure.
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface Protest {
|
||||
id: string;
|
||||
protestingDriverId: string;
|
||||
@@ -33,7 +35,8 @@ export interface Driver {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface RaceStewardingViewData {
|
||||
|
||||
export interface RaceStewardingViewData extends ViewData {
|
||||
race?: {
|
||||
id: string;
|
||||
track: string;
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface RaceViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface RaceViewData extends ViewData {
|
||||
id: string;
|
||||
track: string;
|
||||
car: string;
|
||||
@@ -19,7 +22,8 @@ export interface RaceViewData {
|
||||
isPast: boolean;
|
||||
}
|
||||
|
||||
export interface RacesViewData {
|
||||
|
||||
export interface RacesViewData extends ViewData {
|
||||
races: RaceViewData[];
|
||||
totalCount: number;
|
||||
scheduledCount: number;
|
||||
|
||||
18
apps/website/lib/view-data/ResetPasswordViewData.ts
Normal file
18
apps/website/lib/view-data/ResetPasswordViewData.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Reset Password View Data
|
||||
*
|
||||
* ViewData for the reset password template.
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface ResetPasswordViewData extends ViewData {
|
||||
token: string;
|
||||
returnTo: string;
|
||||
showSuccess: boolean;
|
||||
successMessage?: string;
|
||||
formState: any; // Will be managed by client component
|
||||
isSubmitting: boolean;
|
||||
submitError?: string;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface RulebookViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface RulebookViewData extends ViewData {
|
||||
leagueId: string;
|
||||
gameName: string;
|
||||
scoringPresetName: string;
|
||||
15
apps/website/lib/view-data/SignupViewData.ts
Normal file
15
apps/website/lib/view-data/SignupViewData.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Signup View Data
|
||||
*
|
||||
* ViewData for the signup template.
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface SignupViewData extends ViewData {
|
||||
returnTo: string;
|
||||
formState: any; // Will be managed by client component
|
||||
isSubmitting: boolean;
|
||||
submitError?: string;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface SponsorDashboardViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface SponsorDashboardViewData extends ViewData {
|
||||
sponsorName: string;
|
||||
totalImpressions: string;
|
||||
totalInvestment: string;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
/**
|
||||
* SponsorLogoViewData
|
||||
*
|
||||
* ViewData for sponsor logo media rendering.
|
||||
*/
|
||||
export interface SponsorLogoViewData {
|
||||
|
||||
export interface SponsorLogoViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
export interface StewardingViewData {
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
|
||||
export interface StewardingViewData extends ViewData {
|
||||
leagueId: string;
|
||||
totalPending: number;
|
||||
totalResolved: number;
|
||||
@@ -3,6 +3,8 @@
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
*/
|
||||
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
export interface SponsorMetric {
|
||||
icon: string; // Icon name (e.g. 'users', 'zap', 'calendar')
|
||||
label: string;
|
||||
@@ -51,7 +53,8 @@ export interface TeamTab {
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
export interface TeamDetailViewData {
|
||||
|
||||
export interface TeamDetailViewData extends ViewData {
|
||||
team: TeamDetailData;
|
||||
memberships: TeamMemberData[];
|
||||
currentDriverId: string;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
import type { TeamSummaryViewModel } from '../view-models/TeamSummaryViewModel';
|
||||
|
||||
export type SkillLevel = 'pro' | 'advanced' | 'intermediate' | 'beginner';
|
||||
export type SortBy = 'rating' | 'wins' | 'winRate' | 'races';
|
||||
|
||||
export interface TeamLeaderboardViewData {
|
||||
|
||||
export interface TeamLeaderboardViewData extends ViewData {
|
||||
teams: TeamSummaryViewModel[];
|
||||
searchQuery: string;
|
||||
filterLevel: SkillLevel | 'all';
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
/**
|
||||
* TeamLogoViewData
|
||||
*
|
||||
* ViewData for team logo media rendering.
|
||||
*/
|
||||
export interface TeamLogoViewData {
|
||||
|
||||
export interface TeamLogoViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ViewData } from '../contracts/view-data/ViewData';
|
||||
import type { LeaderboardTeamItem } from './LeaderboardTeamItem';
|
||||
|
||||
export interface TeamRankingsViewData {
|
||||
|
||||
export interface TeamRankingsViewData extends ViewData {
|
||||
teams: LeaderboardTeamItem[];
|
||||
podium: LeaderboardTeamItem[];
|
||||
recruitingCount: number;
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface TeamSummaryData {
|
||||
countryCode?: string;
|
||||
}
|
||||
|
||||
|
||||
export interface TeamsViewData extends ViewData {
|
||||
teams: TeamSummaryData[];
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { ViewData } from "../contracts/view-data/ViewData";
|
||||
|
||||
/**
|
||||
* TrackImageViewData
|
||||
*
|
||||
* ViewData for track image media rendering.
|
||||
*/
|
||||
export interface TrackImageViewData {
|
||||
|
||||
export interface TrackImageViewData extends ViewData {
|
||||
buffer: string; // base64 encoded
|
||||
contentType: string;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
export interface LeagueScheduleViewData {
|
||||
leagueId: string;
|
||||
races: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
scheduledAt: string; // ISO string
|
||||
track?: string;
|
||||
car?: string;
|
||||
sessionType?: string;
|
||||
isPast: boolean;
|
||||
isUpcoming: boolean;
|
||||
status: 'scheduled' | 'completed';
|
||||
strengthOfField?: number;
|
||||
// Registration info
|
||||
isUserRegistered?: boolean;
|
||||
canRegister?: boolean;
|
||||
// Admin info
|
||||
canEdit?: boolean;
|
||||
canReschedule?: boolean;
|
||||
}>;
|
||||
// User permissions
|
||||
currentDriverId?: string;
|
||||
isAdmin: boolean;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
export interface LeagueWalletTransactionViewData {
|
||||
id: string;
|
||||
type: 'deposit' | 'withdrawal' | 'sponsorship' | 'prize';
|
||||
amount: number;
|
||||
formattedAmount: string;
|
||||
amountColor: string;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
formattedDate: string;
|
||||
status: 'completed' | 'pending' | 'failed';
|
||||
statusColor: string;
|
||||
typeColor: string;
|
||||
}
|
||||
|
||||
export interface LeagueWalletViewData {
|
||||
leagueId: string;
|
||||
balance: number;
|
||||
formattedBalance: string;
|
||||
totalRevenue: number;
|
||||
formattedTotalRevenue: string;
|
||||
totalFees: number;
|
||||
formattedTotalFees: string;
|
||||
pendingPayouts: number;
|
||||
formattedPendingPayouts: string;
|
||||
currency: string;
|
||||
transactions: LeagueWalletTransactionViewData[];
|
||||
}
|
||||
Reference in New Issue
Block a user