File tree 3 files changed +37
-10
lines changed
3 files changed +37
-10
lines changed Original file line number Diff line number Diff line change 28
28
"@types/koa-logger" : " ^3.1.1" ,
29
29
"@types/koa-multer" : " ^1.0.0" ,
30
30
"@types/koa-router" : " ^7.4.0" ,
31
- "@typescript-eslint/eslint-plugin" : " ^2.17 .0" ,
32
- "@typescript-eslint/parser" : " ^2.17 .0" ,
31
+ "@typescript-eslint/eslint-plugin" : " ^2.18 .0" ,
32
+ "@typescript-eslint/parser" : " ^2.18 .0" ,
33
33
"eslint" : " ^6.8.0" ,
34
34
"husky" : " ^4.2.1" ,
35
- "lint-staged" : " ^10.0.2 " ,
35
+ "lint-staged" : " ^10.0.4 " ,
36
36
"nodemon" : " ^2.0.2" ,
37
37
"prettier" : " ^1.19.1" ,
38
38
"ts-node" : " ^8.6.2" ,
Original file line number Diff line number Diff line change 1
- import { Length , IsArray , IsOptional } from 'class-validator' ;
1
+ import {
2
+ Length ,
3
+ IsObject ,
4
+ IsUrl ,
5
+ IsArray ,
6
+ IsOptional ,
7
+ IsString
8
+ } from 'class-validator' ;
2
9
3
- interface Contact {
10
+ import { Address } from './common' ;
11
+
12
+ export interface Supplies {
13
+ name : string ;
14
+ type : 'face' | 'leg' | 'disinfection' | 'device' | 'other' ;
15
+ remark : string ;
16
+ count : number ;
17
+ }
18
+
19
+ export interface Contact {
4
20
name : string ;
5
21
phone : string ;
6
22
}
@@ -9,16 +25,20 @@ export class RequirementModel {
9
25
@Length ( 5 )
10
26
hospital : string ;
11
27
12
- @Length ( 10 )
13
- address : string ;
28
+ @IsObject ( )
29
+ address : Address ;
14
30
15
- @IsArray ( )
16
- coords : number [ ] ;
31
+ @IsUrl ( )
32
+ url : string ;
17
33
18
34
@IsArray ( )
19
- supplies : string [ ] ;
35
+ supplies : Supplies [ ] ;
20
36
21
37
@IsOptional ( )
22
38
@IsArray ( )
23
39
contacts ?: Contact [ ] ;
40
+
41
+ @IsOptional ( )
42
+ @IsString ( )
43
+ remark ?: string ;
24
44
}
Original file line number Diff line number Diff line change
1
+ export interface Address {
2
+ province : string ;
3
+ city : string ;
4
+ district : string ;
5
+ detail : string ;
6
+ coords : number [ ] ;
7
+ }
You can’t perform that action at this time.
0 commit comments