-
Notifications
You must be signed in to change notification settings - Fork 11
/
client-side-datamodel.d2
166 lines (151 loc) · 3.59 KB
/
client-side-datamodel.d2
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
direction: right
# Text
explanation: |md
# CoronaCheck - Client Side Data model
- **Changelog**
- *1.5.1* Layout changes with d2lang
- *1.5* Updated EventGroup with isDraft
- *1.4* Added OriginHint and RemovedEvents
- *1.3* Renamed EventGroup issued_at to expiryDate
- *1.2* Added origin level, styling changes
- *1.1* Added provider identifier, credential version to event table renamed event to EventGroup
- *1.0* Removed 'valid until' fields as this is config-determined
- *0.2* Matched terminology currently used in clients
- *0.1* Initial version
- **Authors**
- Ivo, Bart, Rool
|
# Containers
wallet: {
label: Wallet
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
1abel: main
}
comment: |md
This level is currently __YAGNI__ and will be
added once we support multiple people's QR's.
|
style.shadow: true
}
eventgroup: {
label: EventGroup
table: {
shape: sql_table
id: Int {constraint: primary_key}
walletId: Int {constraint: foreign_key}
expiryDate: Date 2012-04-15T10:01:00Z
isDraft: Boolean true
jsonData: Blob
providerIdentifier: String {constraint: unique}
type: vaccination|recovery|test
}
comment: |md
**Note**: the jsonData can contain multiple
events with a single signature.
|
style.shadow: true
style.multiple: true
}
greencard: {
label: Greencard
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
walletId: Int {constraint: foreign_key}
type: eu|domestic
}
style.shadow: true
style.multiple: true
}
origin: {
label: Origin
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
greencardId: Int {constraint: foreign_key}
doseNumber: Int
eventDate: Date
expirationTime: Date
type: vaccination|recovery|test
validFrom: Date
}
style.shadow: true
style.multiple: true
}
credential: {
label: Credential
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
greencardId: Int {constraint: foreign_key}
data: Binary Data
expirationTime: Date
validFrom: Date
version: Int
}
style.shadow: true
style.multiple: true
}
removedevent: {
label: RemovedEvent
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
walletId: Int {constraint: foreign_key}
eventDate: Date
reason: String
type: vaccination|recovery|test
}
style.shadow: true
style.multiple: true
}
hint: {
label: OriginHint
table: Table {
shape: sql_table
id: Int {constraint: primary_key}
originId: Int {constraint: foreign_key}
hint: String
}
style.shadow: true
style.multiple: true
}
# Connections
wallet -> eventgroup: "Data to be sent to signer: all events" {
source-arrowhead: 0
target-arrowhead: * {
shape: diamond
}
}
wallet -> greencard: {
source-arrowhead: 0
target-arrowhead: * {
shape: diamond
}
}
wallet -> removedEvent: "EventGroup metadata for eventgroups that are removed\ndue to identity mismatch or blocked events " {
source-arrowhead: 0
target-arrowhead: * {
shape: diamond
}
}
greencard -> origin: "This indicates what the\ngreencard was based upon" {
source-arrowhead: 1
target-arrowhead: * {
shape: diamond
}
}
greencard -> credential: "Only green card type domestic can have multiple\ncredentials, all others have a single credential" {
source-arrowhead: 1
target-arrowhead: * {
shape: diamond
}
}
origin -> hint: "Hints store more information\nfor an origin, i.e. event_from_dcc" {
source-arrowhead: 1
target-arrowhead: * {
shape: diamond
}
}