Add users sequence diagram

This commit is contained in:
Denis Natusch 2023-11-10 12:30:24 +01:00 committed by Simon Bruder
parent 4052224dba
commit ad88c6e067
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,97 @@
@startuml
participant User
participant "User:customer" as User_customer
participant "User:admin" as User_admin
participant UserController
participant UserManagement
participant UserRepository
participant UserDataInitializier
participant Spring
== Create Admin ==
UserDataInitializier -> UserManagement : createAdmin()
activate UserDataInitializier
activate UserManagement
UserManagement -> UserRepository : "save(User:admin)"
activate User_admin
activate UserRepository
UserManagement <-- UserRepository : User_admin
deactivate UserRepository
UserDataInitializier <-- UserManagement : User
deactivate UserManagement
deactivate UserDataInitializier
deactivate User_admin
== Create Customer ==
UserDataInitializier -> UserManagement : createCustomer(String,String,String)
activate UserDataInitializier
activate UserManagement
UserManagement -> UserRepository : "save(User:customer)"
activate User_customer
activate UserRepository
UserManagement <-- UserRepository : User
deactivate UserRepository
UserDataInitializier <-- UserManagement : User
deactivate UserManagement
deactivate UserDataInitializier
deactivate User_customer
== Delete User (Customer) ==
Spring -> UserController : deleteUser()
activate User_customer
activate Spring
activate UserController
UserController -> UserManagement : deleteUser(UserIdentifier)
activate UserManagement
UserManagement -> UserRepository : deleteById(UserIdentifier)
activate UserRepository
UserManagement <-- UserRepository
deactivate UserRepository
UserController <-- UserManagement
deactivate UserManagement
destroy User_customer
UserController <-- Spring: "redirect:/"
deactivate UserController
deactivate Spring
== View Profile ==
Spring -> UserController : index(Model)
activate User
activate Spring
activate UserController
UserController -> Spring : model.addAttribute("user",User)
UserController <-- Spring : Model
Spring <-- UserController : "profile"
deactivate Spring
deactivate UserController
'technically spring is sending requests to User
'but i wrote these requests in profile.html
'so i'm not sure if i should add them
deactivate User
== Edit Profile ==
Spring -> UserController : editProfile(String:password,String:address,String:username)
activate User
activate Spring
activate UserController
UserController -> User : [!String:username.isBlank()] setUsername(String:username)
UserController <-- User : boolean
UserController -> User : [!String:address.isBlank()] setAddress(String:address)
UserController <-- User : boolean
UserController -> User : [!String:password.isBlank()] setPassword(String:password)
UserController <-- User : boolean
UserController -> UserManagement : save(User:LoggedIn)
activate UserManagement
UserController <-- UserManagement : User
Spring <-- UserController : "redirect:/profile"
deactivate Spring
deactivate UserController
deactivate User
@enduml

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

Binary file not shown.