view data fixes
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export interface CompleteOnboardingViewData {
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
export interface CompleteOnboardingViewData extends ViewData {
|
||||
success: boolean;
|
||||
driverId?: string;
|
||||
errorMessage?: string;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export interface DeleteMediaViewData {
|
||||
import { ViewData } from "@/lib/contracts/view-data/ViewData";
|
||||
|
||||
export interface DeleteMediaViewData extends ViewData {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
7
apps/website/lib/view-data/GenerateAvatarsViewData.ts
Normal file
7
apps/website/lib/view-data/GenerateAvatarsViewData.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ViewData } from "@/lib/contracts/view-data/ViewData";
|
||||
|
||||
export interface GenerateAvatarsViewData extends ViewData {
|
||||
success: boolean;
|
||||
avatarUrls: string[];
|
||||
errorMessage?: string;
|
||||
}
|
||||
22
apps/website/lib/view-data/HomeViewData.ts
Normal file
22
apps/website/lib/view-data/HomeViewData.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
export interface HomeViewData extends ViewData {
|
||||
isAlpha: boolean;
|
||||
upcomingRaces: Array<{
|
||||
id: string;
|
||||
track: string;
|
||||
car: string;
|
||||
formattedDate: string;
|
||||
}>;
|
||||
topLeagues: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}>;
|
||||
teams: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
logoUrl?: string;
|
||||
}>;
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
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,31 +1,86 @@
|
||||
import type { DriverViewData } from './DriverViewData';
|
||||
import type { RaceViewData } from './RaceViewData';
|
||||
import { ViewData } from '@/lib/contracts/view-data/ViewData';
|
||||
|
||||
export interface LeagueViewData {
|
||||
export interface LiveRaceData {
|
||||
id: string;
|
||||
name: string;
|
||||
game: string;
|
||||
tier: 'premium' | 'standard' | 'starter';
|
||||
season: string;
|
||||
description: string;
|
||||
drivers: number;
|
||||
races: number;
|
||||
completedRaces: number;
|
||||
totalImpressions: number;
|
||||
avgViewsPerRace: number;
|
||||
engagement: number;
|
||||
rating: number;
|
||||
seasonStatus: 'active' | 'upcoming' | 'completed';
|
||||
seasonDates: { start: string; end: string };
|
||||
nextRace?: { name: string; date: string };
|
||||
sponsorSlots: {
|
||||
main: { available: boolean; price: number; benefits: string[] };
|
||||
secondary: { available: number; total: number; price: number; benefits: string[] };
|
||||
};
|
||||
date: string;
|
||||
registeredCount: number;
|
||||
strengthOfField: number;
|
||||
}
|
||||
|
||||
export interface LeagueDetailViewData {
|
||||
league: LeagueViewData;
|
||||
drivers: (DriverViewData & { impressions: number })[];
|
||||
races: (RaceViewData & { views: number })[];
|
||||
export interface LeagueInfoData {
|
||||
name: string;
|
||||
description: string;
|
||||
membersCount: number;
|
||||
racesCount: number;
|
||||
avgSOF: number | null;
|
||||
structure: string;
|
||||
scoring: string;
|
||||
createdAt: string;
|
||||
discordUrl?: string;
|
||||
youtubeUrl?: string;
|
||||
websiteUrl?: string;
|
||||
}
|
||||
|
||||
export interface DriverSummaryData {
|
||||
driverId: string;
|
||||
driverName: string;
|
||||
avatarUrl: string | null;
|
||||
rating: number | null;
|
||||
rank: number | null;
|
||||
roleBadgeText: string;
|
||||
roleBadgeClasses: string;
|
||||
profileUrl: string;
|
||||
}
|
||||
|
||||
export interface SponsorInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
tier: string;
|
||||
logoUrl?: string;
|
||||
websiteUrl?: string;
|
||||
tagline?: string;
|
||||
}
|
||||
|
||||
export interface NextRaceInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
date: string;
|
||||
track: string;
|
||||
car: string;
|
||||
}
|
||||
|
||||
export interface SeasonProgress {
|
||||
completedRaces: number;
|
||||
totalRaces: number;
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
export interface RecentResult {
|
||||
raceId: string;
|
||||
raceName: string;
|
||||
position: number;
|
||||
points: number;
|
||||
finishedAt: string;
|
||||
}
|
||||
|
||||
export interface LeagueDetailViewData extends ViewData {
|
||||
leagueId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
logoUrl?: string;
|
||||
info: LeagueInfoData;
|
||||
runningRaces: LiveRaceData[];
|
||||
sponsors: SponsorInfo[];
|
||||
ownerSummary: DriverSummaryData | null;
|
||||
adminSummaries: DriverSummaryData[];
|
||||
stewardSummaries: DriverSummaryData[];
|
||||
memberSummaries: DriverSummaryData[];
|
||||
sponsorInsights: any | null;
|
||||
nextRace?: NextRaceInfo;
|
||||
seasonProgress: SeasonProgress;
|
||||
recentResults: RecentResult[];
|
||||
walletBalance: number;
|
||||
pendingProtestsCount: number;
|
||||
pendingJoinRequestsCount: number;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface LeaguesViewData extends ViewData {
|
||||
scoring: {
|
||||
gameId: string;
|
||||
gameName: string;
|
||||
primaryChampionshipType: string;
|
||||
primaryChampionshipType: 'driver' | 'team' | 'nations' | 'trophy';
|
||||
scoringPresetId: string;
|
||||
scoringPresetName: string;
|
||||
dropPolicySummary: string;
|
||||
|
||||
Reference in New Issue
Block a user