Skip to content

Commit

Permalink
Merge pull request #257 from afiqlattif/update-docs
Browse files Browse the repository at this point in the history
DeveloperGuide.adoc: Update Implementation
  • Loading branch information
AmabelYeo committed Nov 12, 2018
2 parents 68432a4 + de2585e commit 03960d8
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 54 deletions.
85 changes: 85 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,91 @@ We are using `java.util.logging` package for logging. The `LogsCenter` class is

Certain properties of the application can be controlled (e.g App name, logging level) through the configuration file (default: `config.json`).


//tag::command-add[]
=== Add Volunteer command
The `add` command in the volunteer context is used to add a volunteer to the application.

===== Current implementation

This `add` command requires the `AddCommandParser` class to parse user input and add a volunteer with the details specified by the user. Currently, the details that are required by the user is Name, VolunteerId (NRIC), Gender, Birthday, Phone, Email and Address.

`AddCommandParser` implements the `Parser` class which has the `Parser#parse()` operation. This operation will throw an error if the user input does not match the command format.

The `add` command updates the context in `ModelManager` through `addVolunteer`.

In addition to adding a volunteer, the `add` command also does the following:

* Saves the current database state through `commitAddressBook` (for undo/redo functions).
* Raise a `OverviewPanelVolunteerUpdateEvent` to update the Overview panel for volunteer context.

The figure below shows the sequence diagram for an `add` command in the volunteer context.

image::command_add_sd.png[switch SD, 800]

The following code snippet shows the fields that are required by the user when inputting the volunteer details for the `add` command:
```Java
public class AddCommand extends Command {
//...
@Override
public CommandResult execute(Model model, CommandHistory history) throws CommandException {
requireNonNull(model);

if (model.hasVolunteer(toAdd)) {
throw new CommandException(MESSAGE_DUPLICATE_VOLUNTEER);
}

model.addVolunteer(toAdd);
model.commitAddressBook();
EventsCenter.getInstance().post(new OverviewPanelVolunteerUpdateEvent());
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
}
//...
}
```

===== Design considerations
====== Aspect: Choice of VolunteerId
* **Alternative 1 (current choice):** The use of unique identifier NRIC.
+
[cols="1,10"]
|===
|Pros| It is unique to each volunteer, and validates the uniqueness of a volunteer entry.
|Cons| It is larger in size than an integer, hence may incur more storage use.
|===
+

* **Alternative 2:** Use of auto-incremented integer VolunteerId.
+
[cols="1,10"]
|===
|Pros| It requires less storage, and easier to maintain.
|Cons| It may not be a strong indicator of uniqueness.
|===
+


====== Aspect: Birthday Display Format
* **Alternative 1 (current choice):** Use a BirthdayUtil class to change format of date.
+
[cols="1,10"]
|===
|Pros| It requires less storage to store Birthday in original format.
|Cons| It requires BirthdayUtil to be invoked every time Birthday is to be displayed to the user.
|===
+

* **Alternative 2:** Immediately store Birthday as preferred user friendly format.
+
[cols="1,10"]
|===
|Pros| It does not require BirthdayUtil to be invoked every time the Birthday is to be displayed to the user.
|Cons| It is difficult to maintain given that Birthday formats are of different length. Furthermore, requires more storage usage.
|===
+

//end::command-add[]

//tag::command-switch[]

[[Implementation-Switch]]
Expand Down
35 changes: 18 additions & 17 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ The following figure shows the expected display after executing the `overview` c
.Overview of events and volunteers
image::command_overview.png[overview, 600]

// tag::volunteermanagement[]
=== Volunteer Management

[[command-volunteer-add]]
Expand All @@ -263,51 +264,54 @@ Format: `add n/NAME g/GENDER b/BIRTHDAY p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]

****
* Birthday is in the 'DD-MM-YYYY format'.
* VolunteerId (NRIC) can be in either lowercase or uppercase.
* A volunteer can have any number of tags (including 0).
****

Example(s):

.Before adding a volunteer
image::command_volunteer_add_before.png[add command, 200]
image::command_volunteer_list.png[add command, 200]

The figure above shows how the panel looks like before executing the commands below.

* `add n/John Doe g/m b/05-08-1995 p/87183749 e/John@gmail.com a/Yishun Block 62 `
* `add n/John Doe ic/S9531080R g/m b/05-08-1995 p/87183749 e/John@gmail.com a/Yishun Block 62 `
+
Adds a volunteer with the following properties:
+
[options="header", cols="1,3"]
|===
|Property |Value
|Name |John Doe
|Gender |m
|NRIC |S9531080R
|Gender |m (Male)
|Birthday |05-08-1995
|Phone |87183749
|Email |John@gmail.com
|Address |Yishun Block 62
|===
.Output of `add`
image::command_volunteer_add_after1.png[add command, 200]
image::command_volunteer_add_after1.png[add command, 500]


* `add n/Betty Sue g/f b/31-12-1995 p/81749272 e/Betty@gmail.com a/Ang Mo Kio Block 62 t/Longtime t/Helpful`
* `add n/Betty Sue ic/S9567432B g/f b/31-12-1995 p/81749272 e/Betty@gmail.com a/Ang Mo Kio Block 62 t/Longtime t/Helpful`
+
Adds a volunteer with the following properties:
+
[options="header", cols="1,3"]
|===
|Property |Value
|Name |Betty Sue
|Gender |f
|NRIC |S9567432B
|Gender |f (Female)
|Birthday |31-12-1995
|Phone |81749272
|Email |Betty@gmail.com
|Address |Ang Mo Kio Block 62
|Tags |Longtime, Helpful
|===
.Output of `add`
image::command_volunteer_add_after2.png[add command, 200]
image::command_volunteer_add_after2.png[add command, 500]

[[command-volunteer-list]]
==== Listing all volunteers : `list`
Expand All @@ -330,6 +334,7 @@ Format: `edit VOLUNTEER_INDEX [n/NAME] [g/GENDER] [b/BIRTHDAY] [p/PHONE_NUMBER
****
* Edits the volunteer at the specified `INDEX`. The index refers to the index number shown in the displayed volunteer list. The index *must be a positive integer* 1, 2, 3, ...
* At least one of the optional fields must be provided.
* Editing of VolunteerId (NRIC) is not allowed.
* Existing values will be updated to the input values.
* When editing tags, the existing tags of the volunteer will be removed i.e adding of tags is not cumulative.
* You can remove all the volunteer's tags by typing `t/` without specifying any tags after it.
Expand All @@ -343,11 +348,8 @@ Edits the name of the volunteer at index 1
The figures below show the before and after results of an edit command.

--
.Before entering the edit command
image::command_volunteer_edit_before.png[Before edit, 200]

.The targeted volunteer is updated to reflect the new values after entering the edit command
image::command_volunteer_edit_after.png[After edit, 200]
image::command_volunteer_edit.png[After edit, 500]
--


Expand All @@ -365,13 +367,12 @@ Deletes the details of the volunteer specified at index 1
The figures below show the before and after results of a delete command.

--
.The volunteer at index 1 is targeted before entering the delete command
image::command_volunteer_delete_before.png[Before delete, 200]

.The targeted volunteer is deleted after entering the delete command
image::command_volunteer_delete_after.png[After delete, 200]
.The targeted volunteer at index 1 is deleted after entering the delete command
image::command_volunteer_delete.png[After delete, 500]
--

// end::volunteermanagement[]

// tag::exportcert[]
[[command-volunteer-exportcert]]
==== Exporting volunteer certificate : `exportcert`
Expand Down Expand Up @@ -710,7 +711,7 @@ This section contains a summary of the commands available.
[width="100%",cols="10%, 30%, 30%, 30%",options="header",]
|=======================================================================
| Command | Format | Example | Section Link
| *Add* | `add n/NAME b/BIRTHDAY g/GENDER a/ADDRESS e/EMAIL p/PHONE_NUMBER [t/TAG]...` | `add n/John Doe b/05-08-199ck 62 p/87183749 e/John@gmail.com` | <<command-volunteer-add>>
| *Add* | `add n/NAME ic/NRIC g/GENDER b/BIRTHDAY p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` | `add n/John Doe ic/S1234567A g/m b/05-08-1995 p/87183749 e/John@gmail.com a/Yishun Block 62`| <<command-volunteer-add>>
| *Delete* | `delete VOLUNTEER_INDEX` | `delete 3` | <<command-volunteer-delete>>
| *Edit* | `edit VOLUNTEER_INDEX [n/NAME][b/BIRTHDAY] [g/GENDER] [a/ADDRESS] [e/EMAIL] [p/PHONE_NUMBER] [t/TAG]...` | `edit 2 n/James Lee e/jameslee@example.com` | <<command-volunteer-edit>>
| *Export Certificate* | `exportcert VOLUNTEER_INDEX` | `exportcert 2` | <<command-volunteer-exportcert>>
Expand Down
Binary file added docs/diagrams/Command_Add_SequenceDiagram.pptx
Binary file not shown.
Binary file modified docs/images/UiLabelled.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/command_add_sd.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/command_clear_after.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/command_clear_before.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/command_volunteer_add_after1.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/command_volunteer_add_after2.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/command_volunteer_delete.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/command_volunteer_edit.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/command_volunteer_list.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: 23 additions & 37 deletions docs/team/afiqlattif.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,42 @@
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets
:repoURL: https://github.com/CS2103-AY1819S1-W16-2/main

== PROJECT: SocialCare

---
== PROJECT: SocialCare

:sectnums:
== Overview

SocialCare morphs the given AddressBook - Level 4 application into a volunteer management system that allows Social Welfare Organisations to better manage their volunteers & events, and gain further statistical insights from the data. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.
This portfolio records my contributions to the SocialCare project, under the CS2103T Software Engineering module offered by the School of Computing in NUS.

SocialCare empowers volunteer managers to revolutionise the way they manage their resources. With features such as Statistics and Exporting of Certificates with a simple command, the organisational process has never been as effective.

With my role as a Developer for this project, I implemented *volunteer management functions*, ensuring that the organizational process is simpler yet systematic.

== Summary of contributions

* *Major enhancement*: added *the ability to undo/redo previous commands*
** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
** 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 changes to existing commands.
** 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}_
My contributions to the project mainly focuses on volunteer management.

* *Major enhancement*: Added *commands to manage volunteers*
** What it does: Allows the user to manage volunteer details with commands such as add, edit and delete.
** Justification: Streamlines the management of volunteers to fit the volunteer organisation context
** Highlights: 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 changes to existing commands by implementing additional fields and checks.

* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys.
* *Minor enhancement*: Added a Birthday util that exports birth date to a readable format and checks if birth day is before current date.

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_
* *Code contributed*:
Here is a https://nus-cs2103-ay1819s1.github.io/cs2103-dashboard/#=undefined&search=afiqlattif[link]
to my code on the 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]
*** Did cosmetic tweaks to existing contents of the User Guide: link:https://github.com/CS2103-AY1819S1-W16-2/main/pull/173[#173]
*** Revised content in the Developer Guide: link:https://github.com/CS2103-AY1819S1-W16-2/main/pull/72[#72], link:https://github.com/CS2103-AY1819S1-W16-2/main/pull/121[#121]
** 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}_
*** Reviewed PRs for team members (with non-trivial comments) : link:https://github.com/CS2103-AY1819S1-W16-2/main/pull/144[#144], link:https://github.com/CS2103-AY1819S1-W16-2/main/pull/174[#174]

== Contributions to the User Guide

Expand All @@ -50,23 +46,13 @@ _{you can add/remove categories in the list above}_
|_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=dataencryption]
include::../UserGuide.adoc[tag=volunteermanagement]

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

---
include::../DeveloperGuide.adoc[tag=command-add]

_{Optionally, you may include other projects in your portfolio.}_

0 comments on commit 03960d8

Please sign in to comment.