-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproductorder-jdl.jh
More file actions
104 lines (87 loc) · 2.73 KB
/
productorder-jdl.jh
File metadata and controls
104 lines (87 loc) · 2.73 KB
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
// From https://github.com/PacktPublishing/Full-Stack-Development-with-JHipster
// License : https://github.com/PacktPublishing/Full-Stack-Development-with-JHipster/blob/master/LICENSE
/* Online fashion store */
// =================================
// Microservice productorder
// =================================
// SHA1 is 160 bits-long (20 bytes)
SHA_LEN = 40
IMAGE_MAX_BYTES = 5000000
/** Product sold by the Online store */
entity Product {
sku String required /* TODO pattern */
upc String required /* TODO pattern */
name String required
description TextBlob
price BigDecimal required min(0)
size ProductSize required
colors String pattern(/^([a-z]+,)*[a-z]+$/)
/** For uploading the image */
image ImageBlob maxbytes(IMAGE_MAX_BYTES)
/** For caching with HTTP header Etag and If-None-Match */
imageSha1 String minlength(SHA_LEN) maxlength(SHA_LEN) pattern(/[a-f0-9]{40}/)
/** For the content delivery network */
imageCdnUrl String /* TODO pattern */
/** For caching with HTTP header Etag and If-None-Match */
thumbnailSha1 String minlength(SHA_LEN) maxlength(SHA_LEN) pattern(/[a-f0-9]{40}/)
/** For the content delivery network */
thumbnailCdnUrl String /* TODO pattern */
}
enum Size {
XS, S, M, L, XL, XXL
}
entity ProductCategory {
name String required
description String
}
entity Customer {
userId Long required
firstName String required
lastName String required
gender Gender required
email String required
phone String required
addressLine1 String required
addressLine2 String
city String required
country String required
}
enum Gender {
MALE, FEMALE, OTHER
}
entity ProductOrder {
placedDate Instant required
status OrderStatus required
invoiceId Long
code String required
}
enum OrderStatus {
COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
quantity Integer required min(0)
totalPrice BigDecimal required min(0)
status OrderItemStatus required
}
enum OrderItemStatus {
AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}
//relationship OneToOne {
// Customer{user} to User
//}
relationship ManyToOne {
OrderItem{product} to Product
}
relationship OneToMany {
Customer{order} to ProductOrder{customer},
ProductOrder{orderItem} to OrderItem{order},
ProductCategory{product} to Product{productCategory}
}
dto Product, Customer, ProductOrder, OrderItem, ProductCategory with mapstruct
//angularSuffix * with store
//search * with elasticsearch
//filter *
service Product, Customer, ProductOrder, OrderItem, ProductCategory with serviceImpl
paginate Product with infinite-scroll
paginate Customer, ProductOrder, OrderItem, ProductCategory with pagination
microservice Product, Customer, ProductOrder, OrderItem, ProductCategory with productorder