resolve manual DTOs
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
|
||||
export class GetLeagueRacesOutputDTO {
|
||||
@ApiProperty({ type: [RaceDTO] })
|
||||
races: RaceDTO[];
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { SponsorshipDetailDTO } from '../../sponsor/dtos/SponsorshipDetailDTO';
|
||||
|
||||
export class GetSeasonSponsorshipsOutputDTO {
|
||||
@ApiProperty({ type: [SponsorshipDetailDTO] })
|
||||
sponsorships: SponsorshipDetailDTO[];
|
||||
}
|
||||
28
apps/api/src/domain/league/dtos/LeagueMembershipDTO.ts
Normal file
28
apps/api/src/domain/league/dtos/LeagueMembershipDTO.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
|
||||
export class LeagueMembershipDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
driverId: string;
|
||||
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
role: 'owner' | 'admin' | 'steward' | 'member';
|
||||
|
||||
@ApiProperty({ enum: ['active', 'inactive', 'pending'] })
|
||||
@IsEnum(['active', 'inactive', 'pending'])
|
||||
status: 'active' | 'inactive' | 'pending';
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
joinedAt: string;
|
||||
}
|
||||
8
apps/api/src/domain/league/dtos/LeagueRoleDTO.ts
Normal file
8
apps/api/src/domain/league/dtos/LeagueRoleDTO.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
|
||||
export class LeagueRoleDTO {
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
value: 'owner' | 'admin' | 'steward' | 'member';
|
||||
}
|
||||
32
apps/api/src/domain/league/dtos/LeagueScoringPresetDTO.ts
Normal file
32
apps/api/src/domain/league/dtos/LeagueScoringPresetDTO.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsEnum } from 'class-validator';
|
||||
|
||||
export class LeagueScoringPresetDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
@ApiProperty({ enum: ['driver', 'team', 'nations', 'trophy'] })
|
||||
@IsEnum(['driver', 'team', 'nations', 'trophy'])
|
||||
primaryChampionshipType: 'driver' | 'team' | 'nations' | 'trophy';
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sessionSummary: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bonusSummary: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
dropPolicySummary: string;
|
||||
}
|
||||
8
apps/api/src/domain/league/dtos/MembershipRoleDTO.ts
Normal file
8
apps/api/src/domain/league/dtos/MembershipRoleDTO.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
|
||||
export class MembershipRoleDTO {
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
value: 'owner' | 'admin' | 'steward' | 'member';
|
||||
}
|
||||
8
apps/api/src/domain/league/dtos/MembershipStatusDTO.ts
Normal file
8
apps/api/src/domain/league/dtos/MembershipStatusDTO.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
|
||||
export class MembershipStatusDTO {
|
||||
@ApiProperty({ enum: ['active', 'inactive', 'pending'] })
|
||||
@IsEnum(['active', 'inactive', 'pending'])
|
||||
value: 'active' | 'inactive' | 'pending';
|
||||
}
|
||||
92
apps/api/src/domain/league/dtos/WizardErrorsDTO.ts
Normal file
92
apps/api/src/domain/league/dtos/WizardErrorsDTO.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
class WizardErrorsBasicsDTO {
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
name?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
visibility?: string;
|
||||
}
|
||||
|
||||
class WizardErrorsStructureDTO {
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
maxDrivers?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
maxTeams?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
driversPerTeam?: string;
|
||||
}
|
||||
|
||||
class WizardErrorsTimingsDTO {
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
qualifyingMinutes?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mainRaceMinutes?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
roundsPlanned?: string;
|
||||
}
|
||||
|
||||
class WizardErrorsScoringDTO {
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
patternId?: string;
|
||||
}
|
||||
|
||||
export class WizardErrorsDTO {
|
||||
@ApiProperty({ type: WizardErrorsBasicsDTO, required: false })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => WizardErrorsBasicsDTO)
|
||||
basics?: WizardErrorsBasicsDTO;
|
||||
|
||||
@ApiProperty({ type: WizardErrorsStructureDTO, required: false })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => WizardErrorsStructureDTO)
|
||||
structure?: WizardErrorsStructureDTO;
|
||||
|
||||
@ApiProperty({ type: WizardErrorsTimingsDTO, required: false })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => WizardErrorsTimingsDTO)
|
||||
timings?: WizardErrorsTimingsDTO;
|
||||
|
||||
@ApiProperty({ type: WizardErrorsScoringDTO, required: false })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => WizardErrorsScoringDTO)
|
||||
scoring?: WizardErrorsScoringDTO;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
submit?: string;
|
||||
}
|
||||
8
apps/api/src/domain/league/dtos/WizardStepDTO.ts
Normal file
8
apps/api/src/domain/league/dtos/WizardStepDTO.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
|
||||
export class WizardStepDTO {
|
||||
@ApiProperty({ enum: [1, 2, 3, 4, 5, 6, 7] })
|
||||
@IsEnum([1, 2, 3, 4, 5, 6, 7])
|
||||
value: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
}
|
||||
Reference in New Issue
Block a user