Code owners
Assign users and groups as approvers for specific file changes. Learn more.
game.dto.ts 2.00 KiB
import { IsNotEmpty, IsString, IsDate, Length, IsInt, Min, Max, IsArray, IsJSON } from 'class-validator';
import { Timestamp } from 'typeorm';
export class CreateGameDTO {
@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 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;
}