Skip to content

Commit

Permalink
Merge pull request #26 from CS2103JAN2018-T11-B1/master
Browse files Browse the repository at this point in the history
v1.5
  • Loading branch information
yungyung04 authored Apr 10, 2018
2 parents 38a817f + dca7f8e commit 3251cd8
Showing 30 changed files with 5,581 additions and 153 deletions.
1,541 changes: 1,541 additions & 0 deletions collated/functional/ChoChihTun.md

Large diffs are not rendered by default.

887 changes: 887 additions & 0 deletions collated/functional/yungyung04.md

Large diffs are not rendered by default.

1,620 changes: 1,620 additions & 0 deletions collated/test/ChoChihTun.md

Large diffs are not rendered by default.

894 changes: 894 additions & 0 deletions collated/test/yungyung04.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
@@ -230,6 +230,7 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa

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

// tag::addtutee[]
=== Add tutee Command
==== Current Implementation

@@ -293,6 +294,7 @@ If the person already exists, either as tutee or non-tutee, in the contact list,
* **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.
// end::addtutee[]

// tag::undoredo[]
=== Undo/Redo feature
58 changes: 38 additions & 20 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
@@ -15,9 +15,21 @@ endif::[]

By: `Team MarvelousBook` Since: `Feb 2018` Licence: `MIT`

// tag::introduction[]
== Introduction

TuitionConnect (TC) is for those who *prefer to use a desktop app for managing contacts*. More importantly, TC is *optimized for those who prefer to work with a Command Line Interface* (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, TC can get your contact management tasks done faster than traditional GUI apps. Interested? Jump to the <<Quick Start>> to get started. Enjoy!
TuitionConnect (TC) is personalised address book for the private home tutors. +

There are several features in TuitionConnect which aid in the management of your tutee contacts and tuition.
There are also features which supports the management of your personal contacts and tasks so that you do not require 2 different address books to handle his or her contacts and tasks. +

TuitionConnect is primarily for tutors who *prefer to use a desktop app for managing contacts and tasks*.
More importantly, TuitionConnect is *optimized for those who prefer to work with a Command Line Interface*
(CLI) while still having the benefits of a Graphical User Interface (GUI). +

With TuitionConnect's keyboard shortcuts and productive features, TuitionConnect can get your contact and task management done faster than traditional GUI apps. Interested?
Jump to the <<Quick Start>> to get started. Enjoy!
// end::introduction[]

== Quick Start

@@ -27,7 +39,7 @@ TuitionConnect (TC) is for those who *prefer to use a desktop app for managing c
Having any Java 8 version is not enough. +
This app will not work with earlier versions of Java 8.
+
. Download the latest `addressbook.jar` link:{repoURL}/releases[here].
. Download the latest `TuitionConnect.jar` link:{https://github.com/CS2103JAN2018-T11-B1/main/releases}/releases[here].
. Copy the file to the folder you want to use as the home folder for your Address Book.
. Double-click the file to start the app. The GUI should appear in a few seconds.
+
@@ -77,6 +89,7 @@ Examples:
* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal`
* `a n/Dickson ee p/91234567 e/dickson@exmaple.com a/Dickson street, block 456, #02-02`

// tag::addtutee[]
=== Adding a tutee: `addtutee`
Adds a tutee to the address book +
Using Command Word: +
@@ -96,7 +109,7 @@ Examples:
* `addtutee n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01 s/Economics g/B+ edu/junior college sch/Victoria Junior College`
* `addtutee n/Betsy Crowe s/Mathematics g/C e/betsycrowe@example.com a/Newgate Town p/1234567 t/owesMoney sch/Victoria Institution edu/secondary`
* `addtutee n/Dickson ee p/91234567 e/dickson@exmaple.com a/Dickson street, block 456, #02-02 s/english g/f edu/primary sch/Newgate Primary School`

// end::addtutee[]

=== Listing all persons : `list`

@@ -385,6 +398,7 @@ Lists all tasks scheduled on November, December, January and February.
* `f month namely 2 06 oct
Lists all tasks scheduled on February, June and October.

// tag::change[]
=== Changing calendar view page time unit: `change`

Changes the calendar's view page into the time unit specified by you.
@@ -409,23 +423,24 @@ Format: `change TIME_UNIT`
Examples:

* `change d` (command fails as current calendar view is already in day)

image::change-d.png[width="800"]

+
image::change-d.png[width="600" height="400"]
+
* `change w` (changes calendar view to week)

image::change-w.png[width="800"]

+
image::change-w.png[width="600" height="400"]
+
* `change m` (changes calendar view to month)

image::change-m.png[width="800"]

+
image::change-m.png[width="600" height="400"]
+
* `change y` (changes calendar view to year)

image::change-y.png[width="800"]

+
image::change-y.png[width="600" height="400"]
+
[NOTE]
Year view is unable to display all the months due to third party software constraint.
// end::change[]

=== Listing entered commands : `history`

@@ -511,20 +526,23 @@ Format: `exit`

=== Saving the data

Address book data are saved in the hard disk automatically after any command that changes the data. +
Address book data are saved in the hard disk automatically after any command that
changes the data. +
There is no need to save manually.

// tag::v2Features[]
=== Update tutee fees `[coming in v2.0]`
Updates the remaining balance of the fees of a specific tutee after he or she has paid.
Updates the remaining balance of the tuition fees of a specific tutee after he or she has paid.

=== Complete task `[coming in v2.0]`
Marks a task as completed. If the task is tuition, fees will automatically be added to the tutee's fee balance.

=== Edit task `[coming in v2.0]`
Edits date, time, duration or description of an existing task.
Edits date, time, duration or description of an existing task and reflects the changes on the calendar.

=== View contact address on map `[coming in v2.0]`
View the location of a specific contact's address on google map.
=== View contact address on Google map `[coming in v2.0]`
View the location of a specific contact's address on google map and the shortest route from the current location will be displayed.
// end::v2Features[]

// tag::dataencryption[]
=== Encrypting data files `[coming in v2.0]`
Binary file modified docs/images/Ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/change-d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/change-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/change-w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/change-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions docs/team/chochihtun.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
= Cho Chih Tun - Project Portfolio
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: Tuition Connect (TC)

---

== Overview

TuitionConnect is a desktop address book application used by private tuition teacher. +

TuitionConnect aims to help the tutors to manage their busy schedule more efficiently and effectively. +

TuitionConnect has many functionality catered to the tutors - adding and deleting a tutee, creating a schedule, rescheduling and many more. +

The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 20 kLoC.

== Summary of contributions

* *Major enhancement*: integrated *CalendarFX* into the application
** What it does: has a calendar that reflects all scheduling commands that the user inputs.
** Justification: This feature enhances the product significantly because it improves the user interface. For instance, readability of the schedule is better as user can view it for the year, month, week or day.
** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required integrations with existing commands and UI.
** Credits: [https://github.com/dlemmermann/CalendarFX[CalendarFX]]

* *Minor enhancement*:
. Added alias for each command: https://github.com/CS2103JAN2018-T11-B1/main/pull/10[#10]
. Created Tutee, Subject, Grade, EducationLevel and School classes to support tutee management related commands. Added addtutee command to add a new tutee into TuitionConnect application. https://github.com/CS2103JAN2018-T11-B1/main/pull/62[#62]
. Drafted a TuitionConnect UI theme and revamped the layout of the UI.

* *Code contributed*: [https://github.com/CS2103JAN2018-T11-B1/main/blob/master/collated/functional/ChoChihTun.md[Functional code]] [https://github.com/CS2103JAN2018-T11-B1/main/blob/master/collated/test/ChoChihTun.md[Test code]]

* *Other contributions*:

** Project management:
*** Created product releases `v1.3` - `v1.5rc` jar files (3 releases) on GitHub
*** Managed user stories in developer guide and on GitHub
*** Set up auto publishing of documentation on GitHub
** Documentation:
*** Restructure README and AboutUs to fit into the context of TuitionConnect: https://github.com/CS2103JAN2018-T11-B1/main/pull/53[#53]
*** Wrote an overview of TuitionConnect in user guide and features to be implemented in developer guide: https://github.com/CS2103JAN2018-T11-B1/main/pull/63[#63]
*** Drafted the user stories in developer guide: https://github.com/CS2103JAN2018-T11-B1/main/pull/42[#42], https://github.com/CS2103JAN2018-T11-B1/main/pull/106[#106]
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com/CS2103JAN2018-T11-B1/main/pull/43[#43], https://github.com/CS2103JAN2018-T11-B1/main/pull/44[#44], https://github.com/CS2103JAN2018-T11-B1/main/pull/48[#48], https://github.com/CS2103JAN2018-T11-B1/main/pull/94[#94]
*** Reported several bugs for other teams in class: https://github.com/CS2103JAN2018-W10-B3/main/issues/112[Endless Loop], https://github.com/CS2103JAN2018-W10-B3/main/issues/113[Wrong add command example], https://github.com/CS2103JAN2018-W10-B3/main/issues/119[Wrong userconfig example], https://github.com/CS2103JAN2018-W10-B3/main/issues/117[Exception not handled]
** Tools:
*** Integrated a third party library (CalendarFX) to the project (https://github.com/CS2103JAN2018-T11-B1/main/pull/95[#95])


== Contributions to the User Guide

include::../UserGuide.adoc[tag=introduction]

include::../UserGuide.adoc[tag=addtutee]

include::../UserGuide.adoc[tag=change]

include::../UserGuide.adoc[tag=v2Features]

== Contributions to the Developer Guide

include::../DeveloperGuide.adoc[tag=addtutee]
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.core.Messages.MESSAGE_TASK_TIMING_CLASHES;

import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.person.exceptions.TimingClashException;
@@ -37,16 +36,18 @@ public AddPersonalTaskCommand(PersonalTask task) {
toAdd = task;
}

//@@author ChoChihTun
@Override
public CommandResult executeUndoableCommand() throws CommandException {
try {
model.addTask(toAdd);
} catch (TimingClashException e) {
throw new CommandException(MESSAGE_TASK_TIMING_CLASHES);
} catch (TimingClashException tce) {
throw new CommandException(tce.getMessage());
}
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd.toString()));
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
}

//@@author yungyung04
@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.core.Messages.MESSAGE_TASK_TIMING_CLASHES;

import java.time.LocalDateTime;
import java.util.List;
@@ -64,16 +63,18 @@ public AddTuitionTaskCommand(Index targetIndex, LocalDateTime taskDateTime, Stri
this.description = description;
}

//@@author ChoChihTun
@Override
public CommandResult executeUndoableCommand() throws CommandException {
try {
model.addTask(toAdd);
} catch (TimingClashException e) {
throw new CommandException(MESSAGE_TASK_TIMING_CLASHES);
} catch (TimingClashException tce) {
throw new CommandException(tce.getMessage());
}
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
return new CommandResult(MESSAGE_SUCCESS);
}

//@@author yungyung04
@Override
protected void preprocessUndoableCommand() throws CommandException {
associatedTutee = getAssociatedTutee().getName().fullName;
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ public class AddTuteeCommand extends UndoableCommand {
private final Tutee toAdd;

/**
* Creates an AddTuteeCommand to add the specified {@code Person}
* Creates an AddTuteeCommand to add the specified {@code Tutee}
*/
public AddTuteeCommand(Tutee tutee) {
requireNonNull(tutee);
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

import seedu.address.model.person.exceptions.DurationParseException;

//@@author yungyung04
/**
* Parses input arguments and creates a new AddTuitionTaskCommand object
*/
@@ -56,7 +57,8 @@ public AddTuitionTaskCommand parse(String args) throws ParseException {
throw new ParseException(MESSAGE_INVALID_DURATION + "\n"
+ AddTuitionTaskCommand.MESSAGE_USAGE);
} catch (IllegalValueException ive) {
throw new ParseException(String.format(MESSAGE_INVALID_INPUT_FORMAT, AddTuitionTaskCommand.MESSAGE_USAGE));
throw new ParseException(MESSAGE_INVALID_INPUT_FORMAT + "\n"
+ AddTuitionTaskCommand.MESSAGE_USAGE);
}
}
}
9 changes: 0 additions & 9 deletions src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
@@ -137,15 +137,6 @@ public void addTask(Task t) throws TimingClashException {
tasks.add(t);
}

/**
* Updates a task to the address book.
*
*/
public void updateTask(Task target, Task editedTask) {
requireNonNull(editedTask);
tasks.setTask(target, editedTask);
}

/**
* Updates the master tag list to include tags in {@code person} that are not in the list.
* @return a copy of this {@code person} such that every tag in this person points to a Tag object in the master
40 changes: 14 additions & 26 deletions src/main/java/seedu/address/model/UniqueTaskList.java
Original file line number Diff line number Diff line change
@@ -20,43 +20,31 @@
*
*/
public class UniqueTaskList implements Iterable<Task> {
private static final String HOUR_DELIMITER = "h";
private static final String MINUTE_DELIMITER = "m";

private final ObservableList<Task> internalList = FXCollections.observableArrayList();


/**
* Constructs empty TaskList.
*/
public UniqueTaskList() {}

//@@author ChoChihTun
/**
* Adds a task to the list.
*
* Need to add an exception that functions well in the commented out code below to prevent duplicate tasks
* @throws TimingClashException if there is a clash in timing with an existing task
*/
public void add(Task toAdd) throws TimingClashException {
requireNonNull(toAdd);
checkTimeClash(toAdd.getTaskDateTime(), toAdd.getDuration());
internalList.add(toAdd);
}

/**
* Replaces the task {@code target} in the list with {@code editedTask}.
*
*/
public void setTask(Task target, Task editedTask) {
requireNonNull(editedTask);

int index = internalList.indexOf(target);
if (index == -1) {
System.out.println("Place Holder");
}

if (!target.equals(editedTask) && internalList.contains(editedTask)) {
System.out.println("Place Holder");
if (isTimeClash(toAdd.getTaskDateTime(), toAdd.getDuration())) {
throw new TimingClashException(MESSAGE_TASK_TIMING_CLASHES);
}

internalList.set(index, editedTask);
internalList.add(toAdd);
}
//@@author

/**
* Removes the equivalent task from the list.
@@ -97,9 +85,8 @@ public ObservableList<Task> asObservableList() {
*
* @param startDateTime start date and time of new task
* @param duration duration of new task
* @throws TimingClashException if there is a clash in the task timing
*/
private void checkTimeClash(LocalDateTime startDateTime, String duration) throws TimingClashException {
private boolean isTimeClash(LocalDateTime startDateTime, String duration) {
LocalDateTime taskEndTime = getTaskEndTime(duration, startDateTime);

for (Task recordedTask : internalList) {
@@ -111,17 +98,18 @@ private void checkTimeClash(LocalDateTime startDateTime, String duration) throws
&& !(taskEndTime.equals(startTimeOfRecordedTask)
|| startDateTime.equals(endTimeOfRecordedTask));
if (isClash) {
throw new TimingClashException(MESSAGE_TASK_TIMING_CLASHES);
return true;
}
}
return false;
}

/**
* Returns date and time when the task ends
*/
private static LocalDateTime getTaskEndTime(String duration, LocalDateTime startDateTime) {
int indexOfHourDelimiter = duration.indexOf("h");
int indexOfMinuteDelimiter = duration.indexOf("m");
int indexOfHourDelimiter = duration.indexOf(HOUR_DELIMITER);
int indexOfMinuteDelimiter = duration.indexOf(MINUTE_DELIMITER);
int indexOfFirstDigitInMinute = indexOfHourDelimiter + 1;
int hoursInDuration = Integer.parseInt(duration.substring(0, indexOfHourDelimiter));
int minutesInDuration = Integer.parseInt(duration.substring(indexOfFirstDigitInMinute, indexOfMinuteDelimiter));
Loading

0 comments on commit 3251cd8

Please sign in to comment.