From 45f1ae88b3137bfd4c82cd4821c844d483b4f5a8 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 8 Nov 2023 18:57:28 +0100 Subject: [PATCH] Add sequence diagram for inventory It is deliberately simplified to still be somewhat readable, especially regarding the names of participants. --- .../asciidoc/models/design/seq_inventory.puml | 97 +++++++++++++++++++ .../asciidoc/models/design/seq_inventory.svg | 3 + 2 files changed, 100 insertions(+) create mode 100644 src/main/asciidoc/models/design/seq_inventory.puml create mode 100644 src/main/asciidoc/models/design/seq_inventory.svg diff --git a/src/main/asciidoc/models/design/seq_inventory.puml b/src/main/asciidoc/models/design/seq_inventory.puml new file mode 100644 index 0000000..48b344e --- /dev/null +++ b/src/main/asciidoc/models/design/seq_inventory.puml @@ -0,0 +1,97 @@ +@startuml +participant Administrator +participant InventoryController +participant Inventory +participant Catalog +participant "item1:UniqueInventoryItem" as item1 +participant "prod1:Product" as prod1 +participant Spring + +== List Inventory == + +Administrator -> InventoryController : list() +activate Administrator +activate InventoryController +InventoryController -> Inventory : findAll() +activate Inventory +InventoryController <-- Inventory : Streamable +deactivate Inventory +InventoryController -> Spring : add result to model as “inventory” +activate Spring +InventoryController <-- Spring : Model +deactivate Spring +Administrator <-- InventoryController : Template “inventory” +deactivate Administrator +deactivate InventoryController + +== Edit Inventory Item == + +Administrator -> InventoryController : edit() +activate Administrator +activate InventoryController +InventoryController -> Inventory : findByProduct() +activate Inventory +InventoryController <-- Inventory : UniqueInventoryItem +deactivate Inventory +InventoryController -> InventoryController : update Product with new data +InventoryController -> Catalog : save Product +activate Catalog +InventoryController <-- Catalog +deactivate Catalog +InventoryController -> Inventory : update Quantity of UniqueInventoryItem +activate Inventory +InventoryController <-- Inventory +deactivate Inventory +Administrator <-- InventoryController : Redirect to “/inventory” +deactivate Administrator +deactivate InventoryController + +== Add Inventory Item == + +Administrator -> InventoryController : add() +activate Administrator +activate InventoryController +create prod1 +InventoryController -> prod1 : new +activate prod1 +InventoryController -> Catalog : save() +activate Catalog +InventoryController <-- Catalog : Product +deactivate Catalog +create item1 +InventoryController -> item1 : new +activate item1 +InventoryController -> Inventory : save() +activate Inventory +InventoryController <-- Inventory : UniqueInventoryItem +deactivate Inventory +Administrator <-- InventoryController : Redirect to “/inventory” +'deactivate prod1 +'deactivate item1 +deactivate Administrator +deactivate InventoryController + +== Delete Inventory Item == +Administrator -> InventoryController : delete() +activate Administrator +activate InventoryController +InventoryController -> Inventory : findByProduct() +activate Inventory +InventoryController <-- Inventory : UniqueInventoryItem +deactivate Inventory +InventoryController -> Inventory : delete() +activate Inventory +Inventory -> item1 +destroy item1 +InventoryController <-- Inventory +deactivate Inventory +InventoryController -> Catalog : delete() +activate Catalog +Catalog -> prod1 +destroy prod1 +InventoryController <-- Catalog +deactivate Catalog +Administrator <-- InventoryController : Redirect to “/inventory” +deactivate InventoryController +deactivate Administrator +@enduml diff --git a/src/main/asciidoc/models/design/seq_inventory.svg b/src/main/asciidoc/models/design/seq_inventory.svg new file mode 100644 index 0000000..c836449 --- /dev/null +++ b/src/main/asciidoc/models/design/seq_inventory.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af9539a10b8ceadfcf38caf30b94f6e877d75d34dfe2613645ca9d453949a289 +size 24661