57 lines
991 B
TypeScript
57 lines
991 B
TypeScript
import { Type } from 'class-transformer';
|
|
import { IsEnum, IsInt, IsOptional, IsString, IsUUID, Matches, Max, MaxLength, Min } from 'class-validator';
|
|
import { InspectionActStatus } from '../../database/entities';
|
|
|
|
export class ListInspectionActsQueryDto {
|
|
@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(InspectionActStatus)
|
|
status?: InspectionActStatus;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(2000)
|
|
@Max(2100)
|
|
year?: number;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
companyId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
areaId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
inspectorId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
|
dateFrom?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
|
dateTo?: string;
|
|
}
|