2021-04-30 01:04:53 +00:00
|
|
|
import { IsOptional, IsPositive, IsNotEmpty, IsIn, Max } from 'class-validator';
|
|
|
|
|
|
2021-05-30 08:57:00 +00:00
|
|
|
const filterableGameTypes = ['CTFGame', 'LakRabbitGame'] as const;
|
2021-04-30 01:04:53 +00:00
|
|
|
|
|
|
|
|
type FilterableGameType = typeof filterableGameTypes[number];
|
|
|
|
|
|
|
|
|
|
const hitStats = [
|
|
|
|
|
'discHitsTG',
|
|
|
|
|
'discDmgHitsTG',
|
|
|
|
|
'discMATG',
|
|
|
|
|
'laserHitsTG',
|
|
|
|
|
'laserMATG',
|
|
|
|
|
'cgHitsTG',
|
2021-05-30 08:57:00 +00:00
|
|
|
'shockHitsTG',
|
2021-09-25 21:36:43 +00:00
|
|
|
'grenadeHitsTG',
|
|
|
|
|
'grenadeDmgHitsTG',
|
|
|
|
|
'grenadeMATG',
|
2021-04-30 01:04:53 +00:00
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
type Stat = typeof hitStats[number];
|
|
|
|
|
|
2021-05-30 08:57:00 +00:00
|
|
|
export class TopAccuracyQueryDto {
|
2021-04-30 01:04:53 +00:00
|
|
|
@IsNotEmpty()
|
|
|
|
|
@IsIn(hitStats as any)
|
|
|
|
|
stat: Stat;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsIn(filterableGameTypes as any)
|
|
|
|
|
gameType: FilterableGameType;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
minGames: number;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
minShots: number;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
@Max(100)
|
|
|
|
|
limit: number;
|
|
|
|
|
}
|
2021-05-30 08:57:00 +00:00
|
|
|
|
|
|
|
|
export class TopWinsQueryDto {
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
minGames: number;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsPositive()
|
|
|
|
|
@Max(100)
|
|
|
|
|
limit: number;
|
|
|
|
|
}
|