website cleanup
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNotEmpty, IsOptional, IsUrl } from 'class-validator';
|
||||
import { IsNotEmpty, IsOptional, IsString, IsUrl, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { ProtestIncidentDTO } from './ProtestIncidentDTO';
|
||||
|
||||
export class FileProtestCommandDTO {
|
||||
@ApiProperty()
|
||||
@@ -18,11 +20,9 @@ export class FileProtestCommandDTO {
|
||||
accusedDriverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
incident!: {
|
||||
lap: number;
|
||||
description: string;
|
||||
timeInRace?: number;
|
||||
};
|
||||
@ValidateNested()
|
||||
@Type(() => ProtestIncidentDTO)
|
||||
incident!: ProtestIncidentDTO;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@@ -34,4 +34,4 @@ export class FileProtestCommandDTO {
|
||||
@IsString()
|
||||
@IsUrl()
|
||||
proofVideoUrl?: string;
|
||||
}
|
||||
}
|
||||
|
||||
21
apps/api/src/domain/race/dtos/ProtestIncidentDTO.ts
Normal file
21
apps/api/src/domain/race/dtos/ProtestIncidentDTO.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
|
||||
|
||||
export class ProtestIncidentDTO {
|
||||
@ApiProperty()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
lap!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
description!: string;
|
||||
|
||||
@ApiProperty({ required: false, description: 'Seconds from race start' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
timeInRace?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user