@@ -2,6 +2,7 @@ import { IsOptional, IsString, IsNumber, IsIn, IsEnum } from 'class-validator';
22import { ApiProperty } from '@nestjs/swagger' ;
33import { SupplyPriority } from 'src/supply/types' ;
44import { Transform } from 'class-transformer' ;
5+ import { ShelterStatus } from '../types/search.types' ;
56
67export class ShelterQueryDTO {
78 @ApiProperty ( {
@@ -11,18 +12,18 @@ export class ShelterQueryDTO {
1112 @IsOptional ( )
1213 @IsNumber ( )
1314 @Transform ( ( value ) => Number ( value . value ) )
14- perPage ?: number ;
15+ readonly perPage ?: number ;
1516
1617 @ApiProperty ( { required : false , description : 'Número da página' } )
1718 @IsOptional ( )
1819 @IsNumber ( )
1920 @Transform ( ( value ) => Number ( value . value ) )
20- page ?: number ;
21+ readonly page ?: number ;
2122
2223 @ApiProperty ( { required : false , description : 'Termo de busca' } )
2324 @IsOptional ( )
2425 @IsString ( )
25- search ?: string ;
26+ readonly search ?: string ;
2627
2728 @ApiProperty ( {
2829 required : false ,
@@ -31,23 +32,23 @@ export class ShelterQueryDTO {
3132 } )
3233 @IsOptional ( )
3334 @IsIn ( [ 'asc' , 'desc' ] )
34- order ?: 'asc' | 'desc' ;
35+ readonly order ?: 'asc' | 'desc' ;
3536
3637 @ApiProperty ( {
3738 required : false ,
3839 description : 'Critério de ordenação dos resultados' ,
3940 } )
4041 @IsOptional ( )
4142 @IsString ( )
42- orderBy ?: string ;
43+ readonly orderBy ?: string ;
4344
4445 @ApiProperty ( {
4546 required : false ,
4647 description : 'IDs de categoria de suprimento' ,
4748 } )
4849 @IsOptional ( )
4950 @IsString ( { each : true } )
50- supplyCategoryIds ?: string [ ] ;
51+ readonly supplyCategoryIds ?: string [ ] ;
5152
5253 @ApiProperty ( {
5354 required : false ,
@@ -57,18 +58,18 @@ export class ShelterQueryDTO {
5758 @IsOptional ( )
5859 @IsEnum ( SupplyPriority )
5960 @Transform ( ( value ) => Number ( value . value ) )
60- priority ?: SupplyPriority ;
61+ readonly priority ?: SupplyPriority ;
6162
6263 @ApiProperty ( { required : false , description : 'IDs de suprimento' } )
6364 @IsOptional ( )
6465 @IsString ( { each : true } )
65- supplyIds ?: string [ ] ;
66+ readonly supplyIds ?: string [ ] ;
6667
6768 @ApiProperty ( {
6869 required : false ,
6970 description : 'Status do abrigo' ,
7071 } )
7172 @IsOptional ( )
7273 @IsIn ( [ 'available' , 'unavailable' , 'waiting' ] , { each : true } )
73- shelterStatus ?: ( 'available' | 'unavailable' | 'waiting' ) [ ] ; // MUDAR !!!!
74+ readonly shelterStatus ?: ShelterStatus [ ] ;
7475}
0 commit comments