All files / apps/work-orders-service/src/work-orders/dto query-work-orders.dto.ts

100% Statements 13/13
100% Branches 8/8
100% Functions 2/2
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 314x 4x 4x   4x     4x       4x       4x     3x     14x     3x       14x    
import { Type } from 'class-transformer';
import { IsEnum, IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
import { WorkOrderPriority, WorkOrderStatus } from '../work-order.enums';
 
export class QueryWorkOrdersDto {
  @IsOptional()
  @IsEnum(WorkOrderStatus)
  status?: WorkOrderStatus;
 
  @IsOptional()
  @IsEnum(WorkOrderPriority)
  priority?: WorkOrderPriority;
 
  @IsOptional()
  @IsUUID()
  propertyId?: string;
 
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  page: number = 1;
 
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(100)
  limit: number = 20;
}