Skip to content

Commit

Permalink
Merge pull request #200 from CS2103-AY1819S2-W10-3/solve_bugs
Browse files Browse the repository at this point in the history
Solve bugs
  • Loading branch information
LiuXuanIan committed Apr 15, 2019
2 parents 2cabd07 + f4d77fa commit 3d8d9f5
Show file tree
Hide file tree
Showing 14 changed files with 215 additions and 61 deletions.
79 changes: 79 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,74 @@ With that, you may refer to <<Display feature>> to see how *Equipment Manager* w

//end::equipment[]

//tag::worklist[]
=== WorkList feature
To help users understand how this feature, *WorkList*, works in *Equipment Manager*,
this section will give an overview on the WorkList details and how users can interact with WorkList based on the commands implemented
in the design of Equipment Manager. It also provides some design considerations to give users an insight of how the current solutions are worked out.

==== Overview on WorkList details

|===
| *Attributes* | *Description* | *Things to Note*
| Date | The tentative maintenance date on the equipments in the WorkList. |
| Assignee | The name of the person who is assigned to conduct the maintenance work. |
| WorkListId | The id of a WorkList | All WorkLists should have unique id and there should not be duplicated id.
|===

==== Current Usage of WorkList Details

In order to allow users to user WorkList to help them organize their equipments and assign their work, we have implemented several
commands as follows with the usage of WorkList details and also some Equipment details.

*An example of how the attributes of WorkList are used:*

* When user execute the `AddWorkListCommand` or `DeleteWorkListCommand`, the added WorkList details stored in *Equipment Manager*,
and the deleted WorkList details will be deleted from *Equipment Manager*.
* When user uses command like `PutCommand`, *Equipment Manager* will help users to put the selected Equipment into the specified
WorkList, such that they will know those equipment are in the WorkList with one specified assignee and date.
* When user uses command like `RemoveWorkListCommand`, *Equipment Manager* will remove the selected Equipment from a
specified WorkList, it could be the case that users put the equipment into a wrong WorkList, they want to put the equipment
into a different WorkList or they just finished maintaining that equipment so they want to remove it from the WorkList.

==== Current Implementation
Using `AddWorkListCommand` mentioned in previous section as an example,
the *add WorkList* mechanism is facilitated by `VersionedEquipmentManager` which extends the `Equipment Manager`.
The results of this command will be displayed under *WorkList Details* panel.

The following sequence diagram shows how the *add WorkList* operation works:

.Sequence diagram for `AddWorkListCommand`
image::AddWorkListCommandSD.png[width="800"]

Below is an example of the step-by-step mechanism of `add-w` command.

Step 1. The user launches the application.

Step 2. The user executes `add-w d/09-05-2019 a/Mary i/13` command.

Step 3. After `EquipmentManagerParser` detects `add-w` as the command word, a `AddWorkListCommandParser#parse()` is called.

Step 4. `AddWorkListCommand#execute()` is then called.

Step 5. The parser will parse all the attributes and add into WorkList models.

Step 7. The model now contains details of WorkList, and returns to GUI for display on *WorkList details* panels.

==== Design Considerations
===== Aspects: What should be the relationship between the WorkList and Equipments.

* *Alternative 1 (current choice)*: The WorkList is a independent class and can contains a list of Equipment objects.
** Pros: This is more organized and it is clear that WorkList contains some Equipments.
** Cons: Might be confusing the users that why there are so many relationships and these classes are interacting with each other.

* *Alternative 2*: Equipment is our major work and WorkList is just contains some Serial Numbers just for displaying purposes.
** Pros: Easy to implement and users are able to know which part they should focusing on more, which is Equipment in this case.
** Cons: It is hard to do more. If in the future, we intend to do some features like display the equipments in some certain WorkList,
then it will be quite hard to implement such a feature.

//end::worklist[]

//tag::client[]
=== Client feature
This section describes features specific to client, how having client details contribute to the features in *Equipment Manager* as well as our design considerations.
Expand Down Expand Up @@ -1037,6 +1105,17 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un
|`* * *` |user |want to know names of the clients | so that i can get a clear view of my customers and their respective equipments
|=======================================================================

[discrete]
=== Put, Remove
[width="59%",cols="22%,<23%,<25%,<30%",options="header",]
|=======================================================================
|Priority |As a ... |I want to ... |So that I can...
|`* * *` |user |put an equipment into a work list |arrange my equipments and put into a work list if I want to keep track of these equipments.

|`* * *` |user |remove an equipment from a work list |remove an equipment if I put it wrongly or I finished maintaining this equipment so I want to remove it from this work list.

|=======================================================================

[discrete]
=== Filter
[width="59%",cols="22%,<23%,<25%,<30%",options="header",]
Expand Down
20 changes: 13 additions & 7 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Under *Client details* panel, Pending CC is added to the panel after entering th
image::PendingCC.png[width="800"]
// end::add-e[]

// tag::add-w[]
=== Creating a new work list: `add-w`
Create a worklist in the Equipment Manager by giving the worklist an ID +
Format: `add-w d/DATE a/ASSIGNEE i/ID`
Expand All @@ -182,8 +183,10 @@ ID number beginning with 0 is not valid, for example, 002 should be 2.

Example:

* `add-w d/09-05-2019 a/Mei Yen i/13`
* `add-w d/09-05-2019 a/Mary i/13`
// end::add-w[]

// tag::put[]
=== Putting an equipment into a work list: `put`
Adds an equipment into a working list in the Equipment Manager +
Format: `put i/WorkListID s/SERIAL_NUMBER`
Expand All @@ -194,7 +197,9 @@ Please make sure that the respective Equipment and WorkList exist in the equipme
Example:

* `put i/1 s/A008866X`
// end::put[]

// tag::remove[]
=== Removing an equipment from a work list: `remove`
Removes an equipment from a working list in the Equipment Manager +
Format: `remove i/WorkListID s/SERIAL_NUMBER`
Expand All @@ -205,6 +210,7 @@ Please make sure that the respective Equipment and WorkList exist in the equipme
Example:

* `remove i/1 s/A008866X`
// end::remove[]

=== Editing an equipment: `edit-e`
Edits an existing equipment in the *Equipment Manager*. +
Expand Down Expand Up @@ -235,17 +241,19 @@ Example:

* `list-e`

// tag::list-w[]
=== List all work list: `list-w`
Shows a list of all work list in the Equipment Manager +
Format: `list-w`

Example:

* `list-w`
// end::list-w[]

// tag::select[]
=== Selecting an equipment or work list: `select`
Selects the equipment or work list identified by the index number used in the displayed equipment list or displayed work list. The address of the equipment will be shown as marker on the map. The details of the equipment will be shown together with the map in split window format, means top half the screen will be showing the details, and the bottom half of the screen will be showing the map. +
=== Selecting an equipment: `select`
Selects the equipment identified by the index number used in the displayed equipment list. The address of the equipment will be shown as marker on the map. The details of the equipment will be shown together with the map in split window format, means top half the screen will be showing the details, and the bottom half of the screen will be showing the map. +
Format: `select INDEX`

* Selects the equipment and loads the equipment at the specified INDEX. +
Expand All @@ -258,10 +266,6 @@ Examples:
`select 2` +
Selects the 2nd equipment in the equipment manager.

* `list-w` +
`select 1` +
Selects the 1st worklist in the equipment manager.

* `find Clementi` +
`select 1` +
Selects the 1st equipment in the results of the find command.
Expand Down Expand Up @@ -414,6 +418,7 @@ Example:
* `list-e` +
`delete-e 1`

// tag::delete-w[]
=== Deleting a work list: `delete-w`
Deletes the specified work list from the work list. +
Format: `delete-w INDEX`
Expand All @@ -422,6 +427,7 @@ Example:

* `list-w` +
`delete-w 12`
// end::delete-w[]

=== Enabling notification: `notify` [Coming in v2.0]
Notifies you when an equipment is due for preventive maintenance in 2 days. You can choose to get notifications or not.
Expand Down
Binary file added docs/diagrams/AddWorkListCommandSD copy.pptx
Binary file not shown.
Binary file added docs/images/AddWorkListCommandSD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 39 additions & 42 deletions docs/team/LiuXuan.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: Equipment Manager
== Introduction

Hi, I am Liu Xuan, a year 2 Computer Science student, studying at National University of Singapore.

---
I am working on a software product with my project teammates, Rachel, Mei Yen and Sun Yiqun. This project portfolio will
specify and illustrate which part I was working on.

== PROJECT: Equipment Manager

== Overview

*Equipment Manager* is a Preventive Maintenance (PM) planner application that allows users, specifically the engineers,
to keep track of the PM schedule of all Resuscitation Equipment in Singapore. *Equipment Manager* is designed to allow
engineers assign the equipment they are going to carry out maintenance work to their own work schedule. When they are
carrying out maintenance work on multiple equipments in their work schedule, they are able to have a visual
representation on the locations of all equipment. In order to carry out maintenance work efficiently, *Equipment
Manager* provide engineers with an efficient route to take for visiting multiple locations, minimizing the chance
that the resuscitation devices will fail and cause costly unscheduled downtime.
*Equipment Manager* is a Command Line Interface Software Product, which helps engineers to better manage their equipments.
This application allows users to arrange and organize their equipments, assign the equipment maintenance work into a person and a specified
date, and have a best routing plan.

== Summary of contributions

Expand All @@ -25,57 +26,53 @@
equipment maintenance work to their staff.
** Highlights: This enhancement affects the whole model and structure. It required an in-depth analysis of the
relationships between the WorkList and the Equipment. In addition, it also required more commands to be added into
this software. The implementation too was challenging as it required changes to the model and the commands.
this software. The implementation too was challenging as it required changes to the model and the commands. This feature
also helps users to better organize their equipments and assign the maintenance work to some person.
** AddWorkListCommand: [https://github.com/CS2103-AY1819S2-W10-3/main/pull/79[#79]] [https://github.com/CS2103-AY1819S2-W10-3/main/pull/97[#97]]
** DeleteWorkListCommand: [https://github.com/CS2103-AY1819S2-W10-3/main/pull/182[#182]]
** PutCommand: [https://github.com/CS2103-AY1819S2-W10-3/main/pull/109[#109]]
** RemoveCommand: [https://github.com/CS2103-AY1819S2-W10-3/main/pull/181[#181]]
** ListWorkListCommand: [https://github.com/CS2103-AY1819S2-W10-3/main/pull/65[#65]]
** Credits: Code from `AddWorkListCommand` and `DeleteWorkListCommand` was referenced in the implementation of `AddCommand` and `DeleteCommand` respectively
** Credits: Code from `ListWorkListCommand` was referenced in the implementation of `ListEquipmentCommand`
//** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_

* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys.

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_
* *Code contributed*:
** https://nus-cs2103-ay1819s2.github.io/cs2103-dashboard/#=undefined&search=LiuXuanIan[Click here] to view my code on the CS2103T Project Code Dashboard.

* *Other contributions*:

** Project management:
*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
** Enhancements to existing features:
*** Updated the GUI color scheme (Pull requests https://github.com[#33], https://github.com[#34])
*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38])
** Documentation:
*** Did cosmetic tweaks to existing contents of the User Guide: https://github.com[#14]
** Enhancements to existing UI:
*** Adding Labels for both Equipments and WorkLists. (Pull requests [https://github.com/CS2103-AY1819S2-W10-3/main/pull/114[#114]], [https://github.com/CS2103-AY1819S2-W10-3/main/pull/193[#193]])
** Refactor ParseEmail to ParseDate
*** Refactor the name ParseEmail to ParseDate to better fit our product. (Pull requests [https://github.com/CS2103-AY1819S2-W10-3/main/pull/84[#84]])
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com[#12], https://github.com[#32], https://github.com[#19], https://github.com[#42]
*** Contributed to forum discussions (examples: https://github.com[1], https://github.com[2], https://github.com[3], https://github.com[4])
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com[1], https://github.com[2], https://github.com[3])
*** Some parts of the history feature I added was adopted by several other class mates (https://github.com[1], https://github.com[2])
** Tools:
*** Integrated a third party library (Natty) to the project (https://github.com[#42])
*** Integrated a new Github plugin (CircleCI) to the team repo

_{you can add/remove categories in the list above}_
*** PRs reviewed:
[https://github.com/CS2103-AY1819S2-W10-3/main/pull/191[#191]],
[https://github.com/CS2103-AY1819S2-W10-3/main/pull/115[#115]],
[https://github.com/CS2103-AY1819S2-W10-3/main/pull/98[#98]],
[https://github.com/CS2103-AY1819S2-W10-3/main/pull/83[#83]].

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::../UserGuide.adoc[tag=undoredo]
include::../UserGuide.adoc[tag=remove]

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

include::../UserGuide.adoc[tag=dataencryption]
include::../UserGuide.adoc[tag=add-w]

include::../UserGuide.adoc[tag=delete-w]

include::../UserGuide.adoc[tag=list-w]

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::../DeveloperGuide.adoc[tag=undoredo]

include::../DeveloperGuide.adoc[tag=dataencryption]


== PROJECT: PowerPointLabs

---

_{Optionally, you may include other projects in your portfolio.}_
include::../DeveloperGuide.adoc[tag=worklist]
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import seedu.equipment.logic.parser.CliSyntax;
import seedu.equipment.model.Model;
import seedu.equipment.model.WorkList;
import seedu.equipment.model.equipment.Date;
//import seedu.equipment.model.equipment.Equipment;

/**
Expand All @@ -20,15 +21,17 @@ public class AddWorkListCommand extends Command {
+ "Parameters: "
+ CliSyntax.PREFIX_DATE + "DATE "
+ CliSyntax.PREFIX_ASSIGNEE + "ASSIGNEE "
+ CliSyntax.PREFIX_ID + "ID \n"
+ CliSyntax.PREFIX_ID + "ID(beginning with 0 is not valid) \n"
+ "Example: " + COMMAND_WORD + " "
+ CliSyntax.PREFIX_DATE + "12-12-2019 "
+ CliSyntax.PREFIX_ASSIGNEE + "Mary "
+ CliSyntax.PREFIX_ID + "13 ";

public static final String MESSAGE_SUCCESS = "New WorkList created: %1$s";
public static final String MESSAGE_SUCCESS = "New WorkList created:(WorkListId) %1$s";
public static final String MESSAGE_DUPLICATE_EQUIPMENT = "Duplicated WorkList ID, "
+ "this WorkList already exists in the equipment manager.";
public static final String INVALID_DATE = "Date format is not valid. Need to follow dd-mm-yyyy, for example"
+ " 12-12-2019";

private final WorkList toAdd;

Expand All @@ -48,6 +51,10 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
throw new CommandException(MESSAGE_DUPLICATE_EQUIPMENT);
}

if (!Date.isValidDate(toAdd.getDate())) {
throw new CommandException(INVALID_DATE);
}

model.addWorkList(toAdd);
model.commitEquipmentManager();
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.equipment.model.Model.PREDICATE_SHOW_ALL_EQUIPMENT;

import seedu.equipment.logic.CommandHistory;
import seedu.equipment.logic.commands.exceptions.CommandException;
import seedu.equipment.model.Model;

/**
Expand All @@ -13,12 +14,29 @@ public class ListEquipmentCommand extends Command {

public static final String COMMAND_WORD = "list-e";

public static final String EXTRA_PARA_EXCEPTION = "Extra parameters will be ignored.";

public static final String MESSAGE_SUCCESS = "Listed all equipment";

private boolean extraPara = false;

/**
* Crate a ListEquipmentCommand with {@code arguments} given.
*/
public ListEquipmentCommand(String arguments) {
if (!arguments.trim().isEmpty()) {
extraPara = true;
}
}

@Override
public CommandResult execute(Model model, CommandHistory history) {
public CommandResult execute(Model model, CommandHistory history) throws CommandException {
requireNonNull(model);

if (extraPara) {
throw new CommandException(EXTRA_PARA_EXCEPTION);
}

model.updateFilteredPersonList(PREDICATE_SHOW_ALL_EQUIPMENT);
return new CommandResult(MESSAGE_SUCCESS);
}
Expand Down
Loading

0 comments on commit 3d8d9f5

Please sign in to comment.