From 86829fbd9fa4d44c1d0be846d1e3177e5d4448b7 Mon Sep 17 00:00:00 2001 From: Emberlynn-Loo Date: Sun, 3 Mar 2024 19:52:45 +0800 Subject: [PATCH] Add Use Cases --- docs/DeveloperGuide.md | 362 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 354 insertions(+), 8 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 1b56bb5d31b..89b40183513 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -290,14 +290,39 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli (For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise) +**Use case: Add a new person** + +**MSS** + +1. User requests to add a new person to JENGA. +2. JENGA prompts user for details of new person. +3. User enters the necessary information. +4. JENGA adds person with the provided details. +5. JENGA displays new person added and confirmation message. + + Use case ends. + +**Extensions** + +* 3a. User enters incomplete or invalid information. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + **Use case: Delete a person** **MSS** -1. User requests to list persons -2. AddressBook shows a list of persons -3. User requests to delete a specific person in the list -4. AddressBook deletes the person +1. User requests to list persons. +2. JENGA displays a list of persons. +3. User selects a specific person in the list to delete by providing the person’s UUID. +4. JENGA deletes the person. +5. JENGA displays confirmation message. Use case ends. @@ -305,13 +330,334 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 2a. The list is empty. - Use case ends. + * 2a1. JENGA informs the user the list is empty. + + Use case ends. + +* 3a. Given UUID is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + Use case resumes at step 4. + +**Use case: Add an attribute to a person** + +**MSS** + +1. User requests to add an attribute to a person. +2. JENGA prompts user to enter the person’s UUID and attribute details. +3. User enters UUID and attribute information. +4. JENGA adds attribute details to specific person’s profile. +5. JENGA displays attribute in person’s profile and confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Attribute details are invalid. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUID is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Edit to add an attribute to a person** + +**MSS** + +1. User requests to edit to add an attribute to a person. +2. JENGA prompts user to enter the person’s UUID and attribute details to add. +3. User enters UUID and attribute information. +4. JENGA adds attribute details to specific person’s profile. +5. JENGA displays attribute in person’s profile and confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Attribute details are invalid. + + * 3a1. JENGA shows an error message. -* 3a. The given index is invalid. + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUID is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Edit to delete an attribute to a person** + +**MSS** + +1. User requests to edit to delete an attribute to a person. +2. JENGA prompts user to enter the person’s UUID and attribute to delete. +3. User enters UUID and attribute information. +4. JENGA deletes attribute in specific person’s profile. +5. JENGA displays confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Attribute details are invalid. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUID is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Delete a person** + +**MSS** + +1. User requests to delete a person. +2. JENGA prompts user for details of person. +3. User enters person’s UUID. +4. JENGA deletes person. +5. JENGA displays confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Given UUID is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + +**Use case: Find persons by attribute** + +**MSS** - * 3a1. AddressBook shows an error message. +1. User requests to find persons by attribute. +2. JENGA prompts user for attribute and attribute value(s). +3. User enters attribute name and attribute value(s). +4. JENGA displays list of persons with each of the specified attributes. - Use case resumes at step 2. + Use case ends. + +**Extensions** + +* 3a. Attribute details are invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 4a. The list is empty. + + * 4a1. JENGA informs the user the list is empty. + + Use case ends. + +**Use case: Find persons by relationship to User** + +**MSS** + +1. User requests to find persons by relationship. +2. JENGA prompts user for relationship to User. +3. User enters relationship type. +4. JENGA displays list of persons with specified relationship to User. + + Use case ends. + +**Extensions** + +* 3a. Relationship is invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Add a relationship between two persons** + +**MSS** + +1. User requests to add a relationship between two persons. +2. JENGA prompts user for UUIDs of both persons and relationship type. +3. User enters both persons UUID and relationship type. +4. JENGA creates a relationship with the provided details. +5. JENGA displays new relationship added under both persons’ profiles and confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Relationship type is invalid. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUIDs are invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Edit a relationship between two persons** + +**MSS** + +1. User requests to edit a specific relationship between two persons. +2. JENGA prompts user for UUIDs of both persons and previous and new relationship type. +3. User enters both persons UUID and previous and new relationship type. +4. JENGA edits the specified relationship with the provided details. +5. JENGA displays edited relationship under both persons’ profiles and confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Relationship types are invalid. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUIDs are invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Delete a relationship between two persons** + +**MSS** + +1. User requests to delete a specific relationship between two persons. +2. JENGA prompts user for UUIDs of both persons and relationship type. +3. User enters both persons UUID and specified relationship type. +4. JENGA deletes specified relationship. +5. JENGA displays confirmation message. + + Use case ends. + +**Extensions** + +* 3a. Relationship type is invalid. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +* 3b. Given UUIDs are invalid or does not exist. + + * 3a1. JENGA shows an error message. + + * 3a2. JENGA prompts User to enter the correct and complete information. + + Steps 3a1-3a2 are repeated until the data entered are correct. + + Use case resumes from step 4. + + Use case ends. + +**Use case: Exit JENGA** + +**MSS** + +1. User requests to exit JENGA. +2. JENGA displays goodbye message. +3. JENGA saves current data. +4. JENGA closes the application window. + + Use case ends. *{More to be added}*