From 250540e076b8f5a311168ed2d7eb9b82e57962cf Mon Sep 17 00:00:00 2001 From: enlineawork Date: Sat, 5 Sep 2026 17:44:58 -0300 Subject: [PATCH] =?UTF-8?q?F2.1:=20consulta=20m=C3=B3vil=20de=20Inventario?= =?UTF-8?q?=20por=20contexto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/list-field-inventory-query.dto.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 api-v3/src/inspection-visits/dto/list-field-inventory-query.dto.ts diff --git a/api-v3/src/inspection-visits/dto/list-field-inventory-query.dto.ts b/api-v3/src/inspection-visits/dto/list-field-inventory-query.dto.ts new file mode 100644 index 0000000..0a27f99 --- /dev/null +++ b/api-v3/src/inspection-visits/dto/list-field-inventory-query.dto.ts @@ -0,0 +1,25 @@ +import { Transform, Type } from 'class-transformer'; +import { IsInt, IsOptional, IsString, IsUUID, Max, MaxLength, Min } from 'class-validator'; + +export class ListFieldInventoryQueryDto { + @IsOptional() + @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : undefined) + @IsString() + @MaxLength(200) + search?: string; + + @IsOptional() + @IsUUID('4') + parentId?: string; + + @IsOptional() + @IsUUID('4') + typeId?: string; + + @IsOptional() + @Type(() => Number) + @IsInt() + @Min(1) + @Max(100) + limit = 50; +}