wip
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export interface TeamListItemViewModel {
|
||||
id: string;
|
||||
@@ -17,6 +18,9 @@ export interface AllTeamsViewModel {
|
||||
totalCount: number;
|
||||
}
|
||||
|
||||
export interface IAllTeamsPresenter {
|
||||
present(teams: Team[]): AllTeamsViewModel;
|
||||
}
|
||||
export interface AllTeamsResultDTO {
|
||||
teams: Array<Team & { memberCount: number }>;
|
||||
}
|
||||
|
||||
export interface IAllTeamsPresenter
|
||||
extends Presenter<AllTeamsResultDTO, AllTeamsViewModel> {}
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { Team } from '../../domain/entities/Team';
|
||||
import type { TeamMembership } from '../../domain/types/TeamMembership';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export interface DriverTeamViewModel {
|
||||
team: {
|
||||
@@ -22,10 +23,11 @@ export interface DriverTeamViewModel {
|
||||
canManage: boolean;
|
||||
}
|
||||
|
||||
export interface IDriverTeamPresenter {
|
||||
present(
|
||||
team: Team,
|
||||
membership: TeamMembership,
|
||||
driverId: string
|
||||
): DriverTeamViewModel;
|
||||
}
|
||||
export interface DriverTeamResultDTO {
|
||||
team: Team;
|
||||
membership: TeamMembership;
|
||||
driverId: string;
|
||||
}
|
||||
|
||||
export interface IDriverTeamPresenter
|
||||
extends Presenter<DriverTeamResultDTO, DriverTeamViewModel> {}
|
||||
@@ -31,4 +31,6 @@ export interface IDriversLeaderboardPresenter {
|
||||
stats: Record<string, { rating: number; wins: number; podiums: number; totalRaces: number; overallRank: number }>,
|
||||
avatarUrls: Record<string, string>
|
||||
): DriversLeaderboardViewModel;
|
||||
|
||||
getViewModel(): DriversLeaderboardViewModel;
|
||||
}
|
||||
@@ -37,4 +37,5 @@ export interface ILeagueDriverSeasonStatsPresenter {
|
||||
driverResults: Map<string, Array<{ position: number }>>,
|
||||
driverRatings: Map<string, { rating: number | null; ratingChange: number | null }>
|
||||
): LeagueDriverSeasonStatsViewModel;
|
||||
getViewModel(): LeagueDriverSeasonStatsViewModel;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ 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 '@gridpilot/shared/presentation';
|
||||
|
||||
export interface LeagueConfigFormViewModel {
|
||||
leagueId: string;
|
||||
@@ -49,6 +50,7 @@ export interface LeagueConfigFormViewModel {
|
||||
stewardingClosesHours: number;
|
||||
notifyAccusedOnProtest: boolean;
|
||||
notifyOnVoteRequired: boolean;
|
||||
requiredVotes?: number;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,6 +61,5 @@ export interface LeagueFullConfigData {
|
||||
game?: Game;
|
||||
}
|
||||
|
||||
export interface ILeagueFullConfigPresenter {
|
||||
present(data: LeagueFullConfigData): LeagueConfigFormViewModel;
|
||||
}
|
||||
export interface ILeagueFullConfigPresenter
|
||||
extends Presenter<LeagueFullConfigData, LeagueConfigFormViewModel> {}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChampionshipConfig } from '../../domain/value-objects/ChampionshipConfig';
|
||||
import type { ChampionshipConfig } from '../../domain/types/ChampionshipConfig';
|
||||
import type { LeagueScoringPresetDTO } from '../ports/LeagueScoringPresetProvider';
|
||||
|
||||
export interface LeagueScoringChampionshipViewModel {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import type { LeagueScoringPresetDTO } from '../ports/LeagueScoringPresetProvider';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export interface LeagueScoringPresetsViewModel {
|
||||
presets: LeagueScoringPresetDTO[];
|
||||
totalCount: number;
|
||||
}
|
||||
|
||||
export interface ILeagueScoringPresetsPresenter {
|
||||
present(presets: LeagueScoringPresetDTO[]): LeagueScoringPresetsViewModel;
|
||||
}
|
||||
export interface LeagueScoringPresetsResultDTO {
|
||||
presets: LeagueScoringPresetDTO[];
|
||||
}
|
||||
|
||||
export interface ILeagueScoringPresetsPresenter
|
||||
extends Presenter<LeagueScoringPresetsResultDTO, LeagueScoringPresetsViewModel> {}
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Standing } from '../../domain/entities/Standing';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation/Presenter';
|
||||
|
||||
export interface StandingItemViewModel {
|
||||
id: string;
|
||||
@@ -17,6 +18,9 @@ export interface LeagueStandingsViewModel {
|
||||
standings: StandingItemViewModel[];
|
||||
}
|
||||
|
||||
export interface ILeagueStandingsPresenter {
|
||||
present(standings: Standing[]): LeagueStandingsViewModel;
|
||||
}
|
||||
export interface LeagueStandingsResultDTO {
|
||||
standings: Standing[];
|
||||
}
|
||||
|
||||
export interface ILeagueStandingsPresenter
|
||||
extends Presenter<LeagueStandingsResultDTO, LeagueStandingsViewModel> {}
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
import type { GetPendingSponsorshipRequestsResultDTO } from '../use-cases/GetPendingSponsorshipRequestsUseCase';
|
||||
|
||||
export interface IPendingSponsorshipRequestsPresenter {
|
||||
present(data: GetPendingSponsorshipRequestsResultDTO): void;
|
||||
}
|
||||
export type PendingSponsorshipRequestsViewModel = GetPendingSponsorshipRequestsResultDTO;
|
||||
|
||||
export interface IPendingSponsorshipRequestsPresenter
|
||||
extends Presenter<GetPendingSponsorshipRequestsResultDTO, PendingSponsorshipRequestsViewModel> {}
|
||||
@@ -9,6 +9,7 @@ export interface ProfileOverviewDriverSummaryViewModel {
|
||||
globalRank: number | null;
|
||||
consistency: number | null;
|
||||
bio: string | null;
|
||||
totalDrivers: number | null;
|
||||
}
|
||||
|
||||
export interface ProfileOverviewStatsViewModel {
|
||||
@@ -23,6 +24,9 @@ export interface ProfileOverviewStatsViewModel {
|
||||
winRate: number | null;
|
||||
podiumRate: number | null;
|
||||
percentile: number | null;
|
||||
rating: number | null;
|
||||
consistency: number | null;
|
||||
overallRank: number | null;
|
||||
}
|
||||
|
||||
export interface ProfileOverviewFinishDistributionViewModel {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { PenaltyType, PenaltyStatus } from '../../domain/entities/Penalty';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation/Presenter';
|
||||
|
||||
export interface RacePenaltyViewModel {
|
||||
id: string;
|
||||
@@ -22,23 +23,24 @@ export interface RacePenaltiesViewModel {
|
||||
penalties: RacePenaltyViewModel[];
|
||||
}
|
||||
|
||||
export interface IRacePenaltiesPresenter {
|
||||
present(
|
||||
penalties: Array<{
|
||||
id: string;
|
||||
raceId: string;
|
||||
driverId: string;
|
||||
type: PenaltyType;
|
||||
value?: number;
|
||||
reason: string;
|
||||
protestId?: string;
|
||||
issuedBy: string;
|
||||
status: PenaltyStatus;
|
||||
issuedAt: Date;
|
||||
appliedAt?: Date;
|
||||
notes?: string;
|
||||
getDescription(): string;
|
||||
}>,
|
||||
driverMap: Map<string, string>
|
||||
): RacePenaltiesViewModel;
|
||||
}
|
||||
export interface RacePenaltiesResultDTO {
|
||||
penalties: Array<{
|
||||
id: string;
|
||||
raceId: string;
|
||||
driverId: string;
|
||||
type: PenaltyType;
|
||||
value?: number;
|
||||
reason: string;
|
||||
protestId?: string;
|
||||
issuedBy: string;
|
||||
status: PenaltyStatus;
|
||||
issuedAt: Date;
|
||||
appliedAt?: Date;
|
||||
notes?: string;
|
||||
getDescription(): string;
|
||||
}>;
|
||||
driverMap: Map<string, string>;
|
||||
}
|
||||
|
||||
export interface IRacePenaltiesPresenter
|
||||
extends Presenter<RacePenaltiesResultDTO, RacePenaltiesViewModel> {}
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { ProtestStatus, ProtestIncident } from '../../domain/entities/Protest';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation/Presenter';
|
||||
|
||||
export interface RaceProtestViewModel {
|
||||
id: string;
|
||||
@@ -22,22 +23,23 @@ export interface RaceProtestsViewModel {
|
||||
protests: RaceProtestViewModel[];
|
||||
}
|
||||
|
||||
export interface IRaceProtestsPresenter {
|
||||
present(
|
||||
protests: Array<{
|
||||
id: string;
|
||||
raceId: string;
|
||||
protestingDriverId: string;
|
||||
accusedDriverId: string;
|
||||
incident: ProtestIncident;
|
||||
comment?: string;
|
||||
proofVideoUrl?: string;
|
||||
status: ProtestStatus;
|
||||
reviewedBy?: string;
|
||||
decisionNotes?: string;
|
||||
filedAt: Date;
|
||||
reviewedAt?: Date;
|
||||
}>,
|
||||
driverMap: Map<string, string>
|
||||
): RaceProtestsViewModel;
|
||||
}
|
||||
export interface RaceProtestsResultDTO {
|
||||
protests: Array<{
|
||||
id: string;
|
||||
raceId: string;
|
||||
protestingDriverId: string;
|
||||
accusedDriverId: string;
|
||||
incident: ProtestIncident;
|
||||
comment?: string;
|
||||
proofVideoUrl?: string;
|
||||
status: ProtestStatus;
|
||||
reviewedBy?: string;
|
||||
decisionNotes?: string;
|
||||
filedAt: Date;
|
||||
reviewedAt?: Date;
|
||||
}>;
|
||||
driverMap: Map<string, string>;
|
||||
}
|
||||
|
||||
export interface IRaceProtestsPresenter
|
||||
extends Presenter<RaceProtestsResultDTO, RaceProtestsViewModel> {}
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { TeamJoinRequest } from '../../domain/types/TeamMembership';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export interface TeamJoinRequestViewModel {
|
||||
requestId: string;
|
||||
@@ -16,10 +17,11 @@ export interface TeamJoinRequestsViewModel {
|
||||
totalCount: number;
|
||||
}
|
||||
|
||||
export interface ITeamJoinRequestsPresenter {
|
||||
present(
|
||||
requests: TeamJoinRequest[],
|
||||
driverNames: Record<string, string>,
|
||||
avatarUrls: Record<string, string>
|
||||
): TeamJoinRequestsViewModel;
|
||||
}
|
||||
export interface TeamJoinRequestsResultDTO {
|
||||
requests: TeamJoinRequest[];
|
||||
driverNames: Record<string, string>;
|
||||
avatarUrls: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ITeamJoinRequestsPresenter
|
||||
extends Presenter<TeamJoinRequestsResultDTO, TeamJoinRequestsViewModel> {}
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { TeamMembership } from '../../domain/types/TeamMembership';
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export interface TeamMemberViewModel {
|
||||
driverId: string;
|
||||
@@ -17,10 +18,11 @@ export interface TeamMembersViewModel {
|
||||
memberCount: number;
|
||||
}
|
||||
|
||||
export interface ITeamMembersPresenter {
|
||||
present(
|
||||
memberships: TeamMembership[],
|
||||
driverNames: Record<string, string>,
|
||||
avatarUrls: Record<string, string>
|
||||
): TeamMembersViewModel;
|
||||
}
|
||||
export interface TeamMembersResultDTO {
|
||||
memberships: TeamMembership[];
|
||||
driverNames: Record<string, string>;
|
||||
avatarUrls: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ITeamMembersPresenter
|
||||
extends Presenter<TeamMembersResultDTO, TeamMembersViewModel> {}
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { Presenter } from '@gridpilot/shared/presentation';
|
||||
|
||||
export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';
|
||||
|
||||
export interface TeamLeaderboardItemViewModel {
|
||||
@@ -29,7 +31,10 @@ export interface TeamsLeaderboardViewModel {
|
||||
topTeams: TeamLeaderboardItemViewModel[];
|
||||
}
|
||||
|
||||
export interface ITeamsLeaderboardPresenter {
|
||||
present(teams: any[], recruitingCount: number): void;
|
||||
getViewModel(): TeamsLeaderboardViewModel;
|
||||
}
|
||||
export interface TeamsLeaderboardResultDTO {
|
||||
teams: unknown[];
|
||||
recruitingCount: number;
|
||||
}
|
||||
|
||||
export interface ITeamsLeaderboardPresenter
|
||||
extends Presenter<TeamsLeaderboardResultDTO, TeamsLeaderboardViewModel> {}
|
||||
Reference in New Issue
Block a user