
@startuml
'https://plantuml.com/sequence-diagram
title User Story 3 Sequence Diagram: change profile of user account

actor Admin as "Admin"

autonumber 1
Admin -> ":ChangeProfileUI" ++: Starts profile change process
autonumber 1.1
Admin <-- ":ChangeProfileUI" --: Requests data (email)
autonumber 2
Admin -> ":ChangeProfileUI" ++: Inputs requested data
autonumber 2.1
":ChangeProfileUI" -> ":ChangeProfileController" ++: changeProfile(email)
autonumber 2.2
":ChangeProfileController" -> ":Organization" ++: getAccountContainer()
autonumber 2.3
":Organization" --> ":ChangeProfileController" --: AccountContainer
autonumber 2.4
":ChangeProfileController" -> ":UserAccountContainer" ++: getAccount(email)
loop until result == true
autonumber 2.5
":UserAccountContainer" -> ":UserAccountContainer" : result = hasEmail(email)
end
autonumber 2.6
":UserAccountContainer" -> ":UserAccountMapper" ++: createDTO(account)
autonumber 2.7
":UserAccountMapper" -> "accountDTO : UserAccountDTO" **: createDTO(account)
deactivate "accountDTO : UserAccountDTO"
autonumber 2.8
":UserAccountMapper" --> ":UserAccountContainer" : accountDTO
deactivate ":UserAccountMapper"
autonumber 2.9
":UserAccountContainer" --> ":ChangeProfileController" --: accountDTO
autonumber 2.10
":ChangeProfileController" --> ":ChangeProfileUI" --: accountDTO
autonumber 2.11
":ChangeProfileUI" --> Admin --: Shows account and asks for confirmation
autonumber 3
Admin -> ":ChangeProfileUI" ++: Confirms account
autonumber 3.1
Admin <-- ":ChangeProfileUI" --: Requests data (profileName)
autonumber 4
Admin -> ":ChangeProfileUI" ++: Inputs requested data
autonumber 4.1
":ChangeProfileUI" -> ":ChangeProfileController" ++: setProfile(accountDTO, profileName)
autonumber 4.2
":ChangeProfileController" -> ":Organization" ++: getUserAccount()
autonumber 4.3
":Organization" --> ":ChangeProfileController" --: UserAccount

autonumber 4.7
":ChangeProfileController" -> "account:UserAccount" : setProfile(profileName)
autonumber 4.9
":ChangeProfileController" --> ":ChangeProfileUI" --: true
autonumber 4.10
Admin <-- ":ChangeProfileUI" : Confirms successful change

@enduml



