-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.plantuml
61 lines (55 loc) · 1.15 KB
/
model.plantuml
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
@startuml Henri Potech Domain Models
package domain {
class Book {
+ coverUrl: URL
+ title: String
+ isbn: String
+ synopsis: String
+ price: Double
' + Book(BookDTO)
+ {static} from(BookDTO): Book
}
class Library {
+ books: List<Book>
}
Library "0..*" *-- Book
interface Offer {
+ apply(Double): Double
}
'{"type":"percentage","value":4}
class Percentage implements Offer {
+ value: Double
}
'{"type":"minus","value":15}
class Minus implements Offer {
+ value: Double
}
'{"type":"slice","sliceValue":100,"value":12}
class Slice implements Offer {
+ sliceValue: Double
+ value: Double
}
class Cart {
+ books: List<Book>
+ availableOffers: List<Offer>
+ bestOffer: Offer?
}
Cart "0..*" o-- Book
Cart "0..*" *-- Offer
Cart "0..1" --> Offer
}
package viewmodel {
class viewmodel.Discount {
+ reducedPrice: Double
+ discountLabel: String
}
class BookCellViewModel {
+ coverUrl: URL
+ title: String
+ basePrice: Double
+ discount: Discount?
+ BookCellViewModel(model.Book, model.Discount)
}
BookCellViewModel --> Discount
}
@enduml