Skip to content

Commit

Permalink
Merge pull request #196 from jtankw3/master
Browse files Browse the repository at this point in the history
User and Developer Guide for V1.4
  • Loading branch information
JonathanLeeWH authored Apr 15, 2019
2 parents acd399b + b7ba99e commit b1f9594
Show file tree
Hide file tree
Showing 23 changed files with 235 additions and 147 deletions.
124 changes: 95 additions & 29 deletions docs/DeveloperGuide.adoc

Large diffs are not rendered by default.

138 changes: 75 additions & 63 deletions docs/UserGuide.adoc

Large diffs are not rendered by default.

Binary file not shown.
Binary file modified docs/diagrams/ModelComponentClassBetterOopDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/ModelComponentClassDiagram.pptx
Binary file not shown.
Binary file added docs/diagrams/ModelMedicineObjectDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/SDforDeleteMedicine.pptx
Binary file not shown.
Binary file added docs/images/InformationPanelActivityDiagram.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/InformationPanelSequenceDiagram.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/ModelClassBetterOopDiagram.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/ModelClassDiagram.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/ModelMedicineObjectDiagram.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/SDforDeleteMedicine.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/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/UserGuide_InformationPanel.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 added docs/images/UserGuide_ListCommand.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 added docs/images/UserGuide_SelectCommand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 33 additions & 27 deletions docs/team/jtankw3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,61 @@
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: MediTabs

---
Welcome to my Project Portfolio. Here you can find out more about my contributions in various projects to help you better evaluate my technical and communication skills.

== Overview
== PROJECT: MediTabs
=== Introduction

MediTabs is a desktop application for managing medicine stock taking.
It aims to equip clinics with the ability to easily keep track of their medicine inventory and take note of important information such as which medicines are low in stock, expiring soon or have expired.
MediTabs is a desktop application for managing medicine stock taking. It was created to provide pharmacist with a straightforward and efficient way to keep track of and maintain their medicine inventory.
MediTabs is a brownfield project that initially started as an address book application.
It was developed in a team of 4 as part of a software engineering module which spanned a total of about 13 weeks.
Our team identified the strengths of the initial product, which is the ability to store and organize information easily, and chose to morph the product in order to capitalize on these strengths and use them to solve a more realistic problem.

== Summary of contributions
In this project, I was in charge of implementing the information panel feature.

=== Summary of contributions

* *Major enhancement*: added *the information panel and the commands to manipulate information on the panel*
** What it does: allows users to add, edit and remove information of different batches of medicine. This information is displayed in a table format for easy reference in the information panel. Information of the batches is also collated by the panel and a summary of important information such as total quantity and next expiry date is shown. The table can also be sorted by batch number, quantity or expiry date.
** Justification: The information panel provides a visual interface for users to refer to when updating their inventory. Organzing medicine by type and batch instead of just by type also allows for quicker identification of problematic batches.
** Highlights: The information panel is the main visual interface that the user will be referring to, hence it was essential to provide enough details for it to be useful to the user, but not so much that it looks cluttered. Implementation was challenging as it not only involved changing existing commands (add and edit) but also required a good understanding of the whole architecture of the program. This is because the feature involved adding functionality to all components of the architecture, namely UI, Logic, Model and Storage.
** Credits: The existing code for UI and commands in address book was used as a reference to implement this feature.
* *Major enhancement*: added the information panel and the `sort` and `update` commands used to manipulate information on the panel.
** What it does: allows users to add, edit and remove information of different batches of medicine. This information is displayed in a table format for easy reference in the information panel. The panel also collates the information and provides a summary of important details such as total quantity and next expiry date. The table can also be sorted by batch number, quantity or expiry date.
** Justification: Organizing medicine by batch allows for quicker identification of problematic batches. With each medicine having multiple batches, a way to organize the information neatly to avoid confusion for the user is needed. The information panel provides a visual interface that is simple and well structured for users to refer to when updating their inventory.
** Highlights: A large amount of planning was done to decide what information would be useful to the user. Implementation was challenging as it not only involved changing existing commands (`add` and `edit`) but also adding functionality to every component of the architecture, namely Logic, Storage, Model and UI.

* *Minor enhancement*:
* *Minor enhancement*: Enhanced the existing `find` command to be able to search other fields. (Pull requests: https://github.com/CS2103-AY1819S2-T12-3/main/pull/180[#180])

* *Code contributed*:
* *Code contributed*: https://nus-cs2103-ay1819s2.github.io/cs2103-dashboard/#=undefined&search=jtankw3[code]

* *Other contributions*:

** Project management:
*** Helped to manage issue tracker for the first few weeks before individual project boards were set up: (Issues: https://github.com/CS2103-AY1819S2-T12-3/main/issues/9[#9] https://github.com/CS2103-AY1819S2-T12-3/main/issues/2[#2] Project board: https://github.com/CS2103-AY1819S2-T12-3/main/projects/3[#3])
** Enhancements to existing features:
*** Did initial refactoring from address book to MediTabs (Pull request https://github.com/CS2103-AY1819S2-T12-3/main/pull/34[#34])
*** UI enhancement - Moved tags to bottom of `MedicineCard` shown in the list to improve readability (Pull request https://github.com/CS2103-AY1819S2-T12-3/main/pull/193[#193])
** Team contributions:
*** Reviewed team's pull requests (Notable reviews: https://github.com/CS2103-AY1819S2-T12-3/main/pull/25[#25] https://github.com/CS2103-AY1819S2-T12-3/main/pull/115[#115] https://github.com/CS2103-AY1819S2-T12-3/main/pull/191[#191])
*** Helped edit ContactUs.adoc to reflect our team's information (Pull request https://github.com/CS2103-AY1819S2-T12-3/main/pull/31[#31])

_{you can add/remove categories in the list above}_
=== 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.

== Contributions to the User Guide
include::../UserGuide.adoc[tag=informationpanelfeature]

|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===
include::../UserGuide.adoc[tag=inventoryforecasting]

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

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

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

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

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


== 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=modelcomponentobjectdiagram]

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

include::../DeveloperGuide.adoc[tag=usecase]
include::../DeveloperGuide.adoc[tag=updatetesting]

Click https://cs2103-ay1819s2-t12-3.github.io/main/DeveloperGuide.html#updating-batch-details-of-a-medicine[here] to see the remainder of the test cases.
15 changes: 5 additions & 10 deletions src/main/java/seedu/address/logic/commands/UpdateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class UpdateCommand extends Command {
+ "Parameters: INDEX "
+ PREFIX_BATCHNUMBER + "BATCH_NUMBER "
+ "[" + PREFIX_QUANTITY + "QUANTITY] "
+ "[" + PREFIX_EXPIRY + "EXPIRY]\n"
+ "[" + PREFIX_EXPIRY + "EXPIRY_DATE]\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_BATCHNUMBER + "HH-156224 "
+ PREFIX_QUANTITY + "40 "
Expand Down Expand Up @@ -76,7 +76,10 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
}

Medicine medicineToUpdate = lastShownList.get(targetIndex.getZeroBased());
Batch batchToUpdate = getBatchToUpdate(medicineToUpdate);
Batch batchToUpdate = medicineToUpdate.getBatches().get(newBatchDetails.getBatchNumber());
if (batchToUpdate == null) {
assertCanAddNewBatchToMedicine(medicineToUpdate);
}

Batch updatedBatch = createUpdatedBatch(batchToUpdate);
Medicine updatedMedicine = createUpdatedMedicine(medicineToUpdate, batchToUpdate, updatedBatch);
Expand All @@ -88,14 +91,6 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
return new CommandResult(String.format(MESSAGE_SUCCESS, updatedBatch));
}

private Batch getBatchToUpdate(Medicine medicineToUpdate) throws CommandException {
Batch batchToUpdate = medicineToUpdate.getBatches().get(newBatchDetails.getBatchNumber());
if (batchToUpdate == null) {
assertCanAddNewBatchToMedicine(medicineToUpdate);
}
return batchToUpdate;
}

/**
* @throws CommandException if requirements needed to add a new batch is not met.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static Company parseCompany(String company) throws ParseException {
public static Expiry parseExpiry(String expiry) throws ParseException {
requireNonNull(expiry);
String trimmedExpiry = expiry.trim();
if (!Expiry.isValidDate(trimmedExpiry)) {
if (trimmedExpiry.equals("-") || !Expiry.isValidDate(trimmedExpiry)) {
throw new ParseException(Expiry.MESSAGE_CONSTRAINTS);
}
return new Expiry(trimmedExpiry);
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
public class SampleDataUtil {
public static Medicine[] getSampleMedicines() {
return new Medicine[] {
new Medicine(new Name("Aspirin"), new Company("Otsuka Pharmaceutical Co."), new Quantity("807"),
new Expiry("29/11/2019"), getTagSet("fever"), getBatchSet("CD485", "807", "29/11/2019")),
new Medicine(new Name("Atorvastatin"), new Company("Mitsubishi Tanabe Pharma"), new Quantity("296"),
new Medicine(new Name("Aspirin"), new Company("Otsuka Pharmaceutical Co."), new Quantity("27"),
new Expiry("29/11/2019"), getTagSet("fever"), getBatchSet("CD485", "27", "29/11/2019")),
new Medicine(new Name("Atorvastatin"), new Company("Mitsubishi Tanabe Pharma"), new Quantity("39"),
new Expiry("31/12/2019"), getTagSet("cardiovascular"),
getBatchSet("BAL101025", "296", "31/12/2019")),
new Medicine(new Name("Bendroflumethiazide"), new Company("Piramal Healthcare"), new Quantity("58"),
getBatchSet("BAL101025", "39", "31/12/2019")),
new Medicine(new Name("Bendroflumethiazide"), new Company("Piramal Healthcare"), new Quantity("52"),
new Expiry("03/10/2019"), getTagSet("hypertension", "tablet"),
getBatchSet("1001194", "58", "03/10/2019")),
new Medicine(new Name("Co-codamol"), new Company("Renovo PLC"), new Quantity("283"),
new Expiry("28/02/2020"), getTagSet("painkiller"), getBatchSet("HK-85412", "283", "28/02/2020")),
new Medicine(new Name("Omeprazole"), new Company("Eli Lilly and Company"), new Quantity("921"),
getBatchSet("1001194", "52", "03/10/2019")),
new Medicine(new Name("Co-codamol"), new Company("Renovo PLC"), new Quantity("28"),
new Expiry("28/02/2020"), getTagSet("painkiller"), getBatchSet("HK-85412", "28", "28/02/2020")),
new Medicine(new Name("Omeprazole"), new Company("Eli Lilly and Company"), new Quantity("121"),
new Expiry("02/07/2019"), getTagSet("gastroesophageal"),
getBatchSet("A4415115698", "421", "02/07/2019", "A4415118456", "500", "22/09/2019")),
new Medicine(new Name("Simvastatin"), new Company("Vion Pharmaceuticals, Inc."), new Quantity("312"),
new Expiry("16/09/2019"), getTagSet("lipid"), getBatchSet("B5003B504", "312", "16/09/2019"))
getBatchSet("A4415115698", "21", "02/07/2019", "A4415118456", "100", "22/09/2019")),
new Medicine(new Name("Simvastatin"), new Company("Vion Pharmaceuticals, Inc."), new Quantity("41"),
new Expiry("16/09/2019"), getTagSet("lipid"), getBatchSet("B5003B504", "41", "16/09/2019"))
};
}

Expand Down
18 changes: 14 additions & 4 deletions src/main/java/seedu/address/ui/BatchTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public BatchTable(Medicine selectedMedicine, InformationPanelSettings informatio
setColumnWidth();
populateTable(selectedMedicine);
sortTable(informationPanelSettings);
disableSortingByClicks(); // To prevent sorting without change to InformationPanelSettings
}

private void setDescriptionTexts(Medicine selectedMedicine) {
Expand Down Expand Up @@ -102,8 +103,6 @@ private void populateTable(Medicine selectedMedicine) {
* Sorts the table depending on the {@code informationPanelSettings}.
*/
private void sortTable(InformationPanelSettings informationPanelSettings) {
table.getSortOrder().clear();

SortProperty sortProperty = informationPanelSettings.getSortProperty();
SortDirection sortDirection = informationPanelSettings.getSortDirection();

Expand All @@ -122,12 +121,23 @@ private void sortTable(InformationPanelSettings informationPanelSettings) {
throw new IllegalArgumentException("Unknown sort property.");
}

if (sortDirection.equals(SortDirection.ASCENDING)) {
switch (sortDirection) {
case ASCENDING:
column.setSortType(TableColumn.SortType.ASCENDING);
} else if (sortDirection.equals(SortDirection.DESCENDING)) {
break;
case DESCENDING:
column.setSortType(TableColumn.SortType.DESCENDING);
break;
default:
throw new IllegalArgumentException("Unknown sort direction.");
}

table.getSortOrder().add(column);
}

private void disableSortingByClicks() {
numberColumn.setSortable(false);
quantityColumn.setSortable(false);
expiryColumn.setSortable(false);
}
}
1 change: 0 additions & 1 deletion src/main/java/seedu/address/ui/InformationPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class InformationPanel extends UiPart<Region> {
public InformationPanel(ObservableValue<Medicine> selectedMedicine,
ObservableValue<InformationPanelSettings> settings) {
super(FXML);

informationPanelSettings = settings.getValue();

// Load medicine information page when selected medicine changes.
Expand Down

0 comments on commit b1f9594

Please sign in to comment.