Skip to content

Commit

Permalink
Merge branch 'Branch-v1.4' of https://github.com/AY2324S1-CS2103T-T10…
Browse files Browse the repository at this point in the history
…-3/tp into v1.4c
  • Loading branch information
Kailash201 committed Nov 13, 2023
2 parents 4efd8a1 + 7697989 commit d98ca38
Show file tree
Hide file tree
Showing 18 changed files with 254 additions and 526 deletions.
36 changes: 10 additions & 26 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ Step 2. `DeletePersonCommand` is executed, in which `Model#deletePerson("Alex Ye

</box>

Step 3. `Model#deletePerson()` will also call `AddressBook#removePerson(Alex Yeoh)` which will remove the target contact from the contact list while removing it from all the groups it was part of.
Step 3. `Model#deletePerson()` will also call `AddressBook#removePerson(Alex Yeoh)` which will remove the target contact from the contact list while removing it from all the groups it was part of by calling `Group#removePerson(Alex Yeoh)`.

The following sequence diagram shows how the Delete Person operation works:

Expand All @@ -300,7 +300,7 @@ The following sequence diagram shows how the Delete Person operation works:

The Delete Group command mechanism behaves the same as the Delete Person command above, except it deletes the target `Group` object instead of the `Person` object.

Additionally, `AddressBook#removeGroup(Group g)` will remove the target group 'g' from the group lists of all the members that were a part of it.
Additionally, `AddressBook#removeGroup(Group g)` will remove the target group 'g' from the group lists of all the members that were a part of it by calling `Person#removeGroup(Group g)`.

#### Design Considerations

Expand Down Expand Up @@ -740,39 +740,23 @@ The List Time from Group command mechanism behaves the same as the List Time fro
--------------------------------------------------------------------------------------------------------------------

### 3.11. Find Free Time

#### Implementation

The FindFreeTime mechanism is facilitated by the `Model`, `Group` and `Person` class.
It retrieves `Group` from `Model` to find a free time between group members in `listOfGroupMates` in `Group`
with a duration specified, `Duration`.
The operation is exposed to `Model` interface as `Model#findGroup`.
The FindFreeTime mechanism is facilitated by the `Model`, `Group` and `Person` class. It retrieves `Group` from `Model` to find a free time between group members in `listOfGroupMates` in `Group` with a duration specified, `Duration`. The operation is exposed to `Model` interface as `Model#findGroup`.


Given below is an example usage scenario and how the list mechanism behaves at each step.

**Step 1:** User launches the application.

**Step 2:** User executes `findfreetime g/CS2103 d/60` command to find a common meeting time with duration 60 minutes
for group CS2103.

**Step 3:** FindFreeTimeCommandParser parses the group name CS2103 and duration 60, ensuring that duration
is a valid integer in terms of minutes, and returns a FindFreeTimeCommand.

**Step 4:** FindFreeTimeCommand calls `Model#findGroup(groupName)` to retrieve the group with matching name.
If group does not exist, then an error is thrown.

**Step 4:** FindFreeTimeCommand calls `Group#findFreeTime(duration)`, to retrieve the all common timeslots between
`listOfGroupMates` in `Group` and return them in a list should they accommodate the duration stated.

**Step 1:** User launches the application.
**Step 2:** User executes `findfreetime g/CS2103 d/60` command to find a common meeting time with duration 60 minutes for group CS2103.
**Step 3:** FindFreeTimeCommandParser parses the group name CS2103 and duration 60, ensuring that duration is a valid integer in terms of minutes, and returns a FindFreeTimeCommand.
**Step 4:** FindFreeTimeCommand calls `Model#findGroup(groupName)` to retrieve the group with matching name. If group does not exist, then an error is thrown.
**Step 4:** FindFreeTimeCommand calls `Group#findFreeTime(duration)`, to retrieve the all common timeslots between `listOfGroupMates` in `Group` and return them in a list should they accommodate the duration stated.
**Note:**
If group is empty, having no group mates in `listOfGroupMates` an error is thrown.
<br>
If any group mate has not key in their free time slots using `addtime`, an error is thrown.

If group is empty, having no group mates in `listOfGroupMates` an error is thrown. If any group mate has not key in their free time slots using `addtime`, an error is thrown.

The following activity diagram summarizes what happens when a user executes a FindFreeTime command:

<puml src="diagrams/FindFreeTimeActivityDiagram.puml" alt="FindFreeTimeActivityDiagram" />
--------------------------------------------------------------------------------------------------------------------

## 4. Planned Enhancements
Expand Down
268 changes: 115 additions & 153 deletions docs/UserGuide.md

Large diffs are not rendered by default.

70 changes: 0 additions & 70 deletions docs/diagrams/DeleteGroupSequenceDiagram.puml

This file was deleted.

14 changes: 14 additions & 0 deletions docs/diagrams/DeletePersonSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ end box

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

[-> LogicManager : execute("delete n/Alex Yeoh")
Expand Down Expand Up @@ -52,6 +54,18 @@ activate DeletePersonCommand
DeletePersonCommand -> Model : deletePerson("Alex Yeoh")
activate Model

Model -> AddressBook : removePerson(Alex Yeoh)
activate AddressBook

AddressBook -> Group : removePerson(Alex Yeoh)
activate Group

Group --> AddressBook
deactivate Group

AddressBook --> Model
deactivate AddressBook

Model --> DeletePersonCommand
deactivate Model

Expand Down
29 changes: 29 additions & 0 deletions docs/diagrams/FindFreeTimeActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:Start FindFreeTime of Group 2103 for duration 60 minutes;
:Check if duration is valid;
if () then ([Duration valid])
:Check if group exists;
if () then ([Group exists])
:Check that all group members have free time slot;
if () then ([All Members have time slot keyed in])
:Find free time of members in Group 2103;
if () then ([Members common time slot allow 60 minutes])
:Add common timeslot to list;
else ([else])
:Don't add common timeslot to list;
endif
else ([else])
:ProjectPRO throws Error;
endif
else ([else])
:ProjectPRO throws Error;
endif
else ([else])
:ProjectPRO throws Error;
endif
stop

@enduml
79 changes: 79 additions & 0 deletions docs/diagrams/FindFreeTimeSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
@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 ":FindFreeTimeParser" as FindFreeTimeParser LOGIC_COLOR
participant "a:FindFreeTimeCommand" as FindFreeTimeCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute(findfreetime g/CS2100 d/60)
activate LogicManager

LogicManager -> AddressBookParser : parseCommand(findfreetime g/CS2100 d/60 ...)
activate AddressBookParser

create FindFreeTimeParser
AddressBookParser -> FindFreeTimeParser
activate FindFreeTimeParser

FindFreeTimeParser --> AddressBookParser
deactivate FindFreeTimeParser


AddressBookParser -> FindFreeTimeParser: parse("n/personName g/groupName")
activate FindFreeTimeParser

create FindFreeTimeCommand
FindFreeTimeParser -> FindFreeTimeCommand
activate FindFreeTimeCommand

FindFreeTimeCommand --> FindFreeTimeParser : f
deactivate FindFreeTimeCommand

FindFreeTimeParser --> AddressBookParser : f
deactivate FindFreeTimeParser


LogicManager -> FindFreeTimeCommand : execute()
activate FindFreeTimeCommand

FindFreeTimeCommand -> Model : findGroup("CS2100")
activate Model

Model -> AddressBook : findGroup("CS2100")
activate AddressBook

AddressBook --> Model : g
deactivate AddressBook

Model -> Group : areallfree(...)
activate Group
Group --> Model
deactivate Group

Model -> Group :findfreetime(..)
activate Group
Group --> Model : TimeIntervalList t
deactivate Group

Model -> FindFreeTimeCommand : TimeIntervalList t
deactivate Model

create CommandResult
FindFreeTimeCommand -> CommandResult
activate CommandResult

CommandResult --> FindFreeTimeCommand
deactivate CommandResult

@enduml
21 changes: 0 additions & 21 deletions docs/diagrams/UndoRedoState0.puml

This file was deleted.

23 changes: 0 additions & 23 deletions docs/diagrams/UndoRedoState1.puml

This file was deleted.

21 changes: 0 additions & 21 deletions docs/diagrams/UndoRedoState2.puml

This file was deleted.

21 changes: 0 additions & 21 deletions docs/diagrams/UndoRedoState3.puml

This file was deleted.

21 changes: 0 additions & 21 deletions docs/diagrams/UndoRedoState4.puml

This file was deleted.

Loading

0 comments on commit d98ca38

Please sign in to comment.