-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.jh
61 lines (46 loc) · 976 Bytes
/
schema.jh
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
entity Option {
text String required
}
entity Answer {
text String
}
enum AnswerType {
TEXT, MULTIPLE_CHOICE, CHECK_BOX_GROUP, TIME, DATE, LINEAR_SCALE
}
enum EntryStatus {
DRAFT, SENT, READ
}
entity Question {
answerType AnswerType required,
text String required,
isMandatory Boolean required
}
entity Form {
title String
}
entity Entry {
isSigned Boolean required,
status EntryStatus required,
created ZonedDateTime,
lastEdited ZonedDateTime,
firstRead ZonedDateTime
}
relationship OneToMany {
Form{Questions} to Question{form(title)}
}
relationship OneToOne {
Answer{question(text)} to Question
}
relationship ManyToMany {
Question{options(text)} to Option{question(text)}
}
relationship OneToMany {
Entry to Answer{entry}
}
relationship OneToOne {
Entry{author(firstName)} to User
}
relationship OneToOne {
Entry{target(firstName)} to User
}
service Form, Question, Option, Entry, Answer with serviceClass