@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant ":ParserUtil" as ParserUtil LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("delete E01234567")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete E01234567")
activate AddressBookParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
activate DeleteCommandParser

DeleteCommandParser --> AddressBookParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("E01234567")
activate DeleteCommandParser

create ParserUtil
DeleteCommandParser -> ParserUtil : parseNusId("E01234567")
activate ParserUtil

ParserUtil -> DeleteCommandParser
deactivate ParserUtil

create DeleteCommand
DeleteCommandParser -> DeleteCommand : DeleteCommand(nusId)
activate DeleteCommand

DeleteCommand --> DeleteCommandParser :
deactivate DeleteCommand

DeleteCommandParser --> AddressBookParser : D
deactivate DeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
destroy DeleteCommandParser

AddressBookParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> DeleteCommand : execute(m)
activate DeleteCommand

DeleteCommand -> Model : deletePerson(personToDelete)
activate Model

Model --> DeleteCommand
deactivate Model

create CommandResult
DeleteCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteCommand
deactivate CommandResult

DeleteCommand --> LogicManager : r
deactivate DeleteCommand

[<--LogicManager
deactivate LogicManager
@enduml
