diff --git a/docs/DeveloperGuide.adoc b/docs/DeveloperGuide.adoc index 66c86bcaca96..8f096a91f538 100644 --- a/docs/DeveloperGuide.adoc +++ b/docs/DeveloperGuide.adoc @@ -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]] diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 3353bbd51677..d50d29a7e966 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -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]] @@ -263,17 +264,18 @@ 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: + @@ -281,17 +283,18 @@ Adds a volunteer with the following properties: |=== |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: + @@ -299,7 +302,8 @@ Adds a volunteer with the following properties: |=== |Property |Value |Name |Betty Sue -|Gender |f +|NRIC |S9567432B +|Gender |f (Female) |Birthday |31-12-1995 |Phone |81749272 |Email |Betty@gmail.com @@ -307,7 +311,7 @@ Adds a volunteer with the following properties: |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` @@ -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. @@ -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] -- @@ -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` @@ -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` | <> +| *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`| <> | *Delete* | `delete VOLUNTEER_INDEX` | `delete 3` | <> | *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` | <> | *Export Certificate* | `exportcert VOLUNTEER_INDEX` | `exportcert 2` | <> diff --git a/docs/diagrams/Command_Add_SequenceDiagram.pptx b/docs/diagrams/Command_Add_SequenceDiagram.pptx new file mode 100644 index 000000000000..20a16815d352 Binary files /dev/null and b/docs/diagrams/Command_Add_SequenceDiagram.pptx differ diff --git a/docs/images/UiLabelled.png b/docs/images/UiLabelled.png index 709c93c72564..a5083e1f346b 100644 Binary files a/docs/images/UiLabelled.png and b/docs/images/UiLabelled.png differ diff --git a/docs/images/command_add_sd.png b/docs/images/command_add_sd.png new file mode 100644 index 000000000000..657af328065d Binary files /dev/null and b/docs/images/command_add_sd.png differ diff --git a/docs/images/command_clear_after.png b/docs/images/command_clear_after.png index 69b51af0861e..330e7e173589 100644 Binary files a/docs/images/command_clear_after.png and b/docs/images/command_clear_after.png differ diff --git a/docs/images/command_clear_before.png b/docs/images/command_clear_before.png index e4858e850d06..398640e11dba 100644 Binary files a/docs/images/command_clear_before.png and b/docs/images/command_clear_before.png differ diff --git a/docs/images/command_volunteer_add_after1.png b/docs/images/command_volunteer_add_after1.png index 3a4e39994fd5..fc33bd9c6dc6 100644 Binary files a/docs/images/command_volunteer_add_after1.png and b/docs/images/command_volunteer_add_after1.png differ diff --git a/docs/images/command_volunteer_add_after2.png b/docs/images/command_volunteer_add_after2.png index 30f185de25ac..542c6d8f14f3 100644 Binary files a/docs/images/command_volunteer_add_after2.png and b/docs/images/command_volunteer_add_after2.png differ diff --git a/docs/images/command_volunteer_delete.png b/docs/images/command_volunteer_delete.png new file mode 100644 index 000000000000..f239ed6d1d01 Binary files /dev/null and b/docs/images/command_volunteer_delete.png differ diff --git a/docs/images/command_volunteer_edit.png b/docs/images/command_volunteer_edit.png new file mode 100644 index 000000000000..f25d37c497ae Binary files /dev/null and b/docs/images/command_volunteer_edit.png differ diff --git a/docs/images/command_volunteer_list.png b/docs/images/command_volunteer_list.png index 5623fb3ba947..8f799c3b503e 100644 Binary files a/docs/images/command_volunteer_list.png and b/docs/images/command_volunteer_list.png differ diff --git a/docs/team/afiqlattif.adoc b/docs/team/afiqlattif.adoc index 931f6d5c4eba..86a6cc7575ed 100644 --- a/docs/team/afiqlattif.adoc +++ b/docs/team/afiqlattif.adoc @@ -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 @@ -50,9 +46,7 @@ _{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 @@ -60,13 +54,5 @@ include::../UserGuide.adoc[tag=dataencryption] |_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.}_