swt23w23/src/main/asciidoc/models/design/catalog.puml

96 lines
3 KiB
Plaintext
Raw Normal View History

' SPDX-License-Identifier: AGPL-3.0-or-later
' SPDX-FileCopyrightText: 2023 swt23w23
2023-11-02 06:33:27 +01:00
@startuml
skinparam linetype ortho
skinparam groupInheritance 2
2023-11-11 18:07:03 +01:00
package javax.money {
class MonetaryAmount
}
package java.util {
class Optional
class Set
}
2023-11-02 06:33:27 +01:00
package Salespoint {
2023-11-09 09:01:25 +01:00
'https://st.inf.tu-dresden.de/SalesPoint/api//org/salespointframework/catalog/Catalog.html'
2023-11-16 18:20:01 +01:00
interface Catalog<T extends Product> {
2023-11-09 09:01:25 +01:00
findByAnyCategory(categories : String) : Streamable<Product>
findByAllCategories(categories : String) : Streamable<Product>
}
2023-11-02 06:33:27 +01:00
interface DataInitializer
2023-11-09 09:01:25 +01:00
class Product {
2023-11-10 23:57:50 +01:00
- name : String
2023-11-11 18:07:03 +01:00
- price : MonetaryAmount
+ Product(name : String, price : MonetaryAmount, [Metric : metric])
2023-11-09 09:01:25 +01:00
+ getID() : Product.Identifier
+ getCategories() : Streamable<String>
2023-11-10 23:57:50 +01:00
'+ addCategory(category : String) : boolean
'+ removeCategory(category : String) : boolean
2023-11-09 09:01:25 +01:00
+ getName() : String
+ getPrice() : MonetaryAmount
2023-11-11 18:07:03 +01:00
+ setPrice(MonetaryAmount) : void
2023-11-10 23:57:50 +01:00
'+ supports(quantity : Quantity) : boolean
2023-11-09 09:01:25 +01:00
}
2023-11-10 23:57:50 +01:00
' class Quantity {
' + getAmount() : @NotNull BigDecimal
' }
2023-11-02 06:33:27 +01:00
}
package catering.order {
enum OrderType
}
2023-11-02 06:33:27 +01:00
package catering.catalog {
interface CateringCatalog {
2023-11-02 06:33:27 +01:00
+ DEFAULT_SORT : Sort
+ findByCategories()
+ findRentablesByCategories()
+ findConsumablesByCategories()
2023-11-02 06:33:27 +01:00
}
CateringCatalog --|> Catalog
2023-11-15 15:35:53 +01:00
2023-11-02 06:33:27 +01:00
class Consumable {
2023-11-11 18:07:03 +01:00
- promotionPrice : MonetaryAmount
- wholesalePrice : MonetaryAmount
+ Consumable(name : String, retailPrice : MonetaryAmount, wholesalePrice : MonetaryAmount, promotionPrice : Optional<MonetaryAmount>, Set<OrderType> categories) : Consumable
2023-11-11 18:07:03 +01:00
+ getPrice() : MonetaryAmount
+ getRetailPrice() : MonetaryAmount
+ setRetailPrice(price : MonetaryAmount) : void
+ getPromotionPrice(): Optional<MonetaryAmount>
+ setPromotionPrice(price : Optional<MonetaryAmount>)
+ getWholesalePrice() : MonetaryAmount
+ setWholesalePrice(price : MonetaryAmount)
2023-11-02 06:33:27 +01:00
}
Consumable --|> Product
2023-11-16 18:20:01 +01:00
Consumable ..> MonetaryAmount
Consumable ..> java.util.Optional
Consumable ..> java.util.Set
Consumable ..> catering.order.OrderType
2023-11-02 06:33:27 +01:00
class Rentable {
- wholesalePrice : MonetaryAmount
+ Rentable(name : String, pricePerHour : MonetaryAmount, wholesalePrice : MonetaryAmount, Set<OrderType> categories) : Rentable
+ getWholesalePrice() : MonetaryAmount
+ setWholesalePrice(price : MonetaryAmount)
2023-11-02 06:33:27 +01:00
}
Rentable --|> Product
Rentable ..> java.util.Set
Rentable ..> catering.order.OrderType
2023-11-10 23:57:50 +01:00
class CatalogDataInitializer {
2023-11-10 23:57:50 +01:00
- rentableCatalog : RentableCatalog
- consumableCatalog : ConsumableCatalog
+ initialize()
2023-11-10 23:57:50 +01:00
}
CatalogDataInitializer ..|> DataInitializer
2023-11-02 06:33:27 +01:00
}
2023-11-16 18:20:01 +01:00
'#TODO: to determine which Products of a Category to offer I need to retrieve information about availability of e.g. Cooks and ServicePersonel from the <<use>>rs or Rentables from the Inventory'
2023-11-02 06:33:27 +01:00
@enduml