diff --git a/src/game/game.dto.ts b/src/game/game.dto.ts index f47c0422feef5188cdf95a7b0e18b30f7c5c1ca2..393e82296a13af26e424b38a44e5a79e86976007 100644 --- a/src/game/game.dto.ts +++ b/src/game/game.dto.ts @@ -5,6 +5,8 @@ import { IsDateString, IsNumber, Validate, + Min, + Max, } from 'class-validator'; import { ObjectivePointEntity } from './game.entity'; import { CenterJSON } from '../shared/custom-validation'; @@ -72,10 +74,22 @@ export class FlagboxDTO { } export class FlagboxEventDTO { + @IsString() + @IsNotEmpty() + @Length(7) node_id: string; - owner: number; - action: number; - capture: number; + @IsNumber() + @Min(0) + @Max(3) + owner: number; // owner = 0, => first entry in faction db, owner = 1, => second entry etc + @IsNumber() + @Min(0) + @Max(3) + action: number; // 0=no capture ongoing, 1=captured, 2=capture ongoing + @IsNumber() + @Min(0) + @Max(3) + capture: number; // which faction is capturing, same logic as in owner with numbers oP_HistoryTimestamp?: string; objective_point?: ObjectivePointEntity; }