refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -19,6 +19,7 @@ export * from './use-cases/GetLeagueDriverSeasonStatsUseCase';
export * from './use-cases/GetAllLeaguesWithCapacityUseCase';
export * from './use-cases/GetAllLeaguesWithCapacityAndScoringUseCase';
export * from './use-cases/GetAllRacesUseCase';
export * from './use-cases/GetAllRacesPageDataUseCase';
export * from './use-cases/GetTotalRacesUseCase';
export * from './use-cases/ImportRaceResultsApiUseCase';
export * from './use-cases/ListLeagueScoringPresetsUseCase';
@@ -74,6 +75,8 @@ export type {
} from './dto/LeagueScheduleDTO';
export type { ChampionshipStandingsOutputPort } from './ports/output/ChampionshipStandingsOutputPort';
export type { ChampionshipStandingsRowOutputPort } from './ports/output/ChampionshipStandingsRowOutputPort';
export type { AllRacesPageOutputPort } from './ports/output/AllRacesPageOutputPort';
export type { DriverRegistrationStatusOutputPort } from './ports/output/DriverRegistrationStatusOutputPort';
export type {
LeagueConfigFormModel,
LeagueStructureFormDTO,

View File

@@ -0,0 +1,18 @@
import type { League } from '../../../domain/entities/League';
import type { Season } from '../../../domain/entities/season/Season';
import type { LeagueScoringConfig } from '../../../domain/entities/LeagueScoringConfig';
import type { Game } from '../../../domain/entities/Game';
import type { LeagueScoringPresetOutputPort } from './LeagueScoringPresetOutputPort';
export interface LeagueEnrichedData {
league: League;
usedDriverSlots: number;
season?: Season;
scoringConfig?: LeagueScoringConfig;
game?: Game;
preset?: LeagueScoringPresetOutputPort;
}
export interface AllLeaguesWithCapacityAndScoringOutputPort {
leagues: LeagueEnrichedData[];
}

View File

@@ -0,0 +1,6 @@
import type { League } from '../../domain/entities/League';
export interface AllLeaguesWithCapacityOutputPort {
leagues: League[];
memberCounts: Record<string, number>;
}

View File

@@ -0,0 +1,22 @@
export type AllRacesStatus = 'scheduled' | 'running' | 'completed' | 'cancelled' | 'all';
export interface AllRacesListItem {
id: string;
track: string;
car: string;
scheduledAt: string;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
leagueId: string;
leagueName: string;
strengthOfField: number | null;
}
export interface AllRacesFilterOptions {
statuses: { value: AllRacesStatus; label: string }[];
leagues: { id: string; name: string }[];
}
export interface AllRacesPageOutputPort {
races: AllRacesListItem[];
filters: AllRacesFilterOptions;
}

View File

@@ -0,0 +1,4 @@
export interface ApproveLeagueJoinRequestOutputPort {
success: boolean;
message: string;
}

View File

@@ -0,0 +1,3 @@
export interface CompleteDriverOnboardingOutputPort {
driverId: string;
}

View File

@@ -0,0 +1,4 @@
export interface CreateLeagueOutputPort {
leagueId: string;
success: boolean;
}

View File

@@ -1,7 +1,6 @@
import type { Presenter } from '@core/shared/presentation';
import type { FeedItemType } from '@core/social/domain/types/FeedItemType';
export interface DashboardDriverSummaryViewModel {
export interface DashboardDriverSummaryOutputPort {
id: string;
name: string;
country: string;
@@ -14,7 +13,7 @@ export interface DashboardDriverSummaryViewModel {
consistency: number | null;
}
export interface DashboardRaceSummaryViewModel {
export interface DashboardRaceSummaryOutputPort {
id: string;
leagueId: string;
leagueName: string;
@@ -25,7 +24,7 @@ export interface DashboardRaceSummaryViewModel {
isMyLeague: boolean;
}
export interface DashboardRecentResultViewModel {
export interface DashboardRecentResultOutputPort {
raceId: string;
raceName: string;
leagueId: string;
@@ -35,7 +34,7 @@ export interface DashboardRecentResultViewModel {
incidents: number;
}
export interface DashboardLeagueStandingSummaryViewModel {
export interface DashboardLeagueStandingSummaryOutputPort {
leagueId: string;
leagueName: string;
position: number;
@@ -43,7 +42,7 @@ export interface DashboardLeagueStandingSummaryViewModel {
points: number;
}
export interface DashboardFeedItemSummaryViewModel {
export interface DashboardFeedItemSummaryOutputPort {
id: string;
type: FeedItemType;
headline: string;
@@ -53,39 +52,34 @@ export interface DashboardFeedItemSummaryViewModel {
ctaHref?: string;
}
export interface DashboardFeedSummaryViewModel {
export interface DashboardFeedSummaryOutputPort {
notificationCount: number;
items: DashboardFeedItemSummaryViewModel[];
items: DashboardFeedItemSummaryOutputPort[];
}
export interface DashboardFriendSummaryViewModel {
export interface DashboardFriendSummaryOutputPort {
id: string;
name: string;
country: string;
avatarUrl: string;
}
export interface DashboardOverviewViewModel {
currentDriver: DashboardDriverSummaryViewModel | null;
myUpcomingRaces: DashboardRaceSummaryViewModel[];
otherUpcomingRaces: DashboardRaceSummaryViewModel[];
export interface DashboardOverviewOutputPort {
currentDriver: DashboardDriverSummaryOutputPort | null;
myUpcomingRaces: DashboardRaceSummaryOutputPort[];
otherUpcomingRaces: DashboardRaceSummaryOutputPort[];
/**
* All upcoming races for the driver, already sorted by scheduledAt ascending.
*/
upcomingRaces: DashboardRaceSummaryViewModel[];
upcomingRaces: DashboardRaceSummaryOutputPort[];
/**
* Count of distinct leagues that are currently "active" for the driver,
* based on upcoming races and league standings.
*/
activeLeaguesCount: number;
nextRace: DashboardRaceSummaryViewModel | null;
recentResults: DashboardRecentResultViewModel[];
leagueStandingsSummaries: DashboardLeagueStandingSummaryViewModel[];
feedSummary: DashboardFeedSummaryViewModel;
friends: DashboardFriendSummaryViewModel[];
}
export type DashboardOverviewResultDTO = DashboardOverviewViewModel;
export interface IDashboardOverviewPresenter
extends Presenter<DashboardOverviewResultDTO, DashboardOverviewViewModel> {}
nextRace: DashboardRaceSummaryOutputPort | null;
recentResults: DashboardRecentResultOutputPort[];
leagueStandingsSummaries: DashboardLeagueStandingSummaryOutputPort[];
feedSummary: DashboardFeedSummaryOutputPort;
friends: DashboardFriendSummaryOutputPort[];
}

View File

@@ -0,0 +1,5 @@
export interface DriverRegistrationStatusOutputPort {
isRegistered: boolean;
raceId: string;
driverId: string;
}

View File

@@ -1,4 +1,5 @@
export interface GetDriverTeamOutputPort {
export interface DriverTeamOutputPort {
driverId: string;
team: {
id: string;
name: string;
@@ -9,9 +10,10 @@ export interface GetDriverTeamOutputPort {
createdAt: Date;
};
membership: {
driverId: string;
teamId: string;
role: 'member' | 'captain' | 'admin';
driverId: string;
role: 'owner' | 'manager' | 'driver';
status: 'active' | 'pending' | 'none';
joinedAt: Date;
};
}

View File

@@ -0,0 +1,22 @@
import type { SkillLevel } from '../../domain/services/SkillLevelService';
export interface DriverLeaderboardItemOutputPort {
id: string;
name: string;
rating: number;
skillLevel: SkillLevel;
nationality: string;
racesCompleted: number;
wins: number;
podiums: number;
isActive: boolean;
rank: number;
avatarUrl: string;
}
export interface DriversLeaderboardOutputPort {
drivers: DriverLeaderboardItemOutputPort[];
totalRaces: number;
totalWins: number;
activeCount: number;
}

View File

@@ -0,0 +1,13 @@
export interface GetAllRacesOutputPort {
races: {
id: string;
leagueId: string;
track: string;
car: string;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
scheduledAt: string;
strengthOfField: number | null;
leagueName: string;
}[];
totalCount: number;
}

View File

@@ -7,5 +7,7 @@ export interface GetAllTeamsOutputPort {
ownerId: string;
leagues: string[];
createdAt: Date;
memberCount: number;
}>;
totalCount?: number;
}

View File

@@ -1,7 +1,4 @@
export interface GetLeagueAdminOutputPort {
league: {
id: string;
ownerId: string;
};
// Additional data would be populated by combining multiple use cases
leagueId: string;
ownerId: string;
}

View File

@@ -1,13 +1,12 @@
export interface LeagueJoinRequestOutputPort {
id: string;
leagueId: string;
driverId: string;
requestedAt: Date;
message: string;
driver: { id: string; name: string } | null;
}
export interface GetLeagueJoinRequestsOutputPort {
joinRequests: Array<{
id: string;
leagueId: string;
driverId: string;
requestedAt: Date;
message?: string;
driver: {
id: string;
name: string;
};
}>;
joinRequests: LeagueJoinRequestOutputPort[];
}

View File

@@ -1,10 +1,14 @@
export interface LeagueMembershipOutputPort {
driverId: string;
driver: { id: string; name: string };
role: string;
joinedAt: Date;
}
export interface LeagueMembershipsOutputPort {
members: LeagueMembershipOutputPort[];
}
export interface GetLeagueMembershipsOutputPort {
memberships: Array<{
id: string;
leagueId: string;
driverId: string;
role: 'member' | 'admin' | 'owner';
joinedAt: Date;
}>;
drivers: { id: string; name: string }[];
memberships: LeagueMembershipsOutputPort;
}

View File

@@ -1,3 +1,9 @@
export interface LeagueOwnerSummaryOutputPort {
driver: { id: string; iracingId: string; name: string; country: string; bio: string | undefined; joinedAt: string };
rating: number;
rank: number;
}
export interface GetLeagueOwnerSummaryOutputPort {
summary: { driver: { id: string; name: string }; rating: number; rank: number } | null;
summary: LeagueOwnerSummaryOutputPort | null;
}

View File

@@ -1,20 +1,47 @@
export interface ProtestOutputPort {
id: string;
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
incident: { lap: number; description: string; timeInRace: number | undefined };
comment: string | undefined;
proofVideoUrl: string | undefined;
status: string;
reviewedBy: string | undefined;
decisionNotes: string | undefined;
filedAt: string;
reviewedAt: string | undefined;
defense: { statement: string; videoUrl: string | undefined; submittedAt: string } | undefined;
defenseRequestedAt: string | undefined;
defenseRequestedBy: string | undefined;
}
export interface RaceOutputPort {
id: string;
leagueId: string;
scheduledAt: string;
track: string;
trackId: string | undefined;
car: string;
carId: string | undefined;
sessionType: string;
status: string;
strengthOfField: number | undefined;
registeredCount: number | undefined;
maxParticipants: number | undefined;
}
export interface DriverOutputPort {
id: string;
iracingId: string;
name: string;
country: string;
bio: string | undefined;
joinedAt: string;
}
export interface GetLeagueProtestsOutputPort {
protests: Array<{
id: string;
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
submittedAt: Date;
description: string;
status: string;
}>;
races: Array<{
id: string;
name: string;
date: string;
}>;
drivers: Array<{
id: string;
name: string;
}>;
protests: ProtestOutputPort[];
racesById: Record<string, RaceOutputPort>;
driversById: Record<string, DriverOutputPort>;
}

View File

@@ -0,0 +1,13 @@
export interface LeagueSeasonSummaryOutputPort {
seasonId: string;
name: string;
status: string;
startDate: Date;
endDate: Date;
isPrimary: boolean;
isParallelActive: boolean;
}
export interface GetLeagueSeasonsOutputPort {
seasons: LeagueSeasonSummaryOutputPort[];
}

View File

@@ -0,0 +1,10 @@
export interface GetSponsorsOutputPort {
sponsors: {
id: string;
name: string;
contactEmail: string;
websiteUrl: string | undefined;
logoUrl: string | undefined;
createdAt: Date;
}[];
}

View File

@@ -0,0 +1,10 @@
export interface GetSponsorshipPricingOutputPort {
entityType: string;
entityId: string;
pricing: {
id: string;
level: string;
price: number;
currency: string;
}[];
}

View File

@@ -9,9 +9,9 @@ export interface GetTeamDetailsOutputPort {
createdAt: Date;
};
membership: {
driverId: string;
teamId: string;
role: 'member' | 'captain' | 'admin';
role: 'owner' | 'manager' | 'member';
joinedAt: Date;
isActive: boolean;
} | null;
canManage: boolean;
}

View File

@@ -0,0 +1,3 @@
export interface GetTotalLeaguesOutputPort {
totalLeagues: number;
}

View File

@@ -0,0 +1,3 @@
export interface GetTotalRacesOutputPort {
totalRaces: number;
}

View File

@@ -0,0 +1,8 @@
export interface ImportRaceResultsApiOutputPort {
success: boolean;
raceId: string;
leagueId: string;
driversProcessed: number;
resultsRecorded: number;
errors?: string[];
}

View File

@@ -0,0 +1,5 @@
export interface JoinLeagueOutputPort {
membershipId: string;
leagueId: string;
status: string;
}

View File

@@ -1,4 +1,4 @@
export interface LeagueDriverSeasonStatsOutputPort {
export interface LeagueDriverSeasonStatsItemOutputPort {
leagueId: string;
driverId: string;
position: number;
@@ -17,4 +17,9 @@ export interface LeagueDriverSeasonStatsOutputPort {
avgFinish: number | null;
rating: number | null;
ratingChange: number | null;
}
export interface LeagueDriverSeasonStatsOutputPort {
leagueId: string;
stats: LeagueDriverSeasonStatsItemOutputPort[];
}

View File

@@ -0,0 +1,11 @@
import type { League } from '../../domain/entities/League';
import type { Season } from '../../domain/entities/Season';
import type { LeagueScoringConfig } from '../../domain/entities/LeagueScoringConfig';
import type { Game } from '../../domain/entities/Game';
export interface LeagueFullConfigOutputPort {
league: League;
activeSeason?: Season;
scoringConfig?: LeagueScoringConfig;
game?: Game;
}

View File

@@ -1,18 +1,12 @@
import type { ChampionshipConfig } from '../../domain/types/ChampionshipConfig';
import type { LeagueScoringPresetOutputPort } from './LeagueScoringPresetOutputPort';
export interface LeagueScoringConfigOutputPort {
leagueId: string;
seasonId: string;
gameId: string;
gameName: string;
scoringPresetId?: string;
scoringPresetName?: string;
dropPolicySummary: string;
championships: Array<{
id: string;
name: string;
type: 'driver' | 'team' | 'nations' | 'trophy';
sessionTypes: string[];
pointsPreview: Array<{ sessionType: string; position: number; points: number }>;
bonusSummary: string[];
dropPolicyDescription: string;
}>;
preset?: LeagueScoringPresetOutputPort;
championships: ChampionshipConfig[];
}

View File

@@ -0,0 +1,5 @@
import type { LeagueScoringPresetOutputPort } from './LeagueScoringPresetOutputPort';
export interface LeagueScoringPresetsOutputPort {
presets: LeagueScoringPresetOutputPort[];
}

View File

@@ -0,0 +1,10 @@
export interface StandingItemOutputPort {
driverId: string;
driver: { id: string; name: string };
points: number;
rank: number;
}
export interface LeagueStandingsOutputPort {
standings: StandingItemOutputPort[];
}

View File

@@ -0,0 +1,5 @@
export interface LeagueStatsOutputPort {
totalMembers: number;
totalRaces: number;
averageRating: number;
}

View File

@@ -0,0 +1,24 @@
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
import type { SponsorshipTier } from '../../domain/entities/SeasonSponsorship';
export interface PendingSponsorshipRequestOutput {
id: string;
sponsorId: string;
sponsorName: string;
sponsorLogo?: string;
tier: SponsorshipTier;
offeredAmount: number;
currency: string;
formattedAmount: string;
message?: string;
createdAt: Date;
platformFee: number;
netAmount: number;
}
export interface PendingSponsorshipRequestsOutputPort {
entityType: SponsorableEntityType;
entityId: string;
requests: PendingSponsorshipRequestOutput[];
totalCount: number;
}

View File

@@ -0,0 +1,57 @@
export interface ProfileOverviewOutputPort {
driver: {
id: string;
name: string;
country: string;
avatarUrl: string;
iracingId: string | null;
joinedAt: Date;
rating: number | null;
globalRank: number | null;
consistency: number | null;
bio: string | null;
totalDrivers: number | null;
};
stats: {
totalRaces: number;
wins: number;
podiums: number;
dnfs: number;
avgFinish: number | null;
bestFinish: number | null;
worstFinish: number | null;
finishRate: number | null;
winRate: number | null;
podiumRate: number | null;
percentile: number | null;
rating: number | null;
consistency: number | null;
overallRank: number | null;
} | null;
finishDistribution: {
totalRaces: number;
wins: number;
podiums: number;
topTen: number;
dnfs: number;
other: number;
} | null;
teamMemberships: {
teamId: string;
teamName: string;
teamTag: string | null;
role: string;
joinedAt: Date;
isCurrent: boolean;
}[];
socialSummary: {
friendsCount: number;
friends: {
id: string;
name: string;
country: string;
avatarUrl: string;
}[];
};
extendedProfile: null;
}

View File

@@ -0,0 +1,15 @@
import type { Race } from '../../../domain/entities/Race';
import type { League } from '../../../domain/entities/League';
import type { RaceRegistration } from '../../../domain/entities/RaceRegistration';
import type { Driver } from '../../../domain/entities/Driver';
import type { Result } from '../../../domain/entities/result/Result';
export interface RaceDetailOutputPort {
race: Race;
league: League | null;
registrations: RaceRegistration[];
drivers: Driver[];
userResult: Result | null;
isUserRegistered: boolean;
canRegister: boolean;
}

View File

@@ -0,0 +1,7 @@
import type { Penalty } from '../../../domain/entities/Penalty';
import type { Driver } from '../../../domain/entities/Driver';
export interface RacePenaltiesOutputPort {
penalties: Penalty[];
drivers: Driver[];
}

View File

@@ -0,0 +1,7 @@
import type { Protest } from '../../../domain/entities/Protest';
import type { Driver } from '../../../domain/entities/Driver';
export interface RaceProtestsOutputPort {
protests: Protest[];
drivers: Driver[];
}

View File

@@ -0,0 +1,5 @@
import type { RaceRegistration } from '../../../domain/entities/RaceRegistration';
export interface RaceRegistrationsOutputPort {
registrations: RaceRegistration[];
}

View File

@@ -0,0 +1,16 @@
import type { Race } from '../../../domain/entities/Race';
import type { League } from '../../../domain/entities/League';
import type { Result } from '../../../domain/entities/result/Result';
import type { Driver } from '../../../domain/entities/Driver';
import type { Penalty } from '../../../domain/entities/Penalty';
export interface RaceResultsDetailOutputPort {
race: Race;
league: League | null;
results: Result[];
drivers: Driver[];
penalties: Penalty[];
pointsSystem?: Record<number, number>;
fastestLapTime?: number;
currentDriverId?: string;
}

View File

@@ -0,0 +1,12 @@
export interface RaceWithSOFOutputPort {
id: string;
leagueId: string;
track: string;
car: string;
scheduledAt: Date;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
strengthOfField: number | null;
registeredCount: number;
maxParticipants: number;
participantCount: number;
}

View File

@@ -0,0 +1,14 @@
export interface RacesPageOutputPort {
page: number;
pageSize: number;
totalCount: number;
races: {
id: string;
leagueId: string;
track: string;
car: string;
scheduledAt: Date;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
strengthOfField: number | null;
}[];
}

View File

@@ -0,0 +1,4 @@
export interface RejectLeagueJoinRequestOutputPort {
success: boolean;
message: string;
}

View File

@@ -0,0 +1,3 @@
export interface RemoveLeagueMemberOutputPort {
success: boolean;
}

View File

@@ -0,0 +1,30 @@
export interface SponsoredLeagueOutput {
id: string;
name: string;
tier: 'main' | 'secondary';
drivers: number;
races: number;
impressions: number;
status: 'active' | 'upcoming' | 'completed';
}
export interface SponsorDashboardOutputPort {
sponsorId: string;
sponsorName: string;
metrics: {
impressions: number;
impressionsChange: number;
uniqueViewers: number;
viewersChange: number;
races: number;
drivers: number;
exposure: number;
exposureChange: number;
};
sponsoredLeagues: SponsoredLeagueOutput[];
investment: {
activeSponsorships: number;
totalInvestment: number;
costPerThousandViews: number;
};
}

View File

@@ -0,0 +1,46 @@
import type { SponsorshipTier, SponsorshipStatus } from '../../domain/entities/SeasonSponsorship';
export interface SponsorshipDetailOutput {
id: string;
leagueId: string;
leagueName: string;
seasonId: string;
seasonName: string;
seasonStartDate?: Date;
seasonEndDate?: Date;
tier: SponsorshipTier;
status: SponsorshipStatus;
pricing: {
amount: number;
currency: string;
};
platformFee: {
amount: number;
currency: string;
};
netAmount: {
amount: number;
currency: string;
};
metrics: {
drivers: number;
races: number;
completedRaces: number;
impressions: number;
};
createdAt: Date;
activatedAt?: Date;
}
export interface SponsorSponsorshipsOutputPort {
sponsorId: string;
sponsorName: string;
sponsorships: SponsorshipDetailOutput[];
summary: {
totalSponsorships: number;
activeSponsorships: number;
totalInvestment: number;
totalPlatformFees: number;
currency: string;
};
}

View File

@@ -0,0 +1,13 @@
export interface TeamJoinRequestsOutputPort {
requests: {
requestId: string;
driverId: string;
driverName: string;
teamId: string;
status: 'pending' | 'approved' | 'rejected';
requestedAt: Date;
avatarUrl: string;
}[];
pendingCount: number;
totalCount: number;
}

View File

@@ -0,0 +1,14 @@
export interface TeamMembersOutputPort {
members: {
driverId: string;
driverName: string;
role: 'owner' | 'manager' | 'member';
joinedAt: Date;
isActive: boolean;
avatarUrl: string;
}[];
totalCount: number;
ownerCount: number;
managerCount: number;
memberCount: number;
}

View File

@@ -0,0 +1,50 @@
export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';
export interface TeamsLeaderboardOutputPort {
teams: {
id: string;
name: string;
memberCount: number;
rating: number | null;
totalWins: number;
totalRaces: number;
performanceLevel: SkillLevel;
isRecruiting: boolean;
createdAt: Date;
description?: string;
specialization?: 'endurance' | 'sprint' | 'mixed';
region?: string;
languages?: string[];
}[];
recruitingCount: number;
groupsBySkillLevel: Record<SkillLevel, {
id: string;
name: string;
memberCount: number;
rating: number | null;
totalWins: number;
totalRaces: number;
performanceLevel: SkillLevel;
isRecruiting: boolean;
createdAt: Date;
description?: string;
specialization?: 'endurance' | 'sprint' | 'mixed';
region?: string;
languages?: string[];
}[]>;
topTeams: {
id: string;
name: string;
memberCount: number;
rating: number | null;
totalWins: number;
totalRaces: number;
performanceLevel: SkillLevel;
isRecruiting: boolean;
createdAt: Date;
description?: string;
specialization?: 'endurance' | 'sprint' | 'mixed';
region?: string;
languages?: string[];
}[];
}

View File

@@ -0,0 +1,3 @@
export interface TotalDriversOutputPort {
totalDrivers: number;
}

View File

@@ -0,0 +1,3 @@
export interface TransferLeagueOwnershipOutputPort {
success: boolean;
}

View File

@@ -0,0 +1,3 @@
export interface UpdateLeagueMemberRoleOutputPort {
success: boolean;
}

View File

@@ -1,47 +0,0 @@
import type { League } from '../../domain/entities/League';
import type { Season } from '../../domain/entities/Season';
import type { LeagueScoringConfig } from '../../domain/entities/LeagueScoringConfig';
import type { Game } from '../../domain/entities/Game';
import type { LeagueScoringPresetOutputPort } from '../ports/output/LeagueScoringPresetOutputPort';
import type { Presenter } from '@core/shared/presentation';
export interface LeagueSummaryViewModel {
id: string;
name: string;
description: string;
ownerId: string;
createdAt: string;
maxDrivers: number;
usedDriverSlots: number;
maxTeams?: number;
usedTeamSlots?: number;
structureSummary: string;
scoringPatternSummary?: string;
timingSummary: string;
scoring?: {
gameId: string;
gameName: string;
primaryChampionshipType: 'driver' | 'team' | 'nations' | 'trophy';
scoringPresetId: string;
scoringPresetName: string;
dropPolicySummary: string;
scoringPatternSummary: string;
};
}
export interface AllLeaguesWithCapacityAndScoringViewModel {
leagues: LeagueSummaryViewModel[];
totalCount: number;
}
export interface LeagueEnrichedData {
league: League;
usedDriverSlots: number;
season?: Season;
scoringConfig?: LeagueScoringConfig;
game?: Game;
preset?: LeagueScoringPresetOutputPort;
}
export interface IAllLeaguesWithCapacityAndScoringPresenter
extends Presenter<LeagueEnrichedData[], AllLeaguesWithCapacityAndScoringViewModel> {}

View File

@@ -1,34 +0,0 @@
import type { League } from '../../domain/entities/League';
import type { Presenter } from '@core/shared/presentation';
export interface LeagueWithCapacityViewModel {
id: string;
name: string;
description: string;
ownerId: string;
settings: {
maxDrivers: number;
sessionDuration?: number;
visibility?: string;
};
createdAt: string;
socialLinks?: {
discordUrl?: string;
youtubeUrl?: string;
websiteUrl?: string;
};
usedSlots: number;
}
export interface AllLeaguesWithCapacityViewModel {
leagues: LeagueWithCapacityViewModel[];
totalCount: number;
}
export interface AllLeaguesWithCapacityResultDTO {
leagues: League[];
memberCounts: Map<string, number>;
}
export interface IAllLeaguesWithCapacityPresenter
extends Presenter<AllLeaguesWithCapacityResultDTO, AllLeaguesWithCapacityViewModel> {}

View File

@@ -1,29 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export type AllRacesStatus = 'scheduled' | 'running' | 'completed' | 'cancelled' | 'all';
export interface AllRacesListItemViewModel {
id: string;
track: string;
car: string;
scheduledAt: string;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
leagueId: string;
leagueName: string;
strengthOfField: number | null;
}
export interface AllRacesFilterOptionsViewModel {
statuses: { value: AllRacesStatus; label: string }[];
leagues: { id: string; name: string }[];
}
export interface AllRacesPageViewModel {
races: AllRacesListItemViewModel[];
filters: AllRacesFilterOptionsViewModel;
}
export type AllRacesPageResultDTO = AllRacesPageViewModel;
export interface IAllRacesPagePresenter
extends Presenter<AllRacesPageResultDTO, AllRacesPageViewModel> {}

View File

@@ -1,34 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export interface TeamListItemViewModel {
id: string;
name: string;
tag: string;
description: string;
memberCount: number;
leagues: string[];
specialization?: 'endurance' | 'sprint' | 'mixed';
region?: string;
languages?: string[];
}
export interface AllTeamsViewModel {
teams: TeamListItemViewModel[];
totalCount: number;
}
export interface AllTeamsResultDTO {
teams: Array<{
id: string;
name: string;
tag: string;
description: string;
ownerId: string;
leagues: string[];
createdAt: Date;
memberCount: number;
}>;
}
export interface IAllTeamsPresenter
extends Presenter<AllTeamsResultDTO, AllTeamsViewModel> {}

View File

@@ -1,13 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface ApproveLeagueJoinRequestViewModel {
success: boolean;
message: string;
}
export interface ApproveLeagueJoinRequestResultPort {
success: boolean;
message: string;
}
export interface IApproveLeagueJoinRequestPresenter extends Presenter<ApproveLeagueJoinRequestResultPort, ApproveLeagueJoinRequestViewModel> {}

View File

@@ -1,17 +0,0 @@
export interface CompleteDriverOnboardingViewModel {
success: boolean;
driverId?: string;
errorMessage?: string;
}
export interface CompleteDriverOnboardingResultDTO {
success: boolean;
driverId?: string;
errorMessage?: string;
}
export interface ICompleteDriverOnboardingPresenter {
present(dto: CompleteDriverOnboardingResultDTO): void;
get viewModel(): CompleteDriverOnboardingViewModel;
reset(): void;
}

View File

@@ -1,15 +0,0 @@
import { Presenter } from './Presenter';
export interface CreateLeagueResultDTO {
leagueId: string;
seasonId: string;
scoringPresetId?: string;
scoringPresetName?: string;
}
export interface CreateLeagueViewModel {
leagueId: string;
success: boolean;
}
export interface ICreateLeaguePresenter extends Presenter<CreateLeagueResultDTO, CreateLeagueViewModel> {}

View File

@@ -1,20 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface SponsorDto {
id: string;
name: string;
contactEmail: string;
websiteUrl: string | undefined;
logoUrl: string | undefined;
createdAt: Date;
}
export interface CreateSponsorViewModel {
sponsor: SponsorDto;
}
export interface CreateSponsorOutputPort {
sponsor: SponsorDto;
}
export interface ICreateSponsorPresenter extends Presenter<CreateSponsorOutputPort, CreateSponsorViewModel> {}

View File

@@ -1,14 +0,0 @@
export interface DriverRegistrationStatusViewModel {
isRegistered: boolean;
raceId: string;
driverId: string;
}
export interface IDriverRegistrationStatusPresenter {
present(
isRegistered: boolean,
raceId: string,
driverId: string
): DriverRegistrationStatusViewModel;
getViewModel(): DriverRegistrationStatusViewModel;
}

View File

@@ -1,33 +0,0 @@
import type { Team } from '../../domain/entities/Team';
import type { TeamMembership } from '../../domain/types/TeamMembership';
import type { Presenter } from '@core/shared/presentation';
export interface DriverTeamViewModel {
team: {
id: string;
name: string;
tag: string;
description: string;
ownerId: string;
leagues: string[];
specialization?: 'endurance' | 'sprint' | 'mixed';
region?: string;
languages?: string[];
};
membership: {
role: 'owner' | 'manager' | 'member';
joinedAt: string;
isActive: boolean;
};
isOwner: boolean;
canManage: boolean;
}
export interface DriverTeamResultDTO {
team: Team;
membership: TeamMembership;
driverId: string;
}
export interface IDriverTeamPresenter
extends Presenter<DriverTeamResultDTO, DriverTeamViewModel> {}

View File

@@ -1,45 +0,0 @@
import type { Driver } from '../../domain/entities/Driver';
import type { SkillLevel } from '../../domain/services/SkillLevelService';
import type { Presenter } from '@core/shared/presentation';
export type { SkillLevel };
export interface DriverLeaderboardItemViewModel {
id: string;
name: string;
rating: number;
skillLevel: SkillLevel;
nationality: string;
racesCompleted: number;
wins: number;
podiums: number;
isActive: boolean;
rank: number;
avatarUrl: string;
}
export interface DriversLeaderboardViewModel {
drivers: DriverLeaderboardItemViewModel[];
totalRaces: number;
totalWins: number;
activeCount: number;
}
export interface DriversLeaderboardResultDTO {
drivers: Driver[];
rankings: Array<{ driverId: string; rating: number; overallRank: number | null }>;
stats: Record<
string,
{
rating: number;
wins: number;
podiums: number;
totalRaces: number;
overallRank: number | null;
}
>;
avatarUrls: Record<string, string>;
}
export interface IDriversLeaderboardPresenter
extends Presenter<DriversLeaderboardResultDTO, DriversLeaderboardViewModel> {}

View File

@@ -1,4 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
import type { GetEntitySponsorshipPricingResultDTO } from '../use-cases/GetEntitySponsorshipPricingUseCase';
export interface IEntitySponsorshipPricingPresenter extends Presenter<GetEntitySponsorshipPricingResultDTO | null, GetEntitySponsorshipPricingResultDTO | null> {}

View File

@@ -1,20 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface RaceViewModel {
id: string;
name: string;
date: string;
leagueName?: string;
}
export interface AllRacesPageViewModel {
races: RaceViewModel[];
totalCount: number;
}
export interface GetAllRacesResultDTO {
races: RaceViewModel[];
totalCount: number;
}
export interface IGetAllRacesPresenter extends Presenter<GetAllRacesResultDTO, AllRacesPageViewModel> {}

View File

@@ -1,13 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface GetLeagueAdminPermissionsViewModel {
canRemoveMember: boolean;
canUpdateRoles: boolean;
}
export interface GetLeagueAdminPermissionsResultDTO {
canRemoveMember: boolean;
canUpdateRoles: boolean;
}
export interface IGetLeagueAdminPermissionsPresenter extends Presenter<GetLeagueAdminPermissionsResultDTO, GetLeagueAdminPermissionsViewModel> {}

View File

@@ -1,13 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueAdminViewModel {
leagueId: string;
ownerId: string;
}
export interface GetLeagueAdminResultDTO {
leagueId: string;
ownerId: string;
}
export interface IGetLeagueAdminPresenter extends Presenter<GetLeagueAdminResultDTO, LeagueAdminViewModel> {}

View File

@@ -1,21 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueJoinRequestViewModel {
id: string;
leagueId: string;
driverId: string;
requestedAt: Date;
message: string;
driver: { id: string; name: string } | null;
}
export interface GetLeagueJoinRequestsViewModel {
joinRequests: LeagueJoinRequestViewModel[];
}
export interface GetLeagueJoinRequestsResultDTO {
joinRequests: unknown[];
drivers: { id: string; name: string }[];
}
export interface IGetLeagueJoinRequestsPresenter extends Presenter<GetLeagueJoinRequestsResultDTO, GetLeagueJoinRequestsViewModel> {}

View File

@@ -1,21 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueMembershipsViewModel {
members: {
driverId: string;
driver: { id: string; name: string };
role: string;
joinedAt: Date;
}[];
}
export interface GetLeagueMembershipsViewModel {
memberships: LeagueMembershipsViewModel;
}
export interface GetLeagueMembershipsResultDTO {
memberships: unknown[];
drivers: { id: string; name: string }[];
}
export interface IGetLeagueMembershipsPresenter extends Presenter<GetLeagueMembershipsResultDTO, GetLeagueMembershipsViewModel> {}

View File

@@ -1,17 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueOwnerSummaryViewModel {
driver: { id: string; name: string };
rating: number;
rank: number;
}
export interface GetLeagueOwnerSummaryViewModel {
summary: LeagueOwnerSummaryViewModel | null;
}
export interface GetLeagueOwnerSummaryResultDTO {
summary: LeagueOwnerSummaryViewModel | null;
}
export interface IGetLeagueOwnerSummaryPresenter extends Presenter<GetLeagueOwnerSummaryResultDTO, GetLeagueOwnerSummaryViewModel> {}

View File

@@ -1,15 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface GetLeagueProtestsViewModel {
protests: unknown[];
racesById: Record<string, any>;
driversById: Record<string, any>;
}
export interface GetLeagueProtestsResultDTO {
protests: unknown[];
races: unknown[];
drivers: { id: string; name: string }[];
}
export interface IGetLeagueProtestsPresenter extends Presenter<GetLeagueProtestsResultDTO, GetLeagueProtestsViewModel> {}

View File

@@ -1,19 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueScheduleViewModel {
races: Array<{
id: string;
name: string;
date: string;
}>;
}
export interface GetLeagueScheduleResultDTO {
races: Array<{
id: string;
name: string;
scheduledAt: Date;
}>;
}
export interface IGetLeagueSchedulePresenter extends Presenter<GetLeagueScheduleResultDTO, LeagueScheduleViewModel> {}

View File

@@ -1,21 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueSeasonSummaryViewModel {
seasonId: string;
name: string;
status: string;
startDate: Date;
endDate: Date;
isPrimary: boolean;
isParallelActive: boolean;
}
export interface GetLeagueSeasonsViewModel {
seasons: LeagueSeasonSummaryViewModel[];
}
export interface GetLeagueSeasonsResultDTO {
seasons: unknown[];
}
export interface IGetLeagueSeasonsPresenter extends Presenter<GetLeagueSeasonsResultDTO, GetLeagueSeasonsViewModel> {}

View File

@@ -1,20 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface SponsorDto {
id: string;
name: string;
contactEmail: string;
websiteUrl: string | undefined;
logoUrl: string | undefined;
createdAt: Date;
}
export interface GetSponsorsViewModel {
sponsors: SponsorDto[];
}
export interface GetSponsorsResultDTO {
sponsors: SponsorDto[];
}
export interface IGetSponsorsPresenter extends Presenter<GetSponsorsResultDTO, GetSponsorsViewModel> {}

View File

@@ -1,18 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface SponsorshipPricingItemDto {
id: string;
level: string;
price: number;
currency: string;
}
export interface GetSponsorshipPricingResultDTO {
pricing: SponsorshipPricingItemDto[];
}
export interface GetSponsorshipPricingViewModel {
pricing: SponsorshipPricingItemDto[];
}
export interface IGetSponsorshipPricingPresenter extends Presenter<GetSponsorshipPricingResultDTO, GetSponsorshipPricingViewModel> {}

View File

@@ -1,11 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface GetTotalLeaguesViewModel {
totalLeagues: number;
}
export interface GetTotalLeaguesResultDTO {
totalLeagues: number;
}
export interface IGetTotalLeaguesPresenter extends Presenter<GetTotalLeaguesResultDTO, GetTotalLeaguesViewModel> {}

View File

@@ -1,11 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface GetTotalRacesViewModel {
totalRaces: number;
}
export interface GetTotalRacesResultDTO {
totalRaces: number;
}
export interface IGetTotalRacesPresenter extends Presenter<GetTotalRacesResultDTO, GetTotalRacesViewModel> {}

View File

@@ -1,19 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface ImportRaceResultsSummaryViewModel {
success: boolean;
raceId: string;
driversProcessed: number;
resultsRecorded: number;
errors?: string[];
}
export interface ImportRaceResultsApiResultDTO {
success: boolean;
raceId: string;
driversProcessed: number;
resultsRecorded: number;
errors?: string[];
}
export interface IImportRaceResultsApiPresenter extends Presenter<ImportRaceResultsApiResultDTO, ImportRaceResultsSummaryViewModel> {}

View File

@@ -1,9 +0,0 @@
export interface ImportRaceResultsSummaryViewModel {
importedCount: number;
standingsRecalculated: boolean;
}
export interface IImportRaceResultsPresenter {
present(viewModel: ImportRaceResultsSummaryViewModel): ImportRaceResultsSummaryViewModel;
getViewModel(): ImportRaceResultsSummaryViewModel | null;
}

View File

@@ -1,13 +0,0 @@
import { Presenter } from './Presenter';
export interface JoinLeagueResultDTO {
id: string;
}
export interface JoinLeagueViewModel {
success: boolean;
membershipId?: string;
error?: string;
}
export interface IJoinLeaguePresenter extends Presenter<JoinLeagueResultDTO, JoinLeagueViewModel> {}

View File

@@ -1,43 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export interface LeagueDriverSeasonStatsItemViewModel {
leagueId: string;
driverId: string;
position: number;
driverName: string;
teamId?: string;
teamName?: string;
totalPoints: number;
basePoints: number;
penaltyPoints: number;
bonusPoints: number;
pointsPerRace: number;
racesStarted: number;
racesFinished: number;
dnfs: number;
noShows: number;
avgFinish: number | null;
rating: number | null;
ratingChange: number | null;
}
export interface LeagueDriverSeasonStatsViewModel {
leagueId: string;
stats: LeagueDriverSeasonStatsItemViewModel[];
}
export interface LeagueDriverSeasonStatsResultDTO {
leagueId: string;
standings: Array<{
driverId: string;
position: number;
points: number;
racesCompleted: number;
}>;
penalties: Map<string, { baseDelta: number; bonusDelta: number }>;
driverResults: Map<string, Array<{ position: number }>>;
driverRatings: Map<string, { rating: number | null; ratingChange: number | null }>;
}
export interface ILeagueDriverSeasonStatsPresenter
extends Presenter<LeagueDriverSeasonStatsResultDTO, LeagueDriverSeasonStatsViewModel> {}

View File

@@ -1,65 +0,0 @@
import type { League } from '../../domain/entities/League';
import type { Season } from '../../domain/entities/Season';
import type { LeagueScoringConfig } from '../../domain/entities/LeagueScoringConfig';
import type { Game } from '../../domain/entities/Game';
import type { Presenter } from '@core/shared/presentation';
export interface LeagueConfigFormViewModel {
leagueId: string;
basics: {
name: string;
description: string;
visibility: string;
gameId: string;
};
structure: {
mode: string;
maxDrivers: number;
maxTeams?: number;
driversPerTeam?: number;
multiClassEnabled: boolean;
};
championships: {
enableDriverChampionship: boolean;
enableTeamChampionship: boolean;
enableNationsChampionship: boolean;
enableTrophyChampionship: boolean;
};
scoring: {
patternId?: string;
customScoringEnabled: boolean;
};
dropPolicy: {
strategy: string;
n?: number;
};
timings: {
practiceMinutes: number;
qualifyingMinutes: number;
sprintRaceMinutes?: number;
mainRaceMinutes: number;
sessionCount: number;
roundsPlanned: number;
};
stewarding: {
decisionMode: string;
requireDefense: boolean;
defenseTimeLimit: number;
voteTimeLimit: number;
protestDeadlineHours: number;
stewardingClosesHours: number;
notifyAccusedOnProtest: boolean;
notifyOnVoteRequired: boolean;
requiredVotes?: number;
};
}
export interface LeagueFullConfigData {
league: League;
activeSeason?: Season;
scoringConfig?: LeagueScoringConfig;
game?: Game;
}
export interface ILeagueFullConfigPresenter
extends Presenter<LeagueFullConfigData, LeagueConfigFormViewModel> {}

View File

@@ -1,5 +0,0 @@
import type { LeagueSchedulePreviewDTO } from '../dto/LeagueScheduleDTO';
export interface ILeagueSchedulePreviewPresenter {
present(data: LeagueSchedulePreviewDTO): void;
}

View File

@@ -1,37 +0,0 @@
import type { ChampionshipConfig } from '../../domain/types/ChampionshipConfig';
import type { LeagueScoringPresetOutputPort } from '../ports/output/LeagueScoringPresetOutputPort';
import type { Presenter } from '@core/shared/presentation';
export interface LeagueScoringChampionshipViewModel {
id: string;
name: string;
type: string;
sessionTypes: string[];
pointsPreview: Array<{ sessionType: string; position: number; points: number }>;
bonusSummary: string[];
dropPolicyDescription: string;
}
export interface LeagueScoringConfigViewModel {
leagueId: string;
seasonId: string;
gameId: string;
gameName: string;
scoringPresetId?: string;
scoringPresetName?: string;
dropPolicySummary: string;
championships: LeagueScoringChampionshipViewModel[];
}
export interface LeagueScoringConfigData {
leagueId: string;
seasonId: string;
gameId: string;
gameName: string;
scoringPresetId?: string;
preset?: LeagueScoringPresetOutputPort;
championships: ChampionshipConfig[];
}
export interface ILeagueScoringConfigPresenter
extends Presenter<LeagueScoringConfigData, LeagueScoringConfigViewModel> {}

View File

@@ -1,14 +0,0 @@
import type { LeagueScoringPresetOutputPort } from '../ports/output/LeagueScoringPresetOutputPort';
import type { Presenter } from '@core/shared/presentation';
export interface LeagueScoringPresetsViewModel {
presets: LeagueScoringPresetOutputPort[];
totalCount: number;
}
export interface LeagueScoringPresetsResultDTO {
presets: LeagueScoringPresetOutputPort[];
}
export interface ILeagueScoringPresetsPresenter
extends Presenter<LeagueScoringPresetsResultDTO, LeagueScoringPresetsViewModel> {}

View File

@@ -1,21 +0,0 @@
import type { Standing } from '../../domain/entities/Standing';
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface StandingItemViewModel {
driverId: string;
driver: { id: string; name: string };
points: number;
rank: number;
}
export interface LeagueStandingsViewModel {
standings: StandingItemViewModel[];
}
export interface LeagueStandingsResultDTO {
standings: Standing[];
drivers: { id: string; name: string }[];
}
export interface ILeagueStandingsPresenter
extends Presenter<LeagueStandingsResultDTO, LeagueStandingsViewModel> {}

View File

@@ -1,16 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface LeagueStatsViewModel {
totalMembers: number;
totalRaces: number;
averageRating: number;
}
export interface LeagueStatsResultDTO {
totalMembers: number;
totalRaces: number;
averageRating: number;
}
export interface ILeagueStatsPresenter
extends Presenter<LeagueStatsResultDTO, LeagueStatsViewModel> {}

View File

@@ -1,7 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
import type { GetPendingSponsorshipRequestsResultDTO } from '../use-cases/GetPendingSponsorshipRequestsUseCase';
export type PendingSponsorshipRequestsViewModel = GetPendingSponsorshipRequestsResultDTO;
export interface IPendingSponsorshipRequestsPresenter
extends Presenter<GetPendingSponsorshipRequestsResultDTO, PendingSponsorshipRequestsViewModel> {}

View File

@@ -1,105 +0,0 @@
export interface ProfileOverviewDriverSummaryViewModel {
id: string;
name: string;
country: string;
avatarUrl: string;
iracingId: string | null;
joinedAt: string;
rating: number | null;
globalRank: number | null;
consistency: number | null;
bio: string | null;
totalDrivers: number | null;
}
export interface ProfileOverviewStatsViewModel {
totalRaces: number;
wins: number;
podiums: number;
dnfs: number;
avgFinish: number | null;
bestFinish: number | null;
worstFinish: number | null;
finishRate: number | null;
winRate: number | null;
podiumRate: number | null;
percentile: number | null;
rating: number | null;
consistency: number | null;
overallRank: number | null;
}
export interface ProfileOverviewFinishDistributionViewModel {
totalRaces: number;
wins: number;
podiums: number;
topTen: number;
dnfs: number;
other: number;
}
export interface ProfileOverviewTeamMembershipViewModel {
teamId: string;
teamName: string;
teamTag: string | null;
role: string;
joinedAt: string;
isCurrent: boolean;
}
export interface ProfileOverviewSocialFriendSummaryViewModel {
id: string;
name: string;
country: string;
avatarUrl: string;
}
export interface ProfileOverviewSocialSummaryViewModel {
friendsCount: number;
friends: ProfileOverviewSocialFriendSummaryViewModel[];
}
export type ProfileOverviewSocialPlatform = 'twitter' | 'youtube' | 'twitch' | 'discord';
export type ProfileOverviewAchievementRarity = 'common' | 'rare' | 'epic' | 'legendary';
export interface ProfileOverviewAchievementViewModel {
id: string;
title: string;
description: string;
icon: 'trophy' | 'medal' | 'star' | 'crown' | 'target' | 'zap';
rarity: ProfileOverviewAchievementRarity;
earnedAt: string;
}
export interface ProfileOverviewSocialHandleViewModel {
platform: ProfileOverviewSocialPlatform;
handle: string;
url: string;
}
export interface ProfileOverviewExtendedProfileViewModel {
socialHandles: ProfileOverviewSocialHandleViewModel[];
achievements: ProfileOverviewAchievementViewModel[];
racingStyle: string;
favoriteTrack: string;
favoriteCar: string;
timezone: string;
availableHours: string;
lookingForTeam: boolean;
openToRequests: boolean;
}
export interface ProfileOverviewViewModel {
currentDriver: ProfileOverviewDriverSummaryViewModel | null;
stats: ProfileOverviewStatsViewModel | null;
finishDistribution: ProfileOverviewFinishDistributionViewModel | null;
teamMemberships: ProfileOverviewTeamMembershipViewModel[];
socialSummary: ProfileOverviewSocialSummaryViewModel;
extendedProfile: ProfileOverviewExtendedProfileViewModel | null;
}
export interface IProfileOverviewPresenter {
present(viewModel: ProfileOverviewViewModel): void;
getViewModel(): ProfileOverviewViewModel | null;
}

View File

@@ -1,60 +0,0 @@
import type { SessionType, RaceStatus } from '../../domain/entities/Race';
import type { Presenter } from '@core/shared/presentation';
export interface RaceDetailEntryViewModel {
id: string;
name: string;
country: string;
avatarUrl: string;
rating: number | null;
isCurrentUser: boolean;
}
export interface RaceDetailUserResultViewModel {
position: number;
startPosition: number;
incidents: number;
fastestLap: number;
positionChange: number;
isPodium: boolean;
isClean: boolean;
ratingChange: number | null;
}
export interface RaceDetailRaceViewModel {
id: string;
leagueId: string;
track: string;
car: string;
scheduledAt: string;
sessionType: SessionType;
status: RaceStatus;
strengthOfField: number | null;
registeredCount?: number;
maxParticipants?: number;
}
export interface RaceDetailLeagueViewModel {
id: string;
name: string;
description: string;
settings: {
maxDrivers?: number;
qualifyingFormat?: string;
};
}
export interface RaceDetailViewModel {
race: RaceDetailRaceViewModel | null;
league: RaceDetailLeagueViewModel | null;
entryList: RaceDetailEntryViewModel[];
registration: {
isUserRegistered: boolean;
canRegister: boolean;
};
userResult: RaceDetailUserResultViewModel | null;
error?: string;
}
export interface IRaceDetailPresenter
extends Presenter<RaceDetailViewModel, RaceDetailViewModel> {}

View File

@@ -1,32 +0,0 @@
import type { Penalty, PenaltyType, PenaltyStatus } from '../../domain/entities/Penalty';
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface RacePenaltyViewModel {
id: string;
raceId: string;
driverId: string;
driverName: string;
type: PenaltyType;
value?: number;
reason: string;
protestId?: string;
issuedBy: string;
issuedByName: string;
status: PenaltyStatus;
description: string;
issuedAt: string;
appliedAt?: string;
notes?: string;
}
export interface RacePenaltiesViewModel {
penalties: RacePenaltyViewModel[];
}
export interface RacePenaltiesResultDTO {
penalties: Penalty[];
driverMap: Map<string, string>;
}
export interface IRacePenaltiesPresenter
extends Presenter<RacePenaltiesResultDTO, RacePenaltiesViewModel> {}

View File

@@ -1,32 +0,0 @@
import type { Protest, ProtestStatus, ProtestIncident } from '../../domain/entities/Protest';
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface RaceProtestViewModel {
id: string;
raceId: string;
protestingDriverId: string;
protestingDriverName: string;
accusedDriverId: string;
accusedDriverName: string;
incident: ProtestIncident;
comment?: string;
proofVideoUrl?: string;
status: ProtestStatus;
reviewedBy?: string;
reviewedByName?: string;
decisionNotes?: string;
filedAt: string;
reviewedAt?: string;
}
export interface RaceProtestsViewModel {
protests: RaceProtestViewModel[];
}
export interface RaceProtestsResultDTO {
protests: Protest[];
driverMap: Map<string, string>;
}
export interface IRaceProtestsPresenter
extends Presenter<RaceProtestsResultDTO, RaceProtestsViewModel> {}

View File

@@ -1,13 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export interface RaceRegistrationsViewModel {
registeredDriverIds: string[];
count: number;
}
export interface RaceRegistrationsResultDTO {
registeredDriverIds: string[];
}
export interface IRaceRegistrationsPresenter
extends Presenter<RaceRegistrationsResultDTO, RaceRegistrationsViewModel> {}

View File

@@ -1,39 +0,0 @@
import type { RaceStatus } from '../../domain/entities/Race';
import type { Result } from '../../domain/entities/Result';
import type { Driver } from '../../domain/entities/Driver';
import type { PenaltyType } from '../../domain/entities/Penalty';
import type { Presenter } from '@core/shared/presentation';
export interface RaceResultsHeaderViewModel {
id: string;
leagueId: string;
track: string;
scheduledAt: Date;
status: RaceStatus;
}
export interface RaceResultsLeagueViewModel {
id: string;
name: string;
}
export interface RaceResultsPenaltySummaryViewModel {
driverId: string;
type: PenaltyType;
value?: number;
}
export interface RaceResultsDetailViewModel {
race: RaceResultsHeaderViewModel | null;
league: RaceResultsLeagueViewModel | null;
results: Result[];
drivers: Driver[];
penalties: RaceResultsPenaltySummaryViewModel[];
pointsSystem?: Record<number, number>;
fastestLapTime?: number;
currentDriverId?: string;
error?: string;
}
export interface IRaceResultsDetailPresenter
extends Presenter<RaceResultsDetailViewModel, RaceResultsDetailViewModel> {}

View File

@@ -1,36 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export interface RaceWithSOFViewModel {
id: string;
leagueId: string;
scheduledAt: string;
track: string;
trackId: string;
car: string;
carId: string;
sessionType: string;
status: string;
strengthOfField: number | null;
registeredCount: number;
maxParticipants: number;
participantCount: number;
}
export interface RaceWithSOFResultDTO {
raceId: string;
leagueId: string;
scheduledAt: Date;
track: string;
trackId: string;
car: string;
carId: string;
sessionType: string;
status: string;
strengthOfField: number | null;
registeredCount: number;
maxParticipants: number;
participantCount: number;
}
export interface IRaceWithSOFPresenter
extends Presenter<RaceWithSOFResultDTO, RaceWithSOFViewModel> {}

View File

@@ -1,35 +0,0 @@
import type { Presenter } from '@core/shared/presentation';
export interface RaceListItemViewModel {
id: string;
track: string;
car: string;
scheduledAt: string;
status: 'scheduled' | 'running' | 'completed' | 'cancelled';
leagueId: string;
leagueName: string;
strengthOfField: number | null;
isUpcoming: boolean;
isLive: boolean;
isPast: boolean;
}
export interface RacesPageViewModel {
races: RaceListItemViewModel[];
stats: {
total: number;
scheduled: number;
running: number;
completed: number;
};
liveRaces: RaceListItemViewModel[];
upcomingThisWeek: RaceListItemViewModel[];
recentResults: RaceListItemViewModel[];
}
export interface RacesPageResultDTO {
races: unknown[];
}
export interface IRacesPagePresenter
extends Presenter<RacesPageResultDTO, RacesPageViewModel> {}

View File

@@ -1,13 +0,0 @@
import type { Presenter } from '@core/shared/presentation/Presenter';
export interface RejectLeagueJoinRequestViewModel {
success: boolean;
message: string;
}
export interface RejectLeagueJoinRequestResultDTO {
success: boolean;
message: string;
}
export interface IRejectLeagueJoinRequestPresenter extends Presenter<RejectLeagueJoinRequestResultDTO, RejectLeagueJoinRequestViewModel> {}

View File

@@ -1,11 +0,0 @@
import { Presenter } from './Presenter';
export interface RemoveLeagueMemberResultDTO {
success: boolean;
}
export interface RemoveLeagueMemberViewModel {
success: boolean;
}
export interface IRemoveLeagueMemberPresenter extends Presenter<RemoveLeagueMemberResultDTO, RemoveLeagueMemberViewModel> {}

View File

@@ -1,7 +0,0 @@
import type { SponsorDashboardDTO } from '../use-cases/GetSponsorDashboardUseCase';
import type { Presenter } from '@core/shared/presentation';
export type SponsorDashboardViewModel = SponsorDashboardDTO | null;
export interface ISponsorDashboardPresenter
extends Presenter<SponsorDashboardDTO | null, SponsorDashboardViewModel> {}

View File

@@ -1,7 +0,0 @@
import type { SponsorSponsorshipsDTO } from '../use-cases/GetSponsorSponsorshipsUseCase';
import type { Presenter } from '@core/shared/presentation';
export type SponsorSponsorshipsViewModel = SponsorSponsorshipsDTO | null;
export interface ISponsorSponsorshipsPresenter
extends Presenter<SponsorSponsorshipsDTO | null, SponsorSponsorshipsViewModel> {}

View File

@@ -1,30 +0,0 @@
import type { Team } from '../../domain/entities/Team';
import type { TeamMembership } from '../../domain/types/TeamMembership';
import type { Presenter } from '@core/shared/presentation';
export interface TeamDetailsViewModel {
team: {
id: string;
name: string;
tag: string;
description: string;
ownerId: string;
leagues: string[];
createdAt: string;
};
membership: {
role: 'owner' | 'manager' | 'member';
joinedAt: string;
isActive: boolean;
} | null;
canManage: boolean;
}
export interface TeamDetailsResultDTO {
team: Team;
membership: TeamMembership | null;
driverId: string;
}
export interface ITeamDetailsPresenter
extends Presenter<TeamDetailsResultDTO, TeamDetailsViewModel> {}

Some files were not shown because too many files have changed in this diff Show More