-
Notifications
You must be signed in to change notification settings - Fork 4
/
com-bonlimousin-jhipster-jdl.jdl
330 lines (313 loc) · 8.79 KB
/
com-bonlimousin-jhipster-jdl.jdl
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
/***************** DEPLOYMENT ********************/
// kubernetes
/*
deployment {
deploymentType kubernetes
appsFolders [bonGateway, bonLivestockService, bonReplicaService, bonContentService]
dockerRepositoryName "frostmark"
gatewayType zuul
monitoring elk
serviceDiscoveryType eureka
kubernetesNamespace bonlimousin
kubernetesServiceType LoadBalancer
}
*/
/***************** GATEWAY ********************/
application {
config {
baseName bonGateway
applicationType gateway
serverPort 9000
packageName com.bonlimousin.gateway
authenticationType jwt
buildTool maven
databaseType sql
devDatabaseType h2Disk
prodDatabaseType postgresql
enableHibernateCache true
entitySuffix Entity
dtoSuffix DTO
enableTranslation true
serviceDiscoveryType eureka
cacheProvider hazelcast
messageBroker kafka
testFrameworks [protractor]
enableSwaggerCodegen true
websocket spring-websocket
clientFramework angularX
clientTheme sketchy
clientPackageManager npm
nativeLanguage sv
languages [sv, en]
}
entities *
}
enum UserRole {
ROLE_ADMIN, ROLE_USER, ROLE_ANONYMOUS
}
/***************** LIVESTOCK ********************/
application {
config {
baseName bonLivestockService
applicationType microservice
serverPort 9001
packageName com.bonlimousin.livestock
authenticationType jwt
buildTool maven
databaseType sql
devDatabaseType h2Disk
prodDatabaseType postgresql
enableHibernateCache true
entitySuffix Entity
dtoSuffix DTO
enableSwaggerCodegen false
enableTranslation true
serviceDiscoveryType eureka
cacheProvider hazelcast
messageBroker kafka
testFrameworks [cucumber]
}
entities Matrilineality, Cattle, Note, Pasture, Photo
}
service Matrilineality, Cattle, Note, Pasture, Photo with serviceClass
paginate Matrilineality, Cattle, Note, Pasture, Photo with pagination
filter Matrilineality, Cattle, Note, Pasture, Photo
microservice Matrilineality, Cattle, Note, Pasture, Photo with bonLivestockService
CATTLE_PHOTO_CAPTION_MIN_LENGTH = 1
CATTLE_PHOTO_CAPTION_MAX_LENGTH = 140
/* Map cows to their family tree */
entity Matrilineality(bon_livestock_matrilineality) {
familyname String maxlength(127) required unique
earTagId Integer min(0) required unique
name String maxlength(127) required
country String minlength(2) maxlength(6) required
description String maxlength(1023)
cattleNameRegexPattern String maxlength(255) required
patriId Integer required
patriName String maxlength(127) required
patriCountry String minlength(2) maxlength(6) required
polled Boolean required
storyHandle String
visibility UserRole
}
/* Base data on cows and bulls */
entity Cattle(bon_livestock_cattle) {
earTagId Integer min(0) required unique
name String maxlength(127) required
visibility UserRole
upForSale Boolean required
showBlup Boolean required
alert Boolean required
storyHandle String
}
enum NoteCategory {
GENERAL, TREATMENT, HOOF_CARE, DEHORNING,
PASTURE_CHANGE, PASTURE_PLANNED,
WEIGHT, WEIGHING0, WEIGHING200, WEIGHING365,
ALERT, TEMPER,
ESTRUS, INSEMINATION
}
entity Note(bon_livestock_note) {
category NoteCategory required
note String maxlength(512)
actualDate LocalDate
}
entity Pasture(bon_livestock_pasture) {
name String maxlength(127) required
description String maxlength(1023) required
}
entity Photo(bon_livestock_photo) {
image ImageBlob required
caption String minlength(CATTLE_PHOTO_CAPTION_MIN_LENGTH) maxlength(CATTLE_PHOTO_CAPTION_MAX_LENGTH) required
height Integer min(0)
width Integer min(0)
taken Instant
visibility UserRole
}
relationship ManyToOne {
Cattle{matrilineality(name)} to Matrilineality
Note{pasture(name)} to Pasture
}
relationship OneToMany {
Cattle{photo} to Photo{cattle(earTagId) required}
Cattle{note} to Note{cattle(earTagId) required}
}
/***************** Replica of Central Registry ********************/
application {
config {
baseName bonReplicaService
applicationType microservice
serverPort 9002
packageName com.bonlimousin.replica
authenticationType jwt
buildTool maven
databaseType sql
devDatabaseType h2Disk
prodDatabaseType postgresql
enableHibernateCache true
entitySuffix Entity
dtoSuffix DTO
enableSwaggerCodegen false
enableTranslation true
serviceDiscoveryType eureka
cacheProvider hazelcast
messageBroker kafka
testFrameworks [cucumber]
}
entities SourceFile, Bovine, Blup, JournalEntry
}
readOnly Bovine, Blup, JournalEntry
service SourceFile, Bovine, Blup, JournalEntry with serviceClass
paginate SourceFile, Bovine, Blup, JournalEntry with pagination
filter SourceFile, Bovine, Blup, JournalEntry
microservice SourceFile, Bovine, Blup, JournalEntry with bonReplicaService
entity SourceFile(bon_replica_sourcefile) {
name String maxlength(127) required
zipFile AnyBlob required
processed Instant
outcome String
}
enum Gender {
HEIFER, BULL
}
enum HornStatus {
UNKNOWN, HORNED, POLLED, SCURS, DEHORNED, DISBUDDED
}
enum BovineStatus {
UNKNOWN, SOLD, MEAT, ON_FARM
}
/* */
entity Bovine(bon_replica_bovine) {
earTagId Integer min(0) required unique
masterIdentifier String maxlength(127) required unique
country String minlength(2) maxlength(6) required
herdId Integer min(0) required
birthDate Instant required
gender Gender required
name String maxlength(255) required
bovineStatus BovineStatus required
hornStatus HornStatus required
matriId Integer required
patriId Integer required
weight0 Integer min(0) max(99)
weight200 Integer min(0) max(999)
weight365 Integer min(0) max(9999)
}
/* Best Linear Unbiased Prediction, direct and maternal attributes */
entity Blup(bon_replica_blup) {
/* BirthWeight */
t0 Integer min(0)
/* Direct BirthWeight */
d0 Integer min(0)
/* Maternal BirthWeight - maternal genetic predisposition of likelyhood of a heavy calf */
m0 Integer min(0)
/* Weight 200 days */
t200 Integer min(0)
/* Direct weight 200 days */
d200 Integer min(0)
/* Maternal weight 200 days */
m200 Integer min(0)
/* Weight 365 days */
t365 Integer min(0)
/* Direct weight 365 days */
d365 Integer min(0)
/* Score */
total Integer min(0)
/* Status */
status String minlength(1)
}
/* Events */
// need to figure this out ... later
enum EntryStatus {
FOD, IB, TU, RET, UTG
}
entity JournalEntry(bon_replica_journal_entry) {
status EntryStatus required
date Instant required
edited Instant
herdId Integer min(0) required
newHerdId Integer min(0)
subState1 Integer
subState2 Integer
}
relationship OneToOne {
Blup{bovine(earTagId) required} to Bovine{blup} with jpaDerivedIdentifier
}
relationship ManyToOne {
Bovine{SourceFile} to SourceFile
}
relationship OneToMany {
Bovine{journalEntries} to JournalEntry{bovine(earTagId)}
}
/***************** CONTENT ********************/
application {
config {
baseName bonContentService
applicationType microservice
serverPort 9003
packageName com.bonlimousin.content
authenticationType jwt
buildTool maven
databaseType sql
devDatabaseType h2Disk
prodDatabaseType postgresql
enableHibernateCache true
entitySuffix Entity
dtoSuffix DTO
enableSwaggerCodegen false
enableTranslation true
serviceDiscoveryType eureka
cacheProvider hazelcast
messageBroker kafka
testFrameworks [cucumber]
searchEngine elasticsearch
}
entities Story, Fragment, Tag, Localized
}
service Story, Fragment, Tag, Localized with serviceClass
paginate Story, Fragment, Tag, Localized with infinite-scroll
filter Story, Fragment, Tag, Localized
search Fragment, Localized with elasticsearch
microservice Story, Fragment, Tag, Localized with bonContentService
enum StoryCategory {
NEWS, MATRILINEALITY, CATTLE, IT
}
entity Story(bon_content_story) {
category StoryCategory required
name String required minlength(2) unique
visibility UserRole
}
enum FragmentTemplate {
V1, V2, V3
}
entity Fragment(bon_content_fragment) {
template FragmentTemplate required
name String required minlength(2)
title String maxlength(127)
ingress String maxlength(255)
body TextBlob
image ImageBlob
caption String maxlength(255)
width Integer
height Integer
orderNo Integer required
visibility UserRole
}
entity Localized(bon_content_localized) {
i18n String minlength(2) pattern(/[a-z]+/) required
title String maxlength(127) required
ingress String maxlength(255)
body TextBlob required
caption String maxlength(255)
visibility UserRole
}
entity Tag(bon_content_tag) {
name String required minlength(2)
}
relationship OneToMany {
Story{fragment} to Fragment{story(name) required}
Fragment{localizedFragment} to Localized{fragment(orderNo) required}
}
relationship ManyToMany {
Fragment{tag(name)} to Tag{fragment}
}