refactor dtos to ports

This commit is contained in:
2025-12-19 15:07:53 +01:00
parent 499562c456
commit 8116fe888f
46 changed files with 718 additions and 266 deletions

View File

@@ -1,5 +1,3 @@
import type { LeagueVisibilityInput } from '../../dtos/LeagueVisibilityInput';
export interface CreateLeagueWithSeasonAndScoringInputPort {
name: string;
description?: string;
@@ -8,7 +6,7 @@ export interface CreateLeagueWithSeasonAndScoringInputPort {
* - 'ranked' (or legacy 'public'): Competitive, public, affects ratings. Requires min 10 drivers.
* - 'unranked' (or legacy 'private'): Casual with friends, no rating impact.
*/
visibility: LeagueVisibilityInput;
visibility: 'ranked' | 'unranked' | 'public' | 'private';
ownerId: string;
gameId: string;
maxDrivers?: number;

View File

@@ -1,10 +1,14 @@
import { ProtestIncident } from "@/racing/domain/entities/ProtestIncident";
export interface FileProtestInputPort {
raceId: string;
protestingDriverId: string;
accusedDriverId: string;
incident: ProtestIncident;
incident: {
sessionType: string;
lapNumber: number;
cornerNumber?: number;
description: string;
severity: 'minor' | 'major' | 'severe';
};
comment?: string;
proofVideoUrl?: string;
}

View File

@@ -1,6 +1,4 @@
import type { SponsorableEntityType } from '../../../domain/entities/SponsorshipRequest';
export interface GetEntitySponsorshipPricingInputPort {
entityType: SponsorableEntityType;
entityType: 'league' | 'team' | 'driver';
entityId: string;
}

View File

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

View File

@@ -3,4 +3,6 @@
* - 'ranked' (or legacy 'public'): Competitive, public, affects driver ratings. Min 10 drivers.
* - 'unranked' (or legacy 'private'): Casual with friends, no rating impact.
*/
export type LeagueVisibilityInputPort = 'ranked' | 'unranked' | 'public' | 'private';
export interface LeagueVisibilityInputPort {
visibility: 'ranked' | 'unranked' | 'public' | 'private';
}

View File

@@ -1,8 +1,3 @@
export interface IsDriverRegisteredForRaceInputPort {
raceId: string;
driverId: string;
}
export interface GetRaceRegistrationsInputPort {
raceId: string;
}

View File

@@ -1,7 +1,8 @@
import type { Money } from '../../domain/value-objects/Money';
export interface RefundPaymentInputPort {
originalTransactionId: string;
amount: Money;
amount: {
value: number;
currency: string;
};
reason: string;
}

View File

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