refactor dtos to ports

This commit is contained in:
2025-12-19 13:07:38 +01:00
parent 08ec2af5bf
commit 2ab86ec9bd
42 changed files with 83 additions and 81 deletions

View File

@@ -0,0 +1,4 @@
export interface AcceptSponsorshipInputPort {
requestId: string;
respondedBy: string; // driverId of the person accepting
}

View File

@@ -0,0 +1,4 @@
export interface ApproveLeagueJoinRequestInputPort {
leagueId: string;
requestId: string;
}

View File

@@ -0,0 +1,4 @@
export interface ApproveTeamJoinRequestInputPort {
teamId: string;
requestId: string;
}

View File

@@ -0,0 +1,3 @@
export interface CancelRaceInputPort {
raceId: string;
}

View File

@@ -0,0 +1,9 @@
/**
* Command for closing race event stewarding.
*
* Scheduled job that checks for race events with expired stewarding windows
* and closes them, triggering final results notifications.
*/
export interface CloseRaceEventStewardingInputPort {
// No parameters needed - finds all expired events automatically
}

View File

@@ -0,0 +1,9 @@
export interface CompleteDriverOnboardingInputPort {
userId: string;
firstName: string;
lastName: string;
displayName: string;
country: string;
timezone?: string;
bio?: string;
}

View File

@@ -0,0 +1,3 @@
export interface CompleteRaceInputPort {
raceId: string;
}

View File

@@ -0,0 +1,21 @@
import type { LeagueVisibilityInput } from '../../dtos/LeagueVisibilityInput';
export interface CreateLeagueWithSeasonAndScoringInputPort {
name: string;
description?: string;
/**
* League visibility/ranking mode.
* - 'ranked' (or legacy 'public'): Competitive, public, affects ratings. Requires min 10 drivers.
* - 'unranked' (or legacy 'private'): Casual with friends, no rating impact.
*/
visibility: LeagueVisibilityInput;
ownerId: string;
gameId: string;
maxDrivers?: number;
maxTeams?: number;
enableDriverChampionship: boolean;
enableTeamChampionship: boolean;
enableNationsChampionship: boolean;
enableTrophyChampionship: boolean;
scoringPresetId?: string;
}

View File

@@ -0,0 +1,6 @@
export interface CreateSponsorInputPort {
name: string;
contactEmail: string;
websiteUrl?: string;
logoUrl?: string;
}

View File

@@ -0,0 +1,7 @@
export interface CreateTeamInputPort {
name: string;
tag: string;
description: string;
ownerId: string;
leagues: string[];
}

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
import { ProtestIncident } from "@/racing/domain/entities/ProtestIncident";
export interface FileProtestInputPort {
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
incident: ProtestIncident;
comment?: string;
proofVideoUrl?: string;
}

View File

@@ -0,0 +1,4 @@
export interface JoinLeagueInputPort {
leagueId: string;
driverId: string;
}

View File

@@ -0,0 +1,4 @@
export interface JoinTeamInputPort {
teamId: string;
driverId: string;
}

View File

@@ -0,0 +1,3 @@
export interface LeagueJoinRequestsInputPort {
leagueId: string;
}

View File

@@ -0,0 +1,4 @@
export interface LeaveTeamInputPort {
teamId: string;
driverId: string;
}

View File

@@ -0,0 +1,5 @@
export interface RegisterForRaceInputPort {
raceId: string;
leagueId: string;
driverId: string;
}

View File

@@ -0,0 +1,3 @@
export interface RejectTeamJoinRequestInputPort {
requestId: string;
}

View File

@@ -0,0 +1,4 @@
export interface TeamDetailsInputPort {
teamId: string;
driverId: string;
}

View File

@@ -0,0 +1,3 @@
export interface TeamJoinRequestsInputPort {
teamId: string;
}

View File

@@ -0,0 +1,3 @@
export interface TeamMembersInputPort {
teamId: string;
}

View File

@@ -0,0 +1,7 @@
import type { Team } from '../../../domain/entities/Team';
export interface UpdateTeamInputPort {
teamId: string;
updates: Partial<Pick<Team, 'name' | 'tag' | 'description' | 'leagues'>>;
updatedBy: string;
}

View File

@@ -0,0 +1,4 @@
export interface WithdrawFromRaceInputPort {
raceId: string;
driverId: string;
}