Add sequence diagram for inventory

It is deliberately simplified to still be somewhat readable, especially
regarding the names of participants.
This commit is contained in:
Simon Bruder 2023-11-08 18:57:28 +01:00
parent b6f774664f
commit 45f1ae88b3
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 100 additions and 0 deletions

View file

@ -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<UniqueInventoryItem>
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

BIN
src/main/asciidoc/models/design/seq_inventory.svg (Stored with Git LFS) Normal file

Binary file not shown.