import { IsNotEmpty, IsString, IsDate, Length, IsInt, Min, Max, IsArray, IsJSON } from 'class-validator'; import { Timestamp } from 'typeorm'; export class GameDTO { @IsString() @IsNotEmpty() @Length(3, 30) name: string; @IsString() gameDescription?: string; @IsDate() @IsNotEmpty() startDate: string; @IsDate() @IsNotEmpty() endDate: string; @IsArray() @IsNotEmpty() factions?: FactionDTO[]; @IsArray() @IsNotEmpty() objectivePoint?: ObjectivePointDTO[]; @IsJSON() @IsNotEmpty() mapCoordinates: JSON; } /*export class EditGameDTO { @IsString() @IsNotEmpty() @Length(3, 30) gameName?: string; @IsString() gameDescription?: string; @IsDate() @IsNotEmpty() startDate: string; @IsDate() @IsNotEmpty() endDate: string; @IsArray() @IsNotEmpty() factions?: FactionDTO[]; @IsArray() @IsNotEmpty() objectivePoint?: ObjectivePointDTO[]; @IsJSON() @IsNotEmpty() mapCoordinates: JSON; @IsString() @IsNotEmpty() @Length(3, 255) GM_Password?: string; }*/ export class FactionDTO { @IsString() @IsNotEmpty() @Length(3, 30) factionName: string; @IsString() @IsNotEmpty() @Length(3, 255) faction_Password?: string; } /*export class PowerUpDTO { @IsString() @IsNotEmpty() powerUpName: string; @IsString() @IsNotEmpty() powerUpDescription?: string; @IsInt() @IsNotEmpty() amount: number; @IsNotEmpty() cooldown: string; }*/ export class ObjectivePointDTO { @IsString() @IsNotEmpty() objectivePointDescription: string; @IsJSON() @IsNotEmpty() objectivePointCoordinates: JSON; @IsArray() @IsNotEmpty() objectivePointHistory: ObjectivePointHistoryDTO[]; } export class ObjectivePointHistoryDTO { @IsString() factionId: string; @IsNotEmpty() @IsInt() @Min(0) @Max(2) oP_HistoryStatus: number; @IsNotEmpty() oP_HistoryTimestamp: Timestamp; }