49 lines
879 B
TypeScript
49 lines
879 B
TypeScript
import { Type } from 'class-transformer';
|
|
import { IsEnum, IsInt, IsOptional, IsString, IsUUID, Matches, Max, MaxLength, Min } from 'class-validator';
|
|
import { InspectionVisitStatus } from '../../database/entities';
|
|
|
|
export class ListInspectionVisitsQueryDto {
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page = 1;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(100)
|
|
pageSize = 25;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(200)
|
|
search?: string;
|
|
|
|
@IsOptional()
|
|
@IsEnum(InspectionVisitStatus)
|
|
status?: InspectionVisitStatus;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
companyId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
areaId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
inspectorId?: string;
|
|
|
|
@IsOptional()
|
|
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
|
dateFrom?: string;
|
|
|
|
@IsOptional()
|
|
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
|
dateTo?: string;
|
|
|
|
}
|