move static data

This commit is contained in:
2025-12-26 00:20:53 +01:00
parent c977defd6a
commit b6cbb81388
63 changed files with 1482 additions and 418 deletions

View File

@@ -1,5 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, IsOptional, IsNumber, IsEnum } from 'class-validator';
import { PENALTY_TYPE_VALUES } from '@core/racing/domain/entities/penalty/PenaltyType';
export class ApplyPenaltyCommandDTO {
@ApiProperty()
@@ -17,30 +18,8 @@ export class ApplyPenaltyCommandDTO {
@IsNotEmpty()
stewardId!: string;
@ApiProperty({
enum: [
'time_penalty',
'grid_penalty',
'points_deduction',
'disqualification',
'warning',
'license_points',
'probation',
'fine',
'race_ban',
],
})
@IsEnum([
'time_penalty',
'grid_penalty',
'points_deduction',
'disqualification',
'warning',
'license_points',
'probation',
'fine',
'race_ban',
])
@ApiProperty({ enum: PENALTY_TYPE_VALUES })
@IsEnum(PENALTY_TYPE_VALUES)
type!: string;
@ApiProperty({ required: false })

View File

@@ -0,0 +1,40 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsEnum, IsString } from 'class-validator';
import {
PENALTY_TYPE_VALUES,
type PenaltyTypeValue,
} from '@core/racing/domain/entities/penalty/PenaltyType';
export type PenaltyValueKindDTO = 'seconds' | 'grid_positions' | 'points' | 'races' | 'none';
export class PenaltyTypeReferenceDTO {
@ApiProperty({ enum: PENALTY_TYPE_VALUES })
@IsEnum(PENALTY_TYPE_VALUES)
type!: PenaltyTypeValue;
@ApiProperty()
@IsBoolean()
requiresValue!: boolean;
@ApiProperty({ enum: ['seconds', 'grid_positions', 'points', 'races', 'none'] })
@IsString()
valueKind!: PenaltyValueKindDTO;
}
export class PenaltyDefaultReasonsDTO {
@ApiProperty()
@IsString()
upheld!: string;
@ApiProperty()
@IsString()
dismissed!: string;
}
export class PenaltyTypesReferenceDTO {
@ApiProperty({ type: [PenaltyTypeReferenceDTO] })
penaltyTypes!: PenaltyTypeReferenceDTO[];
@ApiProperty({ type: PenaltyDefaultReasonsDTO })
defaultReasons!: PenaltyDefaultReasonsDTO;
}