From 989be26391c2cf2bbd146d3d20e1332f22864ed7 Mon Sep 17 00:00:00 2001 From: Erik Hohlfeld Date: Fri, 19 Jan 2024 13:12:30 +0100 Subject: [PATCH] Update class diagram of orderCatalog --- .../asciidoc/models/design/orderCatalog.puml | 69 ++++++++++--------- .../asciidoc/models/design/orderCatalog.svg | 4 +- .../CatalogControllerIntegrationTests.java | 2 + .../CatalogControllerUnitTests.java | 2 + .../orderCatalog/CatalogUnitTests.java | 2 + 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/src/main/asciidoc/models/design/orderCatalog.puml b/src/main/asciidoc/models/design/orderCatalog.puml index a954ae7..8d82a57 100644 --- a/src/main/asciidoc/models/design/orderCatalog.puml +++ b/src/main/asciidoc/models/design/orderCatalog.puml @@ -9,71 +9,76 @@ package Spring { } package Salespoint { - class Cash class Quantity class UserAccount class Product class Inventory + class Cart } package catering.order { - enum EventType + class OrderController + enum OrderType +} + +package javax.money { + class MonetaryAmount } package catering.orderCatalog { - class OrderCatalogController { - + OrderCatalogController() + class CatalogController { + + CatalogController() + catalog(model : Model) : String + editCatalog(model : Model) : String - + addCatalogEntry(eventType : OrderCatalogEntry.EventType, minimumTimePeriod : int, totalCost : int, model : Model) : String - + removeEntry(catalogEntryID : int) : String - + addProduct(name : String, amount : int, cost : double) : String + + addCatalogEntry(eventType : order.OrderType, totalCost : double, model : Model) : String + + removeEntry(catalogEntryID : long) : String + + addProduct(product : Salespoint.Product, number : Salespoint.Quantity) : String + removeProduct(id : String, model : Model) : String + chooseEvent(events : String) : String + addToCart(catalogEntryID : long) : String } - class OrderCatalogEntry { + class CustomCatalogEntry { - id : Long - - eventType : OrderType + - eventType : order.OrderType - products : Map - - totalCost: double - + OrderCatalogEntry() + - totalCost: javax.money.MonetaryAmount + + CustomCatalogEntry() + getId() : long - + getEventType() : OrderType + + getEventType() : order.OrderType + getProducts() : Map - + getTotalCost() : double - + setEventType(eventType : OrderType) : void - + setTotalCost(totalCost : double) : void + + getTotalCost() : javax.money.MonetaryAmount + + setEventType(eventType : order.OrderType) : void + + setTotalCost(javax.money.MonetaryAmount : double) : void + addProduct(product : Salespoint.Product, count : Salespoint.Quantity) : void + setProducts(Map) : void } - interface OrderCatalogEntryRepository { - + OrderCatalogEntryRepository() - + addCatalogEntry(catalogEntry : OrderCatalogEntry) : boolean - + removeCatalogEntry(catalogEntryID : int) : boolean - + getCatalogEntries() : Set + interface CustomCatalogEntryRepository { + + findAll() : Streamable } class CartService { - - CustomCart cart + - cart : CustomCart + CartService() + getCart() : CustomCart - + setCart(CustomCart cart) : void + + setCart(cart : CustomCart) : void } } -OrderCatalogEntryRepository o---> OrderCatalogEntry -OrderCatalogController ...> OrderCatalogEntryRepository -OrderCatalogEntryRepository --|> Spring.CrudRepository -OrderCatalogController ...> Salespoint.Product -OrderCatalogController ..> Spring.Model -OrderCatalogController ...> Salespoint.Cash -OrderCatalogController ...> Salespoint.Quantity -OrderCatalogController ...> Salespoint.UserAccount -OrderCatalogEntry ...> catering.order.EventType +CustomCatalogEntryRepository o---> CustomCatalogEntry +CatalogController ...> CustomCatalogEntryRepository +CustomCatalogEntryRepository --|> Spring.CrudRepository +CatalogController ...> Salespoint.Product +CatalogController ..> Spring.Model +CatalogController ...> Salespoint.Quantity +CatalogController ...> Salespoint.UserAccount +CustomCatalogEntry ...> catering.order.OrderType CartService ...> catering.order.OrderController -OrderCatalogController ...> Salespoint.Inventory +CatalogController ...> Salespoint.Inventory +CustomCatalogEntry ...> javax.money.MonetaryAmount +CatalogController ...> catering.order.OrderType +catering.order.OrderController ...> Salespoint.Cart @enduml diff --git a/src/main/asciidoc/models/design/orderCatalog.svg b/src/main/asciidoc/models/design/orderCatalog.svg index 331c101..aba11ee 100644 --- a/src/main/asciidoc/models/design/orderCatalog.svg +++ b/src/main/asciidoc/models/design/orderCatalog.svg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2cd557a3ee0bab7f980cdae3fb0f509b5a5812c8055da4ed616f00577d307e92 -size 36599 +oid sha256:1663beae39af7ec4d28924ec0d067af62d31fdfbdf72d0b97ec0a015f4dc0892 +size 47283 diff --git a/src/test/java/catering/orderCatalog/CatalogControllerIntegrationTests.java b/src/test/java/catering/orderCatalog/CatalogControllerIntegrationTests.java index f5ffc71..5a434cf 100644 --- a/src/test/java/catering/orderCatalog/CatalogControllerIntegrationTests.java +++ b/src/test/java/catering/orderCatalog/CatalogControllerIntegrationTests.java @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later +// SPDX-FileCopyrightText: 2023-2024 swt23w23 package catering.orderCatalog; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; diff --git a/src/test/java/catering/orderCatalog/CatalogControllerUnitTests.java b/src/test/java/catering/orderCatalog/CatalogControllerUnitTests.java index bc1c693..e5d68c3 100644 --- a/src/test/java/catering/orderCatalog/CatalogControllerUnitTests.java +++ b/src/test/java/catering/orderCatalog/CatalogControllerUnitTests.java @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later +// SPDX-FileCopyrightText: 2023-2024 swt23w23 package catering.orderCatalog; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/catering/orderCatalog/CatalogUnitTests.java b/src/test/java/catering/orderCatalog/CatalogUnitTests.java index 440a9c1..532b617 100644 --- a/src/test/java/catering/orderCatalog/CatalogUnitTests.java +++ b/src/test/java/catering/orderCatalog/CatalogUnitTests.java @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later +// SPDX-FileCopyrightText: 2023-2024 swt23w23 package catering.orderCatalog; import static org.junit.jupiter.api.Assertions.assertTrue;