test: harden business boundary conditions
This commit is contained in:
21
apps/server/src/sync/dto/schedule-sync.dto.ts
Normal file
21
apps/server/src/sync/dto/schedule-sync.dto.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { IsBoolean, IsISO8601, IsInt, IsOptional, Matches, Max, Min } from 'class-validator';
|
||||
|
||||
export class ScheduleSyncQueryDto {
|
||||
@IsOptional()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
@IsISO8601({ strict: true })
|
||||
dateFrom?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(90)
|
||||
days: number = 30;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => value === true || value === 'true')
|
||||
@IsBoolean()
|
||||
attendanceMachineOnly: boolean = false;
|
||||
}
|
||||
Reference in New Issue
Block a user