@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ModuLightParser" as ModuLightParser LOGIC_COLOR
participant ":DeleteStudentCommandParser" as DeleteStudentCommandParser LOGIC_COLOR
participant "d:DeleteStudentCommand" as DeleteStudentCommand 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("deleteStu 1")
activate LogicManager

LogicManager -> ModuLightParser : parseCommand("deleteStu 1")
activate ModuLightParser

create DeleteStudentCommandParser
ModuLightParser -> DeleteStudentCommandParser
activate DeleteStudentCommandParser

DeleteStudentCommandParser --> ModuLightParser
deactivate DeleteStudentCommandParser

ModuLightParser -> DeleteStudentCommandParser : parse("1")
activate DeleteStudentCommandParser

create DeleteStudentCommand
DeleteStudentCommandParser -> DeleteStudentCommand
activate DeleteStudentCommand

DeleteStudentCommand --> DeleteStudentCommandParser : d
deactivate DeleteStudentCommand

DeleteStudentCommandParser --> ModuLightParser : d
deactivate DeleteStudentCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteStudentCommandParser -[hidden]-> ModuLightParser
destroy DeleteStudentCommandParser

ModuLightParser --> LogicManager : d
deactivate ModuLightParser

LogicManager -> DeleteStudentCommand : execute()
activate DeleteStudentCommand

DeleteStudentCommand -> Model : removeStudent(p)
activate Model

Model --> DeleteStudentCommand
deactivate Model

loop until all scores of the student p are deleted
    DeleteStudentCommand -> Model : removeStudentScore(s)
    activate Model

    Model --> DeleteStudentCommand
    deactivate Model
end


create CommandResult
DeleteStudentCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteStudentCommand
deactivate CommandResult

DeleteStudentCommand --> LogicManager : result
deactivate DeleteStudentCommand

[<--LogicManager
deactivate LogicManager
@enduml
