refactor core presenters

This commit is contained in:
2025-12-19 19:42:19 +01:00
parent 8116fe888f
commit 94fc538f44
228 changed files with 2817 additions and 3097 deletions

View File

@@ -1,16 +1,43 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsArray, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { LeagueWithCapacityDTO } from './LeagueWithCapacityDTO';
export class LeagueWithCapacityDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
description!: string;
@ApiProperty()
ownerId!: string;
@ApiProperty()
settings!: {
maxDrivers: number;
sessionDuration?: number;
visibility?: string;
};
@ApiProperty()
createdAt!: string;
@ApiProperty({ nullable: true })
socialLinks?: {
discordUrl?: string;
youtubeUrl?: string;
websiteUrl?: string;
};
@ApiProperty()
usedSlots!: number;
}
export class AllLeaguesWithCapacityDTO {
@ApiProperty({ type: [LeagueWithCapacityDTO] })
@IsArray()
@ValidateNested({ each: true })
@Type(() => LeagueWithCapacityDTO)
leagues: LeagueWithCapacityDTO[];
leagues!: LeagueWithCapacityDTO[];
@ApiProperty()
@IsNumber()
totalCount: number;
totalCount!: number;
}