From 5594971e572b7d9156bb5d03671151302a177291 Mon Sep 17 00:00:00 2001 From: Yucongkoo Date: Thu, 9 Nov 2023 13:36:39 +0800 Subject: [PATCH] Add planned enhancements for tag and insurance command Added planned enhancements for tag and insurance command --- docs/DeveloperGuide.md | 59 ++++++++++++++++--- .../tag-feature/ExecuteActivityDiagram.puml | 21 +++++++ .../tag-feature/TagCommandClassDiagram.puml | 17 ++++++ docs/team/yucongkoo.md | 6 +- 4 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 docs/diagrams/tag-feature/ExecuteActivityDiagram.puml create mode 100644 docs/diagrams/tag-feature/TagCommandClassDiagram.puml diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index c01cae436fe..6601ea08e42 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -191,6 +191,10 @@ This section describes some noteworthy details on how certain features are imple This feature allows users to assign tags to / remove tags from customers in EzContact, increasing the recognizability of customers to users. +The activity diagram below shows the action sequence of updating the tags of a customer. + + + ### Implementation ###### **Implementing `Tag`** @@ -242,6 +246,10 @@ taking `parse(1 at/tall dt/short at/handsome)` call to the `TagCommandParser` as ###### **Implementing `TagCommand`** +The following class diagram illustrates how a `TagCommand` hold information required for its execution. + + + `TagCommand` plays the role of executing the tag command on a `Model`, it will update the `Model` accordingly to reflect the changes after the tag command completes its execution. Note that if there are conflicting tags(i.e. there is a common tag to add and delete), the command execution will fail.
@@ -982,7 +990,7 @@ Priorities: High - `* * *`, Medium - `* *`, Low - `*` **Mss:**
 1. User requests to list out the customers.
 2. System displays the requested list of customers to the user.
- 3. User enters index of targeted customer and information of tags to update.
+ 3. User enters index of targeted customer and information of tags to add or delete.
 4. System updates the tags of the specified customer accordingly.
 5. System displays the details of the updated customer.
 Use case ends.
@@ -1043,12 +1051,44 @@ Priorities: High - `* * *`, Medium - `* *`, Low - `*` This section covers the enhancements we plan to implement in the future. -#### Enhancement -(details of the enhancement...) +#### Enhancement 1 : Deletion of all tags(and insurances) in a single command + +**Feature flaw:**
+As a customer might have many tags, and they could potentially want to remove all the +tags in one command, they would have to type out all the tags separately in order to achieve that. + +**Proposed enhancement:**
+We provide a convenient way for users to delete all the tags in one command by adding an optional parameter +to the command. The updated command format would be as follows:
+`tag [at/]... [dt/]... [dat/deleteall]`. -**Feature flaw:** (feature flaw it fixes...) +Justifications: +* As deleting all the tags is a destructive action, we require users to specify the `dat/` prefix to indicate +their interest in deleting all tags, and `deleteall` value to the prefix to serve as a confirmation of this +destructive command. -(explain how enhancement fixes the flaws... ) +Updated behaviours (original behaviours of tag still hold): +* When a `dat/` prefix is supplied, there should not be any `at/` or `dt/` prefix supplied in the same command, if there +is, a format error message will be shown to the user. +* If the value provided to parameter `dat/` is not `deleteall`, show an error message to users, indicating that +they should supply the `deleteall` value to `dat/` in order to confirm the deletion. + +**Examples:**
+* `tag 1 dat/deleteall`
+Expected: All the tags of customer at index 1 is deleted, a `successfully deleted all tags` message is shown to user. + +* `tag 1 at/tall dat/deleteall`
+Expected: Error, an error message showing the usage of tag command is shown to the user. + +* `tag 1 dat/delete`
+Expected: Error, an error message informing the user that they should input `deleteall` to confirm the deletion of all tags +is shown to the user. + +**Additional notes:**
+As the behaviour of the `insurance` command is nearly identical to `tag` command, this planned enhancement applies to +the `insurance` command too, the proposed enhancements and behaviours will be identical. The following is the updated +command format for `insurance` command:
+`insurance [ai/]... [di/]... [dai/deleteall]` --------------------------------------------------------------------------------------------------------------------
@@ -1134,13 +1174,16 @@ Prerequisite : - Expected : The tags assigned to the customer at index 1 will be updated accordingly(adds `tall` and `fat` tag, deletes `short` and `skinny` tag). 1. Test case : `tag 0 at/tall`
- Expected : No customer is updated. Error details shown in the status message(format error since the index is not a positive integer). + Expected : Error, details shown in the status message(format error since the index is not a positive integer). 1. Test case : `tag 1`
- Expected : No customer is updated. Error details shown in the status message(format error since no tag to update is provided). + Expected : Error, details shown in the status message(format error since no tag to update is provided). 1. Test case: `tag 1 at/tall dt/tall`
- Expected : No customer is updated. Error details shown in the status message(conflicting tags). + Expected : Error, details shown in the status message(conflicting tags). + +1. Test case: `tag 1 dt/dsajdkl`, the tag to delete does not exist in cutomer 1
+ Expected: Error, details shown in the status message(customer not updated).
diff --git a/docs/diagrams/tag-feature/ExecuteActivityDiagram.puml b/docs/diagrams/tag-feature/ExecuteActivityDiagram.puml new file mode 100644 index 00000000000..efcaca2d4c4 --- /dev/null +++ b/docs/diagrams/tag-feature/ExecuteActivityDiagram.puml @@ -0,0 +1,21 @@ +@startuml +skin rose +skinparam ActivityFontSize 15 +skinparam ArrowFontSize 12 +start +:User provides tags to add and delete; + +'Since the beta syntax does not support placing the condition outside the +'diamond we place it as the true branch instead. +if () then + :Update tags of targeted customer; + if () then + :Save updated customer to Model; + else ([updated customer's tag set unchanged or invalid]) + stop + endif + stop +else ([has conflicting tags to add and delete]) + stop +endif +@enduml diff --git a/docs/diagrams/tag-feature/TagCommandClassDiagram.puml b/docs/diagrams/tag-feature/TagCommandClassDiagram.puml new file mode 100644 index 00000000000..21ebf223c9e --- /dev/null +++ b/docs/diagrams/tag-feature/TagCommandClassDiagram.puml @@ -0,0 +1,17 @@ +@startuml +!include ../style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor LOGIC_COLOR +skinparam classBackgroundColor LOGIC_COLOR + +Class TagCommand +Class Index +Class UpdatePersonTagsDescriptor +Class Tag + +TagCommand --> "1" Index +TagCommand --> "1" UpdatePersonTagsDescriptor +UpdatePersonTagsDescriptor --> "~* tags to add" Tag +UpdatePersonTagsDescriptor --> "~* tags to delete" Tag + +@enduml diff --git a/docs/team/yucongkoo.md b/docs/team/yucongkoo.md index d1af4926fe8..1817a7df668 100644 --- a/docs/team/yucongkoo.md +++ b/docs/team/yucongkoo.md @@ -20,7 +20,7 @@ Given below are my contributions to the project. helpful in identifying their customers. * **Highlights:** This enhancement required an in-depth analysis of design alternatives, from choice of data structure to hold the tags, to handling of certain user behaviours such as handling of duplicate tags provided, conflicting tags provided and - addition(deletion) of existing(non-existing). + addition(deletion) of existing(non-existing). The decisions made were mainly driven by ensuring the best user experience. * **Credits:** The association between the `Tag` class and `Person` class was originally implemented in AB-3, there was not much modification done to this association
@@ -44,7 +44,8 @@ Given below are my contributions to the project. conversion between json format and model type(PR [#103](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/103)). Throughout the process of refactoring,discovered and solved a bug in original AB-3 conversion[PR [#204](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/204)]. * Created UI componenet `FlowPaneLabel` used to display priority, tags and insurances associated to a customer (PRs [#162](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/162), [#208](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/208)). * Updated the GUI color scheme and overall design (PR [#189](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/189)) - * Added the functionality of secondary prefix, that is every prefix now has a shorthand representation and a full name representation (PR [#238](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/238)) + * Added the functionality of secondary prefix, that is every prefix now has a shorthand representation and a full name representation, + while also making the prefixes not case-sensitive (PR [#238](https://github.com/AY2324S1-CS2103T-W16-2/tp/pull/238))

@@ -54,6 +55,7 @@ Given below are my contributions to the project. * Added documentation for the features `add`, `tag` and also the `Advanced Features` section. * Drafted the overall structure and formatting for features section to be used across team members. * Added the `Prefix to full-name prefix translation table` section. + * Checked the degree of standardization between different sections of the UG. * Tweaked the UG to make it pdf-version friendly. * Developer Guide: * Added the implementation details of the `tag` feature (including all the UML diagrams used in the explanation).