@startuml
!define LIGHTBLUE
!includeurl https://raw.githubusercontent.com/majimbokibamba/plantumlstyle/master/style.puml
autonumber

skinparam defaultFontSize 14

skinparam sequence {

   ParticipantBackgroundColor transparent
   ParticipantFontSize 16

   ActorFontSize 16
}

participant Test #WHITE
activate Test #white



 Test -> "ctrl:US007Controller" : addAccount(groupID,\npersonID,denomination,\ndescription)
activate "ctrl:US007Controller" #white

 "ctrl:US007Controller" -> "srv:US007Service":addAccount(groupID,\npersonID,denomination,\ndescription)
activate "srv:US007Service" #white

 "srv:US007Service" -> "groupRepo:GroupRepository" : findByID(groupID)
activate "groupRepo:GroupRepository" #white
 "groupRepo:GroupRepository" --> "srv:US007Service" : group

deactivate "groupRepo:GroupRepository" #white

 "srv:US007Service" -> "group:Group" : isResponsible(personID)
activate "group:Group" #white

 "group:Group" -> "group:Group" : responsibles.contains(personID)
activate "group:Group" #white


deactivate "group:Group" #white
deactivate "group:Group" #white

 "srv:US007Service" -> "accountRepo:AccountRepository" : findByID(accountID).isPresent

 create "account:Account"
 "srv:US007Service" -> "account:Account" : create (denomination, description,groupID)

 activate "account:Account" #white
 "account:Account" -> "account:Account" : create accountID

  activate "account:Account" #white

 "account:Account" --> "srv:US007Service" : account

deactivate "account:Account" #white
deactivate "account:Account" #white

 "srv:US007Service" -> "accountRepo:AccountRepository": save(account)

"srv:US007Service" -> "AccountAssembler": mapToDto(account)

activate AccountAssembler #white
create "accountDTO"
"AccountAssembler" -> "accountDTO" : create


"AccountAssembler" --> "srv:US007Service": accountDTO
deactivate "AccountAssembler"

"srv:US007Service" --> "ctrl:US007Controller": accountDTO
deactivate "srv:US007Service"
"ctrl:US007Controller" --> Test: accountDTO
deactivate "ctrl:US007Controller"
deactivate Test #white

@enduml