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

Update UG, DG, PPP for Jie Liang #163

Merged
merged 7 commits into from
Nov 12, 2018
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
53 changes: 32 additions & 21 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ but its behaviour depends on implementation of its subclass.
=== Model component

.Structure of the Model Component
image::ModelClassDiagram.png[width="600"]
image::ModelClassDiagram.png[width="620"]
// end::Model[]

*API* : link:{repoURL}/src/main/java/seedu/address/model/Model.java[`Model.java`]

// end::Model[]
The `Model`,

* stores a `UserPref` object that represents the user's preferences.
Expand All @@ -247,6 +247,7 @@ image:ModelClassBetterOopDiagram.png[width="800"]

.Structure of the Storage Component
image::StorageClassDiagram.png[width="800"]
// end::Storage[]

*API* : link:{repoURL}/src/main/java/seedu/address/storage/Storage.java[`Storage.java`]

Expand All @@ -255,7 +256,6 @@ The `Storage` component,
* can save `UserPref` objects in json format and read it back.
* can save the Address Book and Event List data in xml format and read it back.

// end::Storage[]
[[Design-Commons]]
=== Common classes

Expand Down Expand Up @@ -303,44 +303,53 @@ image::SortSequenceDiagram.png[width="650"]
==== Current Implementation

The `invite` command allows users to add attendees to an existing event, which is represented by an `Event` object.
The command currently only allows users to add a single person to an event, based on the indices on the UI.
The command currently only allows users to add a single person to an event at a time, based on the indices on the UI.
This command adds the to-be-invited `Person` 's email, which is unique, to the chosen `Event`, so that the attendees of a particular event is recorded.

The adding of attendees is facilitated by the class: `Attendees`, a list of emails of type `String`.
The adding of attendees is facilitated by the class: `Attendees`, which consists of a list of emails of type `String`.

image::EventClassDiagram.png[width="300"]
.Class Diagram of Event and Attendee class
image::EventAndAttendeeClassDiagram.png[width="800"]

The following is a more detailed description of the `Attendee` class:

* `Attendees`
** Each `Event` object has an `Attendees`, which is a list of the emails of the different `Person` attending the event.
** Each `Event` object consist of an `Attendees` object, which is a list of the emails of the different `Person` attending the event.
** This class is a wrapper class around the internal representation of a `Set` of emails.
** Only the email of the `Person` is recorded in an `Event`, as the email should be unique and uneditable.

Storing only the *email* of `Person` in the `Attendees` object of `Event` saves memory storage and facilitates the `select` feature. As we select a person, we can simply iterate through the event list and check whether the person's email is in the attendees list.
Storing only the *email* of `Person` in the `Attendees` object of `Event` saves memory storage and facilitates the `select`, `viewmine` and `selectEvent` feature.
As we select a person, we can simply iterate through the event list and check whether the person's email is in the attendees list.
Similarly, as we select an event, we can first obtain the list of emails from the `Attendees`, and filter the employee list accordingly.

This command only executes successfully if the event does not not clash with the person's schedule.

Given below is an illustration to describe the detection of whether two events clash, which is facilitated by the method `hasClash` in `Event`:

image::EventClashDiagram.png[width="400"]
.Logic behind `Event#hasClash`
image::EventClashDiagram.png[width="450"]

Thus, to check whether the event clashes with an employee's schedule, we iterate through the `ObservableList<Event>` and check whether the `Event` 1) contains the employee's email in the `Attendee` and 2) clashes with the selected event.

The `Event#hasClash` is widely used in other features such as `addEvent` and `editEvent` to ensure that
****
`Event#hasClash` is widely used in other features such as `addEvent` and `editEvent` to ensure that

1. Different events are not held at the same location and time.

2. An employee do not have two events he/she needs to attend at the same time.
****

Implementation of `RemoveCommand` is similar to `InviteCommand`, but removes persons from attendees of events instead.
Implementation of `RemoveCommand` is similar to `InviteCommand`, but removes persons from `Attendees` of events instead.

==== Execution of Command

Given below is an example usage scenario and how the invite mechanism works.

For example, the user inputs `invite 1 to/1` to invite the 1st person in the address book to the 1st event in the event list.

Step 1. The command text is passed to an instance of the `LogicManager` class.

Step 2. The `LogicManager` instance calls `ProManageParser#parseCommand`, which parses the `invite` command phrase.
Step 2. The `LogicManager` instance calls `ProManageParser#parseCommand`, which parses the invite command phrase.

Step 3. `InviteCommandParser#parse` parses the person and event index. An instance of the `InviteCommand` encapsulating the two indices information is then returned after parsing.

Expand Down Expand Up @@ -369,7 +378,7 @@ image::InviteSequenceDiagram.png[width="700"]

* **Alternative 1 (current choice):** Saves only the emails of the Persons in the Attendees of Events.
** Pros: Saves space. Able to filter EventList easily.
** Cons: Requires going through the entire list of AddressBook to obtain details of persons attending the particular event.
** Cons: Requires going through the entire list of EventList to obtain details of events attended by the person.

* **Alternative 2:** Saves the entire information of Events for each Persons.
** Pros: Fast access to information of Events attended by any Persons.
Expand Down Expand Up @@ -399,6 +408,8 @@ One possible way to to implement this is to have the user
The same concept can also be applied to events, being able to invite one person to multiple events with one single command.

Implementation of this additional feature would require changes to both `InviteCommandParser` and `InviteCommand#execute`. Additionally, handling of clashing events needs to be considered as it now involves more than one participant and event.

Similar improvements can be made to `remove` command, being able to remove a person from a number of events with one single command.
// end::Invite[]

// tag::Select[]
Expand Down Expand Up @@ -1370,9 +1381,9 @@ _{ more test cases ... }_
.. Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) _{give more}_ +
Expected: Similar to previous.

=== Inviting a person
=== Inviting a person to an event

. Inviting a person while all persons are listed
. Inviting a person while all persons and events are listed

.. Prerequisites: List all persons using the `list all` command. Multiple persons and events in the list.
.. Test case: `invite 1 to/1` +
Expand All @@ -1381,12 +1392,12 @@ _{ more test cases ... }_
Expected: Error message as employee is already invited to event.
.. Test case: `invite 0 to/1` +
Expected: No employee is invited. Error details shown in the status message.
.. Other incorrect invite commands to try: `invite`, `invite x to/1` (where x is larger than the list size) +
Expected: Similar to previous.
.. Other incorrect invite commands to try: `invite`, `invite x to/1` (where x is larger than the person list size), `invite 1 to/y` (where y is larger than the event list size) +
Expected: Error message.

=== Removing a person
=== Removing a person from an event

. Inviting a person while all persons are listed
. Removing a person while all persons and events are listed

.. Prerequisites: List all persons using the `list all` command. Multiple persons and events in the list.
.. Test case: `invite 1 to/1` then `remove 1 from/1`+
Expand All @@ -1395,8 +1406,8 @@ _{ more test cases ... }_
Expected: Error message as employee is currently not invited to event.
.. Test case: `delete 0 to/1` +
Expected: No employee is removed. Error details shown in the status message.
.. Other incorrect invite commands to try: `remove`, `remove x to/1` (where x is larger than the list size) +
Expected: Similar to previous.
.. Other incorrect invite commands to try: `remove`, `remove x to/1` (where x is larger than the person list size), `remove 1 to/y` (where y is larger than the event list size) +
Expected: Similar to error message.


=== Listing people and events
Expand Down
52 changes: 33 additions & 19 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Format: `addEvent n/NAME d/DESCRIPTION l/LOCATION date/DATE s/START_TIME e/END_T
Example:

* `addEvent n/Board Meeting d/Weekly Meeting l/Conference Room 1 date/2018-09-28 s/14:00 e/15:45` +
Creates an event named Board Meeting at Conference Room 1 at 2018-09-28, from 14:00 to 15:45.
Creates an event named Board Meeting with description "Weekly Meeting" at Conference Room 1 at 2018-09-28, from 14:00 to 15:45.
// end::addevent[]

// tag::editevent[]
Expand All @@ -232,12 +232,15 @@ index *must be a positive integer* 1, 2, 3, ... +
* TIME needs to be in 00:00 format
* START_TIME must be earlier than END_TIME
* Leap years are not considered during date validation.
* One location can only hold one event at any time.
* Location is case insensitive
* Event cannot be editted if result clashes with any of the attendees' event schedule
* Existing values will be updated to the input values.
****

****
WARNING: One location can only hold one event at any time. +
Event cannot be editted if result clashes with any of the attendees' event schedule
****

Examples:

* `editEvent 10 n/Weekly Meeting d/Check on progress l/Conference Room 2 date/2018-09-10 s/12:00 e/14:00`
Expand Down Expand Up @@ -324,15 +327,19 @@ Example:
* `invite 1 to/3` +
Invite 1st employee on employee list to 3rd event on event list

image::InviteCommandGuide.png[width="500"]
image::InviteCommandGuide.png[width="480"]

****
* Invites the employee at the specified `PERSON_INDEX` *TO* the event at the specified `EVENT_INDEX`.
* The index refers to the index number shown in the displayed employee list and event list respectively.
* The index *must be a positive integer* 1, 2, 3, ...
* Employee should not have already been invited to the selected event.
* Event invited to *should not clash* with the selected employee's event schedule.
****

****
WARNING: Employee should not have *already* been invited to the selected event. +
Event invited to *should not clash* with the selected employee's event schedule.
****

// end::invite[]

// tag::remove[]
Expand All @@ -346,36 +353,46 @@ Example:
* `remove 2 from/4` +
Remove 2nd employee at employee list from 4th event at event list

image::RemoveCommandGuide.png[width="450"]
image::RemoveCommandGuide.png[width="480"]

****
* Remove the employee at the specified `PERSON_INDEX` *FROM* the event at the specified `EVENT_INDEX`.
* The index refers to the index number shown in the displayed person list and event list respectively.
* The index *must be a positive integer* 1, 2, 3, ...
* The employee to be remove must be previously invited to an event in order to be removed.
****

****
WARNING: The employee to be remove must be previously invited to an event in order to be removed.
****
// end::remove[]

// tag::select[]
=== Selecting a person: `select`
Priority level: `all`

Selects an employee and view the specified employee's events on a date, year, month, month and year, or all of his/her events. +
Selects an employee and view the selected employee's events at the indicated time on the event list panel. +
Format/Prompts: +
Enter a command: `select PERSON_INDEX [date/DATE] [m/MONTH] [y/YEAR]`

****
* Select the employee at the specified `PERSON_INDEX` and view all his/her events or events at certain time if indicated.
* The index refers to the index number shown in the displayed person list.
* Select the employee at the specified `PERSON_INDEX` and view all his/her events at certain date/year/month if indicated.
* Events will be displayed on the event list panel on the right in chronological order.
* The index refers to the index number shown in the displayed employee list.
* The index *must be a positive integer* `1, 2, 3, ...`
* DATE needs to be in YYYY-MM-DD format
* MONTH needs to be in MM format (e.g. 01, 02, ... , 12)
* YEAR needs to be in YYYY format. (e.g. 2018)
* If DATE is indicated, MONTH and YEAR must NOT be indicated. Then, all events of the selected employee at the specific DATE will be displayed.
* MONTH and YEAR can be both used at the same time, resulting in events on the selected MONTH and YEAR to be displayed.
****

image::SelectCommandGuide.png[width="500"]
****
TIP: MONTH and YEAR can be both used at the same time, resulting in events on the selected MONTH and YEAR to be displayed.
****

****
WARNING: If DATE is indicated, MONTH and YEAR must NOT be indicated. Then, all events of the selected employee at the specific DATE will be displayed.
****

image::SelectCommandGuide.png[width="650"]

Examples:

Expand Down Expand Up @@ -528,16 +545,13 @@ There is no need to save manually.

* *Help*: `help`


* *Login*: `login IDENTITY` where IDENTITY is either manager or employee or `login as existingemail@example.com`

* *Logout*: `logout`

* *Add Employee*: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS dep/DEPARTMENT des/DESIGNATION [t/TAG]...`

* *Edit Employee* : `edit PERSON_INDEX [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [dep/DEPARTMENT] [des/DESIGNATION] [t/TAG]…​`

* *Add*: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS dep/DEPARTMENT [t/TAG]...`
* *Edit Employee* : `edit PERSON_INDEX [p/PHONE_NUMBER] [a/ADDRESS] [dep/DEPARTMENT] [des/DESIGNATION] [t/TAG]…​`

* *Delete Employee* : `delete PERSON_INDEX`

Expand All @@ -561,7 +575,7 @@ There is no need to save manually.

* *Select Employee* : `select PERSON_INDEX [date/DATE] [m/MONTH] [y/YEAR]`

* *selectEvent* : `selectEvent EVENT_INDEX`
* *Select Event* : `selectEvent EVENT_INDEX`

* *History* : `history`

Expand Down
Binary file added docs/images/EventAndAttendeeClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions docs/team/fr3ddy4.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This project portfolio documents my contributions to the development of the CS21

* *Major enhancement*: added *the ability to find events using keywords events* via the `findEvent` command
** What it does: allows the user to search for an event using some keywords.
** Justification: This feature is important as it allows users to access the reuqired events quickly if they know its name or some parts of description.
** Justification: This feature is important as it allows users to access the required events quickly if they know its name or some parts of description.


* *Minor enhancement*:
Expand All @@ -25,10 +25,6 @@ This project portfolio documents my contributions to the development of the CS21

* *Code contributed*: [https://nuscs2113-ay1819s1.github.io/dashboard/#=undefined&search=fr3ddy4[Functional code]]

** Tools:
*** Integrated GitHub Plugins (Coveralls, Travis CI, AppVeyor)
*** Automated team documentation build on GitHub pages


== Contributions to the User Guide

Expand Down
Loading