mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-01-19 17:34:43 +00:00
52 lines
858 B
TypeScript
52 lines
858 B
TypeScript
import { IsOptional, IsPositive, IsNotEmpty, IsIn, Max } from 'class-validator';
|
|
|
|
const filterableGameTypes = ['CTFGame', 'LakRabbitGame'] as const;
|
|
|
|
type FilterableGameType = typeof filterableGameTypes[number];
|
|
|
|
const hitStats = [
|
|
'discHitsTG',
|
|
'discDmgHitsTG',
|
|
'discMATG',
|
|
'laserHitsTG',
|
|
'laserMATG',
|
|
'cgHitsTG',
|
|
'shockHitsTG',
|
|
] as const;
|
|
|
|
type Stat = typeof hitStats[number];
|
|
|
|
export class TopAccuracyQueryDto {
|
|
@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;
|
|
}
|
|
|
|
export class TopWinsQueryDto {
|
|
@IsOptional()
|
|
@IsPositive()
|
|
minGames: number;
|
|
|
|
@IsOptional()
|
|
@IsPositive()
|
|
@Max(100)
|
|
limit: number;
|
|
}
|