-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathupdate.model.ts
53 lines (39 loc) · 916 Bytes
/
update.model.ts
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { CollectionProperty, DateProperty, Model, PartitionKey, Property } from '../../src/dynamo-easy'
// tslint:disable-next-line:max-classes-per-file
@Model()
export class Address {
street: string
place: string
zip: number
}
// tslint:disable-next-line:max-classes-per-file
@Model()
export class Info {
details: string
@DateProperty()
createdAt: Date
}
// tslint:disable-next-line:max-classes-per-file
@Model()
export class UpdateModel {
@PartitionKey()
id: string
@DateProperty()
creationDate: Date
@DateProperty()
lastUpdated: Date
name: string
@Property({ name: 'isActive' })
active: boolean
counter: number
// maps to L(ist)
addresses: Address[]
@CollectionProperty({ sorted: true })
numberValues: number[]
@CollectionProperty({ itemType: Info })
informations: Info[]
// maps to M(ap)
info: Info
// maps to S(tring)S(et)
topics: Set<string>
}