diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 36b1b2a5a44..e71db0f239e 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -293,9 +293,12 @@ Examples: * `filter l/14 r/manager` returns employees with 14 days of leave and the manager role -The following activity diagram summarizes what happens when a user executes the filter command: +The following activity diagram summarizes what happens when a user executes the filter command, the Activity Diagrams +are split into two part to ensure clarity/visibility of the diagrams, however the activities occur simultaneously: + +![FilterActivityDiagramPart1](images/FilterActivityDiagramPart1.png) -![FilterActivityDiagram](images/FilterActivityDiagram.png) +![FilterActivityDiagramPart2](images/FilterActivityDiagramPart2.png) The following is the filter feature's class diagram, illustrating the interaction between the FilterCommand, FilterCommandParser and the ContainsAllPredicate classes. @@ -329,13 +332,11 @@ The following activity diagram summarizes what happens when a user executes the * Pros: Will use less memory (e.g. for `delete`, just save the employee being deleted). * Cons: We must ensure that the implementation of each individual command are correct. - ### \[Proposed\] Data archiving Copy the current ManageHR json file into a backup, with the appropriate name. Load a new sample copy of ManageHR's data file. - -------------------------------------------------------------------------------------------------------------------- ## **Documentation, logging, testing, configuration, dev-ops** @@ -597,3 +598,4 @@ testers are expected to do more *exploratory* testing. 1. Modify `ManageHr.json` illegally. This is by adding illegal json tags, or destruction of the json structure. 2. ManageHR will sense an issue, and replace the working file with the sample dataset. + diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 088242100cd..b565295d7b2 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -89,6 +89,7 @@ supervisors and subordinates. 3. Both employees that are either `manager` or `subordinate` can have multiple `manager` in charge of them. 4. An employee could have no designated "manager" responsible for overseeing them. 5. A `manager` employee could not edit their `role` and `name` attribute when he or she is in charge of any subordinates. +6. Cyclical manager-subordinate relationship between `employee` objects who are `manager` is allowed. ### Usage Instructions @@ -104,11 +105,12 @@ When enrolling a new employee in ManageHR, you can also establish manager-subord #### Editing an Existing Employee with Manager-Subordinate Relationships When editing an existing employee in ManageHR, you can also establish or modify manager-subordinate relationships. Follow these steps: 1. Include `r/ROLE` into `edit` command to change the current `role` of the employee. - - The employee can only change his or her `role` from `manager` to `subordinate` only if he or she has no employees under his or her supervision. - The name of the employee can only be edited if he or she is a `manager` with no employees under his or her supervision. 2. Include `m/MANAGER_NAMEā€¦` into the `edit` command. This will place the employee to be under that `manager`. - The `MANAGER_NAME` stated must correspond with an existing employee with the same name and is also a `manager`. +3. `Employee` who are `manager` can edit their role to be `manager` again without violating any of the Manaer-Subordinate constraint +since their hierarchy level still remains constant. #### Deleting an Existing Employee with Manager-Subordinate Relationships When deleting an existing employee from ManageHR, you will need to account for the manager-subordinate relationships. Follow these steps: diff --git a/docs/diagrams/FilterActivityDiagram.puml b/docs/diagrams/FilterActivityDiagramPart1.puml similarity index 62% rename from docs/diagrams/FilterActivityDiagram.puml rename to docs/diagrams/FilterActivityDiagramPart1.puml index f221af82033..818818864d9 100644 --- a/docs/diagrams/FilterActivityDiagram.puml +++ b/docs/diagrams/FilterActivityDiagramPart1.puml @@ -30,26 +30,6 @@ fork again :Filter with given salary; else ([s/SALARY absent]) endif -fork again - if () then ([l/LEAVE present]) - :Filter with given leave; - else ([l/LEAVE absent]) - endif -fork again - if () then ([r/ROLE present]) - :Filter with given role; - else ([r/ROLE absent]) - endif -fork again - if () then ([m/MANAGER_NAME present]) - :Filter with given manager name; - else ([m/MANAGER_NAME absent]) - endif -fork again - if () then ([d/DEPARTMENT present]) - :Filter with given department; - else ([d/DEPARTMENT absent]) - endif end fork :ManageHR UI shows filtered employees; diff --git a/docs/diagrams/FilterActivityDiagramPart2.puml b/docs/diagrams/FilterActivityDiagramPart2.puml new file mode 100644 index 00000000000..97ce18b4366 --- /dev/null +++ b/docs/diagrams/FilterActivityDiagramPart2.puml @@ -0,0 +1,33 @@ +@startuml +'https://plantuml.com/activity-diagram-beta +skin rose +skinparam ActivityFontSize 15 +skinparam ArrowFontSize 12 +start +:User uses filter command; +fork + if () then ([l/LEAVE present]) + :Filter with given leave; + else ([l/LEAVE absent]) + endif +fork again + if () then ([r/ROLE present]) + :Filter with given role; + else ([r/ROLE absent]) + endif +fork again + if () then ([m/MANAGER_NAME present]) + :Filter with given manager name; + else ([m/MANAGER_NAME absent]) + endif +fork again + if () then ([d/DEPARTMENT present]) + :Filter with given department; + else ([d/DEPARTMENT absent]) + endif +end fork + +:ManageHR UI shows filtered employees; +stop + +@enduml diff --git a/docs/images/FilterActivityDiagram.png b/docs/images/FilterActivityDiagram.png deleted file mode 100644 index af9e2770afb..00000000000 Binary files a/docs/images/FilterActivityDiagram.png and /dev/null differ diff --git a/docs/images/FilterActivityDiagramPart1.png b/docs/images/FilterActivityDiagramPart1.png new file mode 100644 index 00000000000..19aa13bfcf2 Binary files /dev/null and b/docs/images/FilterActivityDiagramPart1.png differ diff --git a/docs/images/FilterActivityDiagramPart2.png b/docs/images/FilterActivityDiagramPart2.png new file mode 100644 index 00000000000..5814eeabc1a Binary files /dev/null and b/docs/images/FilterActivityDiagramPart2.png differ