@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":Coach2K22Parser" as Coach2K22Parser LOGIC_COLOR
participant ":AddTagCommandParser" as AddTagCommandParser LOGIC_COLOR
participant "p:AddTagCommand" as AddTagCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("tag-add 1 t/friend")
activate LogicManager

LogicManager -> Coach2K22Parser : parseCommand("tag-add-p 1 friend")
activate Coach2K22Parser

create AddTagCommandParser
Coach2K22Parser -> AddTagCommandParser
activate AddTagCommandParser

AddTagCommandParser --> Coach2K22Parser
deactivate AddTagCommandParser

Coach2K22Parser -> AddTagCommandParser : parse(" 1 friend")
activate AddTagCommandParser

create AddTagCommand
AddTagCommandParser -> AddTagCommand
activate AddTagCommand

AddTagCommand --> AddTagCommandParser : p
deactivate AddTagCommand

AddTagCommandParser --> Coach2K22Parser : p
deactivate AddTagCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddTagCommandParser -[hidden]-> Coach2K22Parser
destroy AddTagCommandParser

Coach2K22Parser --> LogicManager : p
deactivate Coach2K22Parser

LogicManager -> AddTagCommand : execute()
activate AddTagCommand

AddTagCommand -> Model : setPerson(personToEdit, editedPerson)
activate Model

Model --> AddTagCommand
deactivate Model

create CommandResult
AddTagCommand -> CommandResult
activate CommandResult

CommandResult --> AddTagCommand
deactivate CommandResult

AddTagCommand --> LogicManager : result
deactivate AddTagCommand

[<--LogicManager
deactivate LogicManager
@enduml
