-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathe-commerce-monolith.jdl
84 lines (70 loc) · 1.71 KB
/
e-commerce-monolith.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
application {
config {
baseName store
packageName com.jhipster.demo.store
authenticationType jwt
prodDatabaseType mysql
buildTool gradle
clientFramework react
enableTranslation true
nativeLanguage en
languages [en, nl]
}
entities *
}
/** Product sold by the Online store */
entity Product {
name String required
description String
price BigDecimal required min(0)
productSize Size required
image ImageBlob
}
enum Size {
S, M, L, XL, XXL
}
entity ProductCategory {
name String required
description String
}
entity CustomerDetails {
gender Gender required
phone String required
addressLine1 String required
addressLine2 String
city String required
country String required
}
enum Gender {
MALE, FEMALE, OTHER
}
entity ShoppingCart {
placedDate Instant required
status OrderStatus required
totalPrice BigDecimal required min(0)
paymentMethod PaymentMethod required
paymentReference String
}
enum OrderStatus {
COMPLETED, PAID, PENDING, CANCELLED, REFUNDED
}
enum PaymentMethod {
CREDIT_CARD(card), IDEAL(ideal)
}
entity ProductOrder {
quantity Integer required min(0)
totalPrice BigDecimal required min(0)
}
relationship OneToOne {
CustomerDetails{user(login) required} to User with builtInEntity
}
relationship ManyToOne {
ProductOrder{product(name) required} to Product
}
relationship OneToMany {
CustomerDetails{cart} to ShoppingCart{customerDetails required},
ShoppingCart{order} to ProductOrder{cart required},
ProductCategory{product} to Product{productCategory(name) required}
}
service * with serviceClass
paginate Product, CustomerDetails, ProductCategory with pagination