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
  • 631e4935
    Merge branch 'Development' into 'JoinGame' · 631e4935
    L4721 authored
    # Conflicts:
    #   src/game/coordinate.entity.ts
    #   src/game/faction.entity.ts
    #   src/game/game.controller.ts
    #   src/game/game.dto.ts
    #   src/game/game.entity.ts
    #   src/game/game.module.ts
    #   src/game/game.service.ts
    #   src/user/user.entity.ts
    #   src/user/user.module.ts
+ 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