Skip to content

Commit

Permalink
Merge pull request #281 from ZD292/Branch-v1.4
Browse files Browse the repository at this point in the history
Update UG
  • Loading branch information
nicholastng authored Nov 13, 2023
2 parents e46d42d + fd661b8 commit 080ad6a
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 82 deletions.
67 changes: 65 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Below is an activity diagram that illustrates the control flow for Delete Person

--------------------------------------------------------------------------------------------------------------------

### Group Person
### Grouping and Ungrouping a Person

#### Implementation

Expand All @@ -358,10 +358,21 @@ Given below is an example usage scenario and how the group mechanism behaves at

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

**Step 2:** The user executes `group n/personName g/groupName` to group a person `personName` into group `groupName`. `GroupPersonCommandParser` parses the personName and groupName ensuring the input is valid and creates a `GroupPersonCommand`, which calls `Model#groupPerson(personName, groupName)`. The model retrieves the existing person and group from the addressBook. Should a person or group not exist, it throws an error. Model calls `Model#assignGroup(Person person, Group group)` which adds a group to a person's groupList and person to the personList in group.
**Step 2:** The user executes `group n/personName g/groupName` to group a person `personName` into group `groupName`. `

**Step 3.** GroupPersonCommandParser` parses the personName and groupName ensuring the input is valid and creates a `GroupPersonCommand`

**Step 4.** GroupPersonCommand calls `Model#groupPerson(personName, groupName)`. The model retrieves the existing person and group from the addressBook.

**Step 5.** Model calls `Model#assignGroup(Person person, Group group)` which adds a group to a person's groupList and person to the personList in group.

**Note:** Should a person or group not exist, an error is thrown, displaying the missing entity to the User.
<br>
Ungroup works in the same way as group except the use of Command word ungroup

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


#### Design Considerations:

**Aspect: Whether to store references in both person and group**
Expand All @@ -374,6 +385,58 @@ The following activity diagram summarizes what happens when a user executes a ne
* Pros: Easier to load from storage. One centralized place to store data. Less coupling.
* Cons: Searching might become more costly.

**Aspect: Error Messages**

* **Alternative 1 (current choice):** Print specific error messages.
* Pros: More intuitive for User to figure out what part of the inputs went wrong.
* Cons: A larger choice of what we want to categorise as specific error messages will be more time-consuming to implement.

* **Alternative 2: Print general error messages**
* Pros: Easier to implement and low maintenance when use case expands
* Cons: User might not know what went wrong


--------------------------------------------------------------------------------------------------------------------

### FindFreeTime

#### 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`.


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.

**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.


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





--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------

### List
Expand Down
57 changes: 29 additions & 28 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Welcome back to ProjectPRO. Simply head over to our Features section to gain ins
- For Mac Users:
![MACGUIDE](images/UG/QUICKSTART3.png)
- For Windows Users:
![WINDOWSGUIDE](images/UG/QUICKSTART4.png)

4. Launch ProjectPRO.
1. Open a command terminal
Expand Down Expand Up @@ -614,8 +615,8 @@ You list all available time slots of your contacts.
- Provide the full name of the contact using the `n/` prefix.
<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h4 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h4>
<p style="font-size:9px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">NAME</code>
must be alphanumeric and cannot be blank.</p>
</div>

Expand All @@ -629,7 +630,7 @@ You list all available time slots of your contacts.
![](images/features/Managetime_listtimecontact.png)

<div align="center">
<p style="font-size: 11px; font-style: italic;">We see that Alex Yeoh is free on Mondays from 1400 - 1600</p>
<p style="font-size: 13px; font-style: italic;">We see that Alex Yeoh is free on Mondays from 1400 - 1600</p>
</div>

**Potential error(s):**
Expand All @@ -647,8 +648,8 @@ You can add a meeting time slot for your group.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
must be alphanumeric and cannot be blank.</p>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
must be a time slot within a weekly schedule.</p>
Expand All @@ -657,8 +658,8 @@ You can add a meeting time slot for your group.
</div>
<p></p>
<div style="border-left: 4px solid #d9534f; background-color: #FFD4D4; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Warning!</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #FB9A9A; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Warning!</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #FB9A9A; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
can be added even if members are not available. Do coordinate with your group members on the most suitable time slots.</p>
</div>

Expand All @@ -669,7 +670,7 @@ You can add a meeting time slot for your group.
![](images/features/Managetime_addmeeting.png)

<div align="center">
<p style="font-size: 11px; font-style: italic;">You have added a CS2103T meeting on Mondays from 1400 - 1600</p>
<p style="font-size: 13px; font-style: italic;">You have added a CS2103T meeting on Mondays from 1400 - 1600</p>
</div>

**Potential error(s):**
Expand All @@ -688,12 +689,12 @@ You can remove meeting times from your groups.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
must be alphanumeric and cannot be blank.</p>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
must be a time slot within a weekly schedule.</p>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">MEETING_TIME</code>
must be a time slot already added to the group.</p>
</div>
<p></p>
Expand All @@ -705,7 +706,7 @@ You can remove meeting times from your groups.
![](images/features/Managetime_deletetimegroup.png)

<div align="center">
<p style="font-size: 11px; font-style: italic;">You have deleted the CS2103T meeting on Mondays from 1400 - 1600</p>
<p style="font-size: 13px; font-style: italic;">You have deleted the CS2103T meeting on Mondays from 1400 - 1600</p>
</div>

**Potential error(s):**
Expand All @@ -723,8 +724,8 @@ You list meeting time for your groups.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
must be alphanumeric and cannot be blank.</p>
</div>
<p></p>
Expand Down Expand Up @@ -754,16 +755,16 @@ You can find a meeting time slot for your group where everyone is available.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
must be alphanumeric and cannot be blank.</p>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">DURATION</code>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">DURATION</code>
must be a whole number representing the meeting duration in minutes.</p>
</div>
<p></p>
<div style="border-left: 4px solid #d9534f; background-color: #FFD4D4; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Warning!</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #FB9A9A; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Warning!</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #FB9A9A; padding: 2px; border-radius: 2px;">GROUP_NAME</code>
must contain contacts with their free time slots. </p>
</div>

Expand All @@ -776,7 +777,7 @@ You can find a meeting time slot for your group where everyone is available.
![](images/features/Managetime_findfreetime.png)

<div align="center">
<p style="font-size: 11px; font-style: italic;">You can coordinate meetings easily</p>
<p style="font-size: 13px; font-style: italic;">You can coordinate meetings easily</p>
</div>


Expand All @@ -797,8 +798,8 @@ You can view the link to our UserGuide.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
No additional input required.</p>
</div>
<p></p>
Expand All @@ -809,7 +810,7 @@ You can view the link to our UserGuide.
![](images/features/Generalcommand_help.png)

<div align="center">
<p style="font-size: 11px; font-style: italic;">You can follow the link to get help!</p>
<p style="font-size: 13px; font-style: italic;">You can follow the link to get help!</p>
</div>


Expand All @@ -826,8 +827,8 @@ Clears all entries from the contact list.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
No additional input required.</p>
</div>
<p></p>
Expand Down Expand Up @@ -857,8 +858,8 @@ You can exit ProjectPRO.

<p></p>
<div style="border-left: 4px solid #56494C; background-color: #F1DEC6; color: #000; padding: 10px; margin: 5px 0; border-radius: 6px;">
<h3 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h3>
<p style="color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
<h5 style="color: #56494C; margin: 0 0 5px 0; padding: 0;">Acceptable values</h5>
<p style="font-size:13px; color: #000; margin: 8px 0;"><code style="color: #555; background-color: #F0C481; padding: 2px; border-radius: 2px;">User Input</code>
No additional input required.</p>
</div>
<p></p>
Expand Down
Binary file added docs/images/UG/QUICKSTART4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 080ad6a

Please sign in to comment.