73 lines
1.4 KiB
TypeScript
73 lines
1.4 KiB
TypeScript
import { Transform, Type } from 'class-transformer';
|
|
import {
|
|
IsBoolean,
|
|
IsEnum,
|
|
IsInt,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { AssetInformationStatus, AssetOperationalStatus } from '../../database/entities';
|
|
|
|
export class ListAssetsQueryDto {
|
|
@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()
|
|
@IsUUID('4')
|
|
typeId?: string;
|
|
|
|
@IsOptional()
|
|
@IsEnum(AssetInformationStatus)
|
|
status?: AssetInformationStatus;
|
|
|
|
@IsOptional()
|
|
@IsEnum(AssetOperationalStatus)
|
|
operationalStatus?: AssetOperationalStatus;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
|
|
@IsBoolean()
|
|
needsValidation?: boolean;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
|
|
@IsBoolean()
|
|
hasGeometry?: boolean;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
|
|
@IsBoolean()
|
|
inventoryOnly?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
parentId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
operationalAreaId?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
operatorCompanyId?: string;
|
|
}
|