-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentities-generator.jdl
135 lines (115 loc) · 2.97 KB
/
entities-generator.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
entity Address {
road String,
postalCode String,
city String,
country String,
additionalDetails String
}
entity Order(jhi_order) {
paymentDate Instant required,
receptionDate Instant required,
totalPrice BigDecimal required
}
entity Product {
name String required,
description String,
quantity Integer required,
version Long required,
origin String,
brand String,
imagePath String,
price BigDecimal required,
weight BigDecimal,
weightUnit WeightUnit
}
entity Promotion {
startDate Instant required,
endDate Instant required,
value BigDecimal required,
unit ReductionType required
}
entity PromotionalCode {
code String required,
startDate Instant required,
endDate Instant required,
value BigDecimal required,
unit ReductionType required
}
entity Cart {
}
entity ProductOrder {
quantity Integer min(1) required,
price BigDecimal required,
promotionValue BigDecimal,
promotionType ReductionType
promoCodeValue BigDecimal,
promoCodeType ReductionType
}
entity ProductCart {
quantity Integer min(1) required,
creationDatetime Instant required
}
entity Category {
name String required,
}
entity Recipe {
name String required,
description String,
steps String,
imagePath String
}
entity Tag {
name String required,
color String
}
entity UserDetails {
role Role required,
birthDate LocalDate,
phoneNumber String
}
enum Role {
ADMIN, STAFF, CLIENT
}
enum ReductionType {
FIX, PERCENTAGE
}
enum WeightUnit {
L, ML, KG, G, U
}
relationship OneToMany {
Order{lines} to ProductOrder{order},
Cart{lines} to ProductCart{cart},
UserDetails{orders} to Order{user}
}
relationship ManyToOne {
Category{parent} to Category{children},
Product{category} to Category,
Order{promotionalCode} to PromotionalCode,
ProductOrder{product} to Product,
ProductCart{product} to Product
}
relationship ManyToMany {
Recipe{products} to Product{recipes},
Product{relatedCategories} to Category{associatedProducts},
Product{tags} to
/** FIXME: Only created because JHipster needs a bidirectional ManyToMany Relationship, should not be used. */
Tag{products},
Promotion{products} to
/** FIXME: Only created because JHipster needs a bidirectional ManyToMany Relationship, should not be used. */
Product{associatedPromotions},
PromotionalCode{products} to
/** FIXME: Only created because JHipster needs a bidirectional ManyToMany Relationship, should not be used. */
Product{associatedPromotionalCodes},
UserDetails{favorites} to
/** FIXME: Only created because JHipster needs a bidirectional ManyToMany Relationship, should not be used. */
Product{favoritesOf},
UserDetails{preferences} to
/** FIXME: Only created because JHipster needs a bidirectional ManyToMany Relationship, should not be used. */
Tag{preferencesOf}
}
relationship OneToOne {
UserDetails{address} to Address,
UserDetails{user} to User{details} with jpaDerivedIdentifier,
UserDetails{cart} to Cart{user}
}
service * with serviceImpl