Update order package-diagram to match current implementation

This closes #109.
This commit is contained in:
Mathis Kral 2023-12-11 21:07:16 +01:00 committed by Simon Bruder
parent b9f67b452a
commit 7b86f96976
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 90 additions and 56 deletions

View file

@ -9,7 +9,9 @@ package Spring {
} }
package Salespoint { package Salespoint {
interface OrderManager <T extends Order> interface OrderManagement <CustomOrder>
interface Repository<CustomOrder, Order.OrderIdentifier>
class UniqueInventory<UniqueInventoryItem>
class Cart class Cart
class Cash class Cash
class Order class Order
@ -22,66 +24,98 @@ package Salespoint {
Product .. N2 Product .. N2
} }
package catalog {
package catering.order { interface CateringCatalog
class CustomOrder {
- start : LocalDateTime
- finish : LocalDateTime
+ getDurationInSeconds(start:LocalDateTime,finish:LocalDateTime): long
+ getDurationInHours(start:LocalDateTime,finish:LocalDateTime): long
+ min(a:LocalDateTime,b:LocalDateTime): LocalDateTime
+ max(b:LocalDateTime,b:LocalDateTime): LocalDateTime
+ getDurationInSecondsDuringMonth(month:YearMonth): long
}
CustomOrder ..> time.LocalDateTime
CustomOrder ..> time.YearMonth
enum EventType {
EVENT_CATERING
RENT_A_COOK
BREAKFAST_SERVICE
PARTY_SERVICE
} }
note "This could be extended, too" as N1 package order {
class OrderController { class OrderController {
+ OrderController() +OrderController(oM: OrderManagement<CustomOrder>, cOR: CustomOrderRepository, inv: UniqueInventory<UniqueInventoryItem>, cat: CateringCatalog, stM: StaffManagement)
+ initializeCart() : Cart +orders(model: Model, userAccount: Optional<UserAccount>): String
+ planEvent(model : Model) : String +orders(model: Model): String
+ addProduct(productForm : ProductForm, model : Model) : String +orders(model: Model, String day): String
+ removeProduct(product : Product, model : Model) : String ~initializeCart(): CustomCart
+ checkout(userAccount : UserAccount, model : Model) : String +event(model: Model, cart: CustomCart): String
+ getOrders(model : Model) : String +addEmployeeToCart(empId: long, cart: CustomCart): String
+ removeOrder(order : Order) : boolean +removeEmployeeFromCart(empId: long, cart: CustomCart): String
+removeOrder(orderId: Order.OrderIdentifier, userAccount: Optional<UserAccount>): String
+addProduct(product: Product, number: int, cart: CustomCart): String
+removeProduct(itemId: String, cart: CustomCart): String
+changeDate(start: LocalDate, startHour: Optional<Integer>, finish: LocalDate, finishHour: Optional<Integer>, cart: CustomCart): String
+checkout(cart: CustomCart, userAccount: Optional<UserAccount>): String
+changeOrderType(orderType: String, cart: CustomCart): String
+{static}findFreeAmountInInterval(product: Rentable, start: LocalDatetime, finish: LocalDatetime, inv: UniqueInventory<UniqueInventoryItem>, cOR: CustomOrderRepository): Quantity
+calender(model: Model): String
+invoice(model: Model, userAccount: UserAccount, order: Order): String +invoice(model: Model, userAccount: UserAccount, order: Order): String
} }
class ProductForm interface CustomOrderRepository {
+findOrdersByInterval(start: LocalDateTime, finish: LocalDateTime): Streamable<CustomOrder>
OrderController ---> OrderManager : "-orderManager"
OrderController ---> Cart : "-cart"
OrderController ..> Model
OrderController ...> UserAccount
OrderController ...> OrderStatus
OrderController ...> Cash
OrderController ...> Quantity
OrderController ...> CustomOrder
CustomOrder o--- "1" EventType : -eventType
OrderController ...> ProductForm
N1 ..> EventType
} }
OrderController ...> Salespoint.Product class CustomCart {
CustomOrder --|> Salespoint.Order -formatterPattern: String
CustomOrder ...> time.LocalDateTime +CustomCart(orderType: OrderType, start: LocalDateTime, finish: LocalDateTime)
CustomOrder ...> time.DateTimeFormatter +addEmployee(employee: Employee): boolean
OrderController .....> catering.orderCatalog.OrderCatalogEntry +removeEmployee(employee: Employee): boolean
+addStaffTo(order: CustomOrder): CustomOrder
package time { +addRentablesTo(order: CustomOrder, inv: UniqueInventory<UniqueInventoryItem>): CustomOrder
class LocalDateTime +getDurationInHours(): int
class DateTimeFormatter +getPrice(): MonetaryAmount
class YearMonth +clear()
} }
class CustomOrder {
-id: Long
-formatterPattern: String
+CustomOrder()
+CustomOrder(identifier: UserAccount.UserAccountIdentifier, cart: CustomCart)
+getDurationInSeconds(): long
-getDurationInHours(start: LocalDateTime, finish: LocalDateTime): long
-{static}min(a: LocalDateTime, b: LocalDateTime): LocalDateTime
-{static}max(a: LocalDateTime, b: LocalDateTime): LocalDateTime
+getDurationInSecondsDuringMonth(month: YearMonth): long
+addEmployee(employee: Employee): boolean
}
enum OrderType {
+toHumanReadable(): String
}
}
package javax.money {
interface MonetaryAmount
}
OrderController o--------> OrderManagement: -orderManagement
OrderController o--------> CustomOrderRepository: -customOrderRepository
CustomOrderRepository --------|> Repository
OrderController o--------> UniqueInventory: -inventory
OrderController o--------> catalog.CateringCatalog: -catalog
OrderController o--------> staff.StaffManagement: -staffManagement
OrderController ........> Product
OrderController ........> Cash
OrderController ........> OrderStatus
OrderController ........> UserAccount
OrderController ........> time.LocalDate
OrderController ........> time.LocalDateTime
OrderController ........> Salespoint.Quantity
OrderController ........> Spring.Model
CustomCart -------|> Cart
CustomCart o-------> staff.Employee: -staff: Set
CustomCart o-------> OrderType: -orderType
CustomCart o-------> time.LocalDateTime: -start
CustomCart o-------> time.LocalDateTime: -finish
CustomCart ........> javax.money.MonetaryAmount
CustomOrder -------|> Order
CustomOrder o-------> staff.Employee: -staff: Set
CustomOrder o-------> OrderType: -orderType
CustomOrder o-------> time.LocalDateTime: -start
CustomOrder o-------> time.LocalDateTime: -finish
CustomOrder .......> UserAccount
CustomOrder .......> time.YearMonth
@enduml @enduml

BIN
src/main/asciidoc/models/design/order.svg (Stored with Git LFS)

Binary file not shown.