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

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

View File

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

View File

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

View File

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

View File

@@ -1,9 +0,0 @@
/**
* 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 CloseRaceEventStewardingCommand {
// No parameters needed - finds all expired events automatically
}

View File

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

View File

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

View File

@@ -1,21 +0,0 @@
import type { LeagueVisibilityInput } from './LeagueVisibilityInput';
export interface CreateLeagueWithSeasonAndScoringCommand {
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

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

View File

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

View File

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

View File

@@ -1,10 +0,0 @@
import type { ProtestIncident } from '../../domain/entities/Protest';
export interface FileProtestCommand {
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
incident: ProtestIncident;
comment?: string;
proofVideoUrl?: string;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,10 @@
import type { LeagueVisibilityType } from '../../domain/value-objects/LeagueVisibility';
import type { StewardingDecisionMode } from '../../domain/entities/League';
import type { LeagueVisibilityType } from '../../domain/value-objects/LeagueVisibility';
export type LeagueStructureMode = 'solo' | 'fixedTeams';
// TODO this is way too much for a DTO. it must be pure InputPort or OutputPort
/**
* League visibility determines public visibility and ranking status.
* - 'ranked': Public, competitive, affects driver ratings. Requires min 10 drivers.

View File

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

View File

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

View File

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

View File

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

View File

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