-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackend.jdl
404 lines (378 loc) · 9.94 KB
/
backend.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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
/**
* The OrganisationUnitLevel(organisation_unit_levels) entity.
* @author Chris
*/
entity OrganisationUnitLevel(organisation_unit_levels) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(200) minlength(2)
level Integer required
isInspectionLevel Boolean required
}
/**
* The OrganisationUnit entity.
* @author Chris
*/
entity OrganisationUnit(organisation_units) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(200) minlength(2)
address String
phoneNumber String
email String
background TextBlob
logo ImageBlob
}
relationship ManyToOne {
OrganisationUnit{organisationUnitLevel(name) required} to OrganisationUnitLevel
OrganisationUnit{parent(name)} to OrganisationUnit
}
/**
* The FinancialYear(financial_years) entity.
* @author Chris
*/
entity FinancialYear(financial_years) {
name String required unique maxlength(200) minlength(2)
startDate LocalDate required
endDate LocalDate required
isOpened Boolean required
}
/**
* The Quarter(quarters) entity.
* @author Chris
*/
entity Quarter(quarters) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(200) minlength(2)
startDate LocalDate required
endDate LocalDate required
}
relationship ManyToOne {
Quarter{financialYear(name) required} to FinancialYear
}
/**
* The FileResource entity.
* @author Chris
*/
entity FileResource(file_resources) {
name String required maxlength(200) minlength(2)
path String maxlength(300)
contentType String maxlength(200)
contextMd5 String required maxlength(32)
size Double required
isAssigned Boolean
type String maxlength(100) required
}
/**
* The GfsCodes(gfs_codes) entity.
* @author Chris
*/
entity GfsCode(gfs_codes) {
code String required unique maxlength(64) minlength(1)
description TextBlob required
}
/**
* The FindingCategory(finding_categories) entity.
* @author Chris
*/
entity FindingCategory(finding_categories) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(200) minlength(2)
}
/**
* The FindingSubCategory(finding_sub_categories) entity.
* @author Chris
*/
entity FindingSubCategory(finding_sub_categories) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(200) minlength(2)
}
/**
* The AuditableArea entity. Area of audit used when create an audit engagement
* @author Chris
*/
entity AuditableArea(auditable_areas) {
code String unique maxlength(64) minlength(1)
name String required unique maxlength(2000) minlength(2)
}
/**
* The InspectionProgram(inspection_programs) entity.
* @author Chris
*/
entity SubArea(sub_areas) {
name String required unique maxlength(200) minlength(2)
}
relationship ManyToOne {
SubArea{area(name) required} to AuditableArea
}
/**
* The Indicator(indicators) entity.
* @author Chris
*/
entity Indicator(indicators) {
name String required unique maxlength(1000) minlength(2)
}
relationship ManyToOne {
Indicator{subArea(name) required} to SubArea
}
/**
* The Procedure(procedures) entity.
* @author Chris
*/
entity Procedure(procedures) {
name String required unique maxlength(2000) minlength(2)
}
relationship ManyToOne {
Procedure{indicator(name) required} to Indicator
}
/**
* The Notification(notifications) entity.
* @author Chris
*/
entity Notification(notifications) {
email String maxlength(100) required
subject String maxlength(200)
body TextBlob
isSent Boolean
isRead Boolean
attachments String maxlength(3000)
}
enum InspectionType {
PLANNED,SPECIAL
}
/**
* The Inspection(inspections) entity.
* @author Chris
*/
entity Inspection(inspections) {
name String required unique maxlength(200) minlength(2)
startDate LocalDate required
endDate LocalDate required
inspectionType InspectionType required
}
relationship ManyToOne {
Inspection{financialYear(name) required} to FinancialYear
Inspection{organisationUnit(name) required} to OrganisationUnit
}
enum InspectionRole {
TEAM_LEAD,MEMBER
}
/**
* The InspectionMember entity.
* @author Chris
*/
entity InspectionMember(inspection_members) {
fullName String required maxlength(100)
email String required maxlength(100)
role InspectionRole required
}
relationship ManyToOne {
InspectionMember{user(fullName) required} to User
InspectionMember{letterAttachment(path) } to FileResource
InspectionMember{declarationAttachment(path) } to FileResource
}
enum MeetingType {
TEAM,ENTRANCE
}
/**
* The TeamMeeting entity.
* @author Chris
*/
entity Meeting(team_meetings) {
type MeetingType required
meetingDate LocalDate required
venue String maxlength(200) required
summary TextBlob
}
relationship ManyToOne {
Meeting{inspection required} to Inspection
}
/**
* The MeetingMember entity.
* @author Chris
*/
entity MeetingMember(meeting_members) {
name String required maxlength(200) minlength(2)
phoneNumber String maxlength(20)
email String maxlength(200)
title String maxlength(200)
}
relationship ManyToOne {
MeetingMember{meeting required} to Meeting
}
/**
* The MeetingAgenda entity.
* @author Chris
*/
entity MeetingAgenda(meeting_agendas) {
description TextBlob required
}
/**
* The MeetingAttachment entity.
* @author Chris
*/
entity MeetingAttachment(meeting_attachments) {
name String required unique maxlength(200) minlength(2)
}
relationship ManyToOne {
MeetingAgenda{meeting required} to Meeting
MeetingAttachment{meeting required} to Meeting
MeetingAttachment{attachment(path) required} to FileResource
}
/**
* The InspectionAuditableArea(inspection_auditable_areas) entity.
* @author Chris
*/
entity InspectionArea(inspection_areas) {
name String required maxlength(2000)
}
relationship ManyToOne {
InspectionArea{inspection required} to Inspection
InspectionArea{auditableArea(name)} to AuditableArea
}
/**
* The InspectionGeneralIndicator entity.
* @author Chris
*/
entity InspectionObjective(inspection_objectives) {
name String required maxlength(1000)
}
relationship ManyToOne {
InspectionObjective{inspectionArea(name) required} to InspectionArea
}
/**
* The InspectionSubArea(inspection_sub_areas) entity.
* @author Chris
*/
entity InspectionSubArea(inspection_sub_areas) {
name String required maxlength(1000)
}
relationship ManyToOne {
InspectionSubArea{inspectionObjective(name) required} to InspectionObjective
InspectionSubArea{subArea(name) required} to SubArea
}
/**
* The InspectionIndicator(inspection_indicators) entity.
* @author Chris
*/
entity InspectionIndicator(inspection_indicators) {
name String required maxlength(1000)
}
relationship ManyToOne {
InspectionIndicator{inspectionSubArea(name) required} to InspectionSubArea
InspectionIndicator{indicator(name) required} to Indicator
}
/**
* The InspectionProcedure entity.
* @author Chris
*/
entity InspectionProcedure(inspection_procedures) {
name String required maxlength(1000)
}
relationship ManyToOne {
InspectionProcedure{inspectionIndicator(name) required} to InspectionIndicator
InspectionProcedure{procedure(name) required} to Procedure
}
/**
* The InspectionWorkDone(inspection_work_dones) entity.
* @author Chris
*/
entity InspectionWorkDone(inspection_work_dones) {
name String required
isOk Boolean
}
relationship ManyToOne {
InspectionWorkDone{procedure(name) required} to InspectionProcedure
}
enum ActionPlanCategory {
LOW,MEDIUM,HIGH
}
enum ImplementationStatus {
IMPLEMENTED,NOT_IMPLEMENTED,PARTIAL_IMPLEMENTED,TAKEN_BY_EVENT
}
/**
* The InspectionFinding(inspection_findings) entity.
* @author Chris
*/
entity InspectionFinding(inspection_findings) {
code String required maxlength(5)
description TextBlob
condition String
disclosedLastInspection Boolean
causes TextBlob
actionPlanCategory ActionPlanCategory
implication TextBlob
isClosed Boolean
}
relationship ManyToOne {
InspectionFinding{workDone(name) required} to InspectionWorkDone
InspectionFinding{category(name) required} to FindingCategory
InspectionFinding{subCategory(name) required} to FindingSubCategory
}
/**
* The InspectionRecommendation entity.
* @author Chris
*/
entity InspectionRecommendation(inspection_recommendations) {
description TextBlob required
implementationStatus ImplementationStatus required
completionDate LocalDate
compliancePlan TextBlob
}
// Finding Management Module Start
/**
* Source of findings i.e who raised the finding during audit or inspection
**/
enum FindingSource {
CAIG,PPRA,LAAC,INSPECTION,IA
}
/**
* The Finding(findings) entity.
* @author Chris
*/
entity Finding(findings) {
source FindingSource required
code String
description TextBlob required
actionPlanCategory ActionPlanCategory required
isClosed Boolean
}
relationship ManyToOne {
Finding{organisationUnit(name) required} to OrganisationUnit
}
enum ResponseType {
AUDITOR,INSPECTOR,CLIENT
}
/**
* The FindingRecommendation(finding_recommendations) entity.
* @author Chris
*/
entity FindingRecommendation(finding_recommendations) {
description TextBlob required
implementationStatus ImplementationStatus required
}
relationship ManyToOne {
FindingRecommendation{finding required} to Finding
}
/**
* The FindingResponse(inspection_responses) entity.
* @author Chris
*/
entity FindingResponse(finding_responses) {
source ResponseType required
description TextBlob required
}
relationship ManyToOne {
FindingResponse{recommendation(description) required} to FindingRecommendation
}
/**
* The InspectionResponseAttachment entity.
* @author Chris
*/
entity ResponseAttachment(response_attachments) {
name String required maxlength(100)
}
relationship ManyToOne {
ResponseAttachment{attachment(path) required} to FileResource
ResponseAttachment{response required} to FindingResponse
}
dto * with mapstruct
paginate all with pagination