@@ -2,6 +2,7 @@ import { IsOptional, IsString, IsNumber, IsIn, IsEnum } from 'class-validator';
2
2
import { ApiProperty } from '@nestjs/swagger' ;
3
3
import { SupplyPriority } from 'src/supply/types' ;
4
4
import { Transform } from 'class-transformer' ;
5
+ import { ShelterStatus } from '../types/search.types' ;
5
6
6
7
export class ShelterQueryDTO {
7
8
@ApiProperty ( {
@@ -11,18 +12,18 @@ export class ShelterQueryDTO {
11
12
@IsOptional ( )
12
13
@IsNumber ( )
13
14
@Transform ( ( value ) => Number ( value . value ) )
14
- perPage ?: number ;
15
+ readonly perPage ?: number ;
15
16
16
17
@ApiProperty ( { required : false , description : 'Número da página' } )
17
18
@IsOptional ( )
18
19
@IsNumber ( )
19
20
@Transform ( ( value ) => Number ( value . value ) )
20
- page ?: number ;
21
+ readonly page ?: number ;
21
22
22
23
@ApiProperty ( { required : false , description : 'Termo de busca' } )
23
24
@IsOptional ( )
24
25
@IsString ( )
25
- search ?: string ;
26
+ readonly search ?: string ;
26
27
27
28
@ApiProperty ( {
28
29
required : false ,
@@ -31,23 +32,23 @@ export class ShelterQueryDTO {
31
32
} )
32
33
@IsOptional ( )
33
34
@IsIn ( [ 'asc' , 'desc' ] )
34
- order ?: 'asc' | 'desc' ;
35
+ readonly order ?: 'asc' | 'desc' ;
35
36
36
37
@ApiProperty ( {
37
38
required : false ,
38
39
description : 'Critério de ordenação dos resultados' ,
39
40
} )
40
41
@IsOptional ( )
41
42
@IsString ( )
42
- orderBy ?: string ;
43
+ readonly orderBy ?: string ;
43
44
44
45
@ApiProperty ( {
45
46
required : false ,
46
47
description : 'IDs de categoria de suprimento' ,
47
48
} )
48
49
@IsOptional ( )
49
50
@IsString ( { each : true } )
50
- supplyCategoryIds ?: string [ ] ;
51
+ readonly supplyCategoryIds ?: string [ ] ;
51
52
52
53
@ApiProperty ( {
53
54
required : false ,
@@ -57,18 +58,18 @@ export class ShelterQueryDTO {
57
58
@IsOptional ( )
58
59
@IsEnum ( SupplyPriority )
59
60
@Transform ( ( value ) => Number ( value . value ) )
60
- priority ?: SupplyPriority ;
61
+ readonly priority ?: SupplyPriority ;
61
62
62
63
@ApiProperty ( { required : false , description : 'IDs de suprimento' } )
63
64
@IsOptional ( )
64
65
@IsString ( { each : true } )
65
- supplyIds ?: string [ ] ;
66
+ readonly supplyIds ?: string [ ] ;
66
67
67
68
@ApiProperty ( {
68
69
required : false ,
69
70
description : 'Status do abrigo' ,
70
71
} )
71
72
@IsOptional ( )
72
73
@IsIn ( [ 'available' , 'unavailable' , 'waiting' ] , { each : true } )
73
- shelterStatus ?: ( 'available' | 'unavailable' | 'waiting' ) [ ] ; // MUDAR !!!!
74
+ readonly shelterStatus ?: ShelterStatus [ ] ;
74
75
}
0 commit comments