@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ScheduleCommandParser" as ScheduleCommandParser LOGIC_COLOR
participant "s:ScheduleCommand" as ScheduleCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("schedule n/John Doe date/2023-12-31 from/16:30 to/17:30 d/First Session")
activate LogicManager

LogicManager -> ScheduleCommandParser : parseCommand("schedule n/John Doe date/2023-12-31 from/16:30 to/17:30 d/First Session")
activate ScheduleCommandParser

create ScheduleCommand
ScheduleCommandParser -> ScheduleCommand
activate ScheduleCommand

ScheduleCommand --> ScheduleCommandParser : s
deactivate ScheduleCommand

ScheduleCommandParser --> LogicManager : s
deactivate ScheduleCommandParser

LogicManager -> ScheduleCommand : execute()
activate ScheduleCommand

ScheduleCommand -> Model : addAppointment(appointment)
activate Model

Model -> Appointment : constructor(appointment details)
activate Appointment

Appointment --> Model : appointment
deactivate Appointment

Model --> ScheduleCommand
deactivate Model

create CommandResult
ScheduleCommand -> CommandResult
activate CommandResult

CommandResult --> ScheduleCommand
deactivate CommandResult

ScheduleCommand --> LogicManager : result
deactivate ScheduleCommand

[<-- LogicManager
deactivate LogicManager
@enduml
