Skip to content
Snippets Groups Projects

Join game

Merged Ghost User requested to merge JoinGame into Development
4 files
+ 32
12
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 20
8
import {
IsString,
IsDateString,
IsJSON,
IsNotEmpty,
IsString,
IsDate,
Length,
IsInt,
Min,
Max,
IsArray,
Validate,
IsJSON,
} from 'class-validator';
import { ArrayLength } from 'src/shared/array-validation';
import { Timestamp } from 'typeorm';
export class GameDTO {
// uses class-validator built in validations
// see https://github.com/typestack/class-validator
@IsString()
@IsNotEmpty()
@Length(2, 31)
@Length(3, 30)
name: string;
@IsString()
gameDescription?: string;
@IsDate()
@IsNotEmpty()
@Length(1, 255)
desc: string;
@@ -36,6 +40,14 @@ export class GameDTO {
// custom validation for array length (arr>min, arr<max)
//@Validate(ArrayLength, [4, 8])
factions?: FactionDTO[];
@IsArray()
@IsNotEmpty()
objectivePoint?: ObjectivePointDTO[];
@IsJSON()
@IsNotEmpty()
mapCoordinates: JSON;
}
export class FactionDTO {
Loading