Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add add module timing implementation to dg #133

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa

This section describes some noteworthy details on how certain features are implemented.

### Adding a ModuleTiming to a Student

Adding a class to a student in ModContacts is done by the command `add_timing i/1 m/CS2103T d/Mon st/0800 et/1200`

The entry point for this command is when the `LogicManager` parses the command, gets a `AddStudentModuleCommand`,
and then executes it.

`AddStudentModuleCommand` performs some validations, then adds the `ModuleTiming` to the designated
`Student` in the `FilteredStudentList` via `Model#addModuleTimingToStudent`.

The following is the sequence diagram for this example.

<img src="images/AddModuleTimingSequenceDiagram.png" />


### \[Proposed\] Undo/redo feature

#### Proposed Implementation
Expand Down
70 changes: 70 additions & 0 deletions docs/diagrams/AddModuleTimingSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@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 ":AddStudentModuleTimingCommandParser" as AddStudentModuleTimingCommandParser LOGIC_COLOR
participant "d:AddStudentModuleTimingCommand" as AddStudentModuleTimingCommand 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("add_timing i/1 m/CS2103T d/Mon st/0800 et/1200")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("add_timing i/1 m/CS2103T d/Mon st/0800 et/1200")
activate AddressBookParser

create AddStudentModuleTimingCommandParser
AddressBookParser -> AddStudentModuleTimingCommandParser
activate AddStudentModuleTimingCommandParser

AddStudentModuleTimingCommandParser --> AddressBookParser
deactivate AddStudentModuleTimingCommandParser

AddressBookParser -> AddStudentModuleTimingCommandParser : parse("i/1 m/CS2103T d/Mon st/0800 et/1200")
activate AddStudentModuleTimingCommandParser

create AddStudentModuleTimingCommand
AddStudentModuleTimingCommandParser -> AddStudentModuleTimingCommand
activate AddStudentModuleTimingCommand

AddStudentModuleTimingCommand --> AddStudentModuleTimingCommandParser :
deactivate AddStudentModuleTimingCommand

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

AddressBookParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> AddStudentModuleTimingCommand : execute(m)
activate AddStudentModuleTimingCommand

AddStudentModuleTimingCommand -> Model : addModuleTimingToStudent(moduleTiming, studentToModify)
activate Model

Model --> AddStudentModuleTimingCommand
deactivate Model

create CommandResult
AddStudentModuleTimingCommand -> CommandResult
activate CommandResult

CommandResult --> AddStudentModuleTimingCommand
deactivate CommandResult

AddStudentModuleTimingCommand --> LogicManager : r
deactivate AddStudentModuleTimingCommand

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/AddModuleTimingSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading