Skip to content

Commit

Permalink
Merge pull request #33 from CS2103JAN2018-T11-B1/master
Browse files Browse the repository at this point in the history
v1.5
  • Loading branch information
yungyung04 authored Apr 15, 2018
2 parents e1e0348 + ddb42a7 commit d485ad3
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 42 deletions.
2 changes: 1 addition & 1 deletion docs/AboutUs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Responsibilities: Storage + Scheduling and Tracking

=== Cho Chih Tun
image::chochihtun.jpg[width="150", align="left"]
{empty}[http://github.com/ChoChihTun[github]] [https://chochihtun.github.io/Profile/[portfolio]]
{empty}[http://github.com/ChoChihTun[github]] [<<chochihtun#, portfolio>>]

Role: Developer +
Responsibilities: UI + Code Quality
Expand Down
58 changes: 42 additions & 16 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The _Sequence Diagram_ below shows how the components interact for the scenario
image::SDforDeletePerson.png[width="800"]

[NOTE]
Note how the `Model` simply raises a `AddressBookChangedEvent` when the Address Book data are changed, instead of asking the `Storage` to save the updates to the hard disk.
Note how the `Model` simply raises a `AddressBookChangedEvent` when the <<address-book,Address Book>> data are changed, instead of asking the `Storage` to save the updates to the hard disk.

The diagram below shows how the `EventsCenter` reacts to that event, which eventually results in the updates being saved to the hard disk and the status bar of the UI being updated to reflect the 'Last Updated' time.

Expand Down Expand Up @@ -240,9 +240,9 @@ This section describes some noteworthy details on how certain features are imple
==== Current Implementation

===== Reason for Implementation
As the user of this application is the tutor, he or she will need to add the tutees' contact details.
Since a tutee contains more details specific to them compared to a non-tutee, tutee contacts should not be mixed with the non-tutee contacts so that all the contacts are organized and can be managed easily.
Therefore, AddTuteeCommand is used to add only the tutees' contact details.
As the user of this application is a private tutor, he or she will need to add the <<tutee,tutees'>> contact details.
Since a tutee contains more details specific to them compared to a person, tutee contacts should not be mixed with the <<person, person>> contacts so that all the contacts are organized and can be managed easily.
Therefore, AddTuteeCommand is used to add only the <<tutee-details,tutees' details>>.

===== How it is implemented
The AddTuteeCommand is an extension of the Undoable Command, which is part of the Logic Component.
Expand Down Expand Up @@ -273,32 +273,36 @@ public class AddTuteeCommand extends UndoableCommand {
}
----

The following sequence diagram shows how the addtutee operation works:
The following [underline]#*sequence diagram*# shows how the addtutee operation works:

image::AddTuteeCommandSequenceDiagram.png[width="800"]

As shown in the sequence diagram, after Tutee object has been created, it is being passed to Model. Model manager will add the Tutee object to the person list in TuitionConnect.
By having a combined list of tutee and non-tutee, we can manage the contacts using one command, such as delete command, instead of having 1 command for tutee and 1 command for non-tutee.
By having a combined list of tutee and person, we can manage the contacts using one command, such as delete command, instead of having 1 command for tutee and 1 command for person.
The combined list is achieved through the use of inheritance, whereby Tutee class inherits the Person class as shown in the diagram below.

image:TuteeClassDiagram.jpg[width="800"]
image:TuteeClassDiagram.jpg[width="600" height="400"]

Since a tutee is a person, we can carried out inheritance by extending the Person class.
Both Tutee and Person class objects have the same fields such as Name, Phone, Email and Address.
However, Tutee class object has additional fields such as Subject, Grade, EducationLevel and School, which are irrelevant to a Person class object (non-tutee).
However, Tutee class object has additional details such as Subject, Grade, EducationLevel and School, which are irrelevant to a Person class object.

[NOTE]
If the person already exists, either as tutee or non-tutee, in the contact list, DuplicatePersonException will be thrown.
If the person already exists, either as tutee or person, in the contact list, DuplicatePersonException will be thrown.

The following [underline]#*activity diagram*# shows the workflow when adding a tutee.

image:AddTuteeActivityDiagram.png[width="800]

==== Design Consideration

* **Alternative 1 (current choice):** Create a new command "addtutee" and a tutee class, which extends person class
** Pros: Non-tutee will not have any detail that is specific to tutee only. This saves memory especially when there are numerous non-tutee objects.
** Cons: A tutee cannot simply convert into a non-tutee when tutor stops teaching him/her. Tutor has to delete the tutee and add him/her again as a non-tutee.
** Pros: Person will not have any detail that is specific to tutee only. This saves memory especially when there are numerous person objects.
** Cons: A tutee cannot simply convert into a person object when tutor stops teaching him/her. Tutor has to delete the tutee and add him/her again as a person.

* **Alternative 2:** Modify the current AddCommand and add more fields to the person class
** Pros: Features can be implemented easily without modifying much to the existing code.
** Cons: Non-tutee object creates unrelated field objects such as "subject" and "school" and these objects will waste the memory space. This problem will be significant when there are a lot of non-tutee objects.
** Cons: Person object creates unrelated field objects such as "subject" and "school" and these objects will waste the memory space. This problem will be significant when there are a lot of person objects.
// end::addtutee[]

// tag::undoredo[]
Expand Down Expand Up @@ -913,13 +917,14 @@ See this https://github.com/se-edu/addressbook-level4/pull/599[PR] for the step-
*Chih Tun*:

* *Major Enhancement*: Integrated a calendar into TuitionConnect using third party software, CalendarFX.
Configured TuitionConnect's main window to display day, week, month or year view of the calendar. A daily agenda list is showed together with the calendar's day view.
In addition, the calendar reflects any changes to the schedule such as adding of a new task or deleting an existing task.
. Revamp UI layout and colour so as to incorporate calendar to the UI
. Implemented change command to display day, week, month or year view of the calendar. A daily agenda list is showed together with the calendar's day view.
. In addition, the calendar reflects any changes to the schedule such as adding of a new task, deleting an existing task or undo.

* *Minor Enhancement*:
. Created command to add a new tutee.
. Implemented tutee, tuition, personal task classes and relevant field classes to support all the commands.
. Modify select command to conduct name search on google search pop up page.
. Modify edit command to be able to edit tutee's details.


*Eka Buyung Lienadi*:
Expand Down Expand Up @@ -1166,7 +1171,7 @@ Use case ends.

* *a. At any time, user can cancel the request.
[none]
** *a1 TC requests confirmation of the cancelation.
** *a1 TC requests confirmation of the cancellation.
** *a2. User confirms the cancellation.
** Use case ends.

Expand Down Expand Up @@ -1234,9 +1239,30 @@ An application for storing the contact details.
[[mainstream-os]] Mainstream OS::
Windows, Linux, Unix, OS-X

[[person]] Person::
A non tutee contact

[[personal-task]] Personal Task::
Non-tuition activity

[[private-contact-detail]] Private contact detail::
A contact detail that is not meant to be shared with others

[[task]] Task::
This refers to the activities you want to add into your 'to-do-list'

[[tuition-task]] Tuition Task::
Teaching a specified tutee in contact list.

[[tutee]] Tutee::
A student whom you are giving tuition to

[[tutee-details]] Tutee Details::
These are details that are owned only by tutees, which include tutee's education level, grade, subject and school

[[task-list]] Task List / Schedule::
These terms are used interchangeably to refer to the list of tasks located in the middle of the app.

[appendix]
== Product Survey

Expand Down
77 changes: 52 additions & 25 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ Using Command Word: +
Format: `addtutee n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS s/SUBJECT g/GRADE edu/EDUCATION_LEVEL sch/SCHOOL [t/TAG]...`

[TIP]
A tutee can have any number of tags (including 0)
====
* A tutee can have any number of tags (including 0)
* Special character in grade can be anything since different institution may use different grading system. +
i.e. B+, B3, B$, B# etc are all valid
====

[NOTE]
[WARNING]
====
* Education level can only be either primary, secondary or junior college (NOT case sensitive) +
* All details except tag MUST be added
* Special character in grade can be anything since different institution may use different grading system. +
i.e. B+, B3, B$, B# etc are all valid
====

Examples:
Expand All @@ -134,7 +136,7 @@ Examples:

=== Listing all persons : `list`

Shows a list of all persons in the address book. +
Shows a list of all contacts in the address book. +
Using Command Word: +
Format: `list` +
Using Command Alias: +
Expand All @@ -148,30 +150,61 @@ Using Command Word: +
Format: `listtutee` +
// end::listtutee[]

// tag::edit[]
=== Editing a person : `edit`

Edits an existing person's detail in the address book. +
Edits existing contact's details in the address book. +
Using Command Word: +
Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +
Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [s/SUBJECT] [s/SUBJECT] [g/GRADE] [edu/EDUCATION_LEVEL] [sch/SCHOOL] [t/TAG]...` +
Using Comamnd Alias: +
Format: `e INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +
Format: `e INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [s/SUBJECT] [s/SUBJECT] [g/GRADE] [edu/EDUCATION_LEVEL] [sch/SCHOOL] [t/TAG]...` +

[width="80%",cols="20%, 60%",options="header",]
|=======================================================================
|Keyword |Description
|edit |To call the edit command
|INDEX |Index number shown in the last person listing. It *must be a positive integer* 1, 2, 3, ...
|INDEX |The contact at the specified `INDEX` will be edited
|=======================================================================

[NOTE]
====
* Edits the person at the specified `INDEX`. The index refers to the index number shown in the last person listing. The index *must be a positive integer* 1, 2, 3, ...
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
* You can remove all the person's tags by typing `t/` without specifying any tags after it.
* This command is able to edit the general details of a tutee (name, phone, email, address and tags). However, it is unable to edit tutee's details (subject, grade, education level, school and tutee tag).
* "Tutee" tag is specific to tutee only and will never be removed.
* Remove all the person's tags: type `t/` without specifying any tags after it.
* Remove all the tutee's tags except "Tutee" tag: type `t/` without specifying any tags after it OR type `t/tutee` (this includes other variation of case letters for tutee such as "TUTEE", "TuteE" etc).
====

[underline]#*Valid Details to edit for each type of contact:*#
[width="80%",cols="40%, 40%",options="header",]
|=======================================================================
|Person |Tutee
|NAME |NAME
|PHONE |PHONE
|EMAIL |EMAIL
|ADDRESS |ADDRESS
| --- |SUBJECT
| --- |GRADE
| --- |EDUCATION_LEVEL
| --- |SCHOOL
|TAG |TAG
|=======================================================================

[WARNING]
====
* At least one of the valid optional fields must be provided.
* Existing information will be updated to the new information.
* When editing tags, the existing tags of the contact will be removed (Except "Tutee" tag) i.e adding of tags is not cumulative.
* Manual adding of "Tutee" tag to a person is not allowed (this includes other variation of case letters for tutee such as "tutee", "TuTeE" etc)
* Editing of subject, grade, education level and school is not allowed for person
====

Examples:

* `edit 1 p/91234567 e/johndoe@example.com` +
Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively.
* `e 2 n/Betsy Crower t/` +
Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags.
Edits the phone number and email address of the 1st contact to be `91234567` and `johndoe@example.com` respectively.
* `e 2 n/Betsy Crower sch/JohnDoe Secondary t/` +
Edits the name of the 2nd contact (a tutee) to be `Betsy Crower`, her school to `JohnDoe Secondary` and clears all existing tags (except "Tutee" tag).
// end::edit[]

// tag::findperson[]
=== Locating persons by category: `findpersonby`
Expand Down Expand Up @@ -611,12 +644,6 @@ Edits date, time, duration or description of an existing task and reflects the c
View the location of a specific contact's address on google map and the shortest route from the current location will be displayed.
// end::ChoChihTunV2.0[]

// tag::dataencryption[]
=== Encrypting data files `[coming in v2.0]`

_{explain how the user can enable/disable data encryption}_
// end::dataencryption[]

== FAQ

*Q*: How do I transfer my data to another Computer? +
Expand All @@ -632,7 +659,7 @@ e.g. `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 123466
* *Clear* : `clear` +
* *Delete* : `delete PERSON_INDEX` +
e.g. `delete 3` +
* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +
* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [s/SUBJECT] [s/SUBJECT] [g/GRADE] [edu/EDUCATION_LEVEL] [sch/SCHOOL] [t/TAG]...` +
e.g. `edit 2 n/James Lee e/jameslee@example.com` +
* *Find Person By* : findpersonby CATEGORY KEYWORD [MORE_KEYWORDS]` +
e.g. `findpersonby name Jake Doe` +
Expand Down Expand Up @@ -666,7 +693,7 @@ e.g. `a n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665
* *Clear* : `c` +
* *Delete* : `d INDEX` +
e.g. `d 3` +
* *Edit* : `e INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +
* *Edit* : `e INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [s/SUBJECT] [s/SUBJECT] [g/GRADE] [edu/EDUCATION_LEVEL] [sch/SCHOOL] [t/TAG]...` +
e.g. `e 2 n/James Lee e/jameslee@example.com` +
* *Find Person By* : f CATEGORY KEYWORD [MORE_KEYWORDS]` +
e.g. `f name Jake Doe` +
Expand Down
Binary file added docs/images/AddTuteeActivityDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d485ad3

Please sign in to comment.