Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SungMatt authored Nov 14, 2023
2 parents d029d5e + f80eddc commit 02525b6
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 25 deletions.
10 changes: 6 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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**
Expand Down Expand Up @@ -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.

4 changes: 3 additions & 1 deletion docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
33 changes: 33 additions & 0 deletions docs/diagrams/FilterActivityDiagramPart2.puml
Original file line number Diff line number Diff line change
@@ -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
Binary file removed docs/images/FilterActivityDiagram.png
Binary file not shown.
Binary file added docs/images/FilterActivityDiagramPart1.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/FilterActivityDiagramPart2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02525b6

Please sign in to comment.