Skip to content

Commit

Permalink
Merge pull request #248 from AY2324S1-CS2103T-W12-1/v1.4-DeveloperGui…
Browse files Browse the repository at this point in the history
…de-Update

Add details of sort and delete leave in DG
  • Loading branch information
JasonRay168 authored Nov 12, 2023
2 parents 2ddd84f + 7e04254 commit 9515eeb
Show file tree
Hide file tree
Showing 10 changed files with 479 additions and 21 deletions.
276 changes: 260 additions & 16 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions docs/diagrams/DeleteLeaveActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:User inputs Delete Leave Command;

if () then ([else])
:Display error message;
else ([Valid command format])
if () then ([else])
:Display error message;
else ([Valid ID])
if () then ([else])
:Display error message;
else ([Valid date format])
if () then ([else])
:Display error message;
else ([no leave found between start and end dates])
if () then ([else])
:Display error message;
else ([leaves found between start and end dates])
: Delete leaves found between start and end dates;
endif
endif
endif
endif
endif

stop

@enduml
72 changes: 72 additions & 0 deletions docs/diagrams/DeleteLeaveSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DeleteLeaveCommandParser" as DeleteLeaveCommandParser LOGIC_COLOR
participant "r:DeleteLeaveCommand" as DeleteLeaveCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box
[-> LogicManager : execute("deleteleave id/EID1234-5678 from/2023-11-01 to/2023-11-02")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("deleteleave id/EID1234-5678 from/2023-11-01 to/2023-11-02")
activate AddressBookParser

create DeleteLeaveCommandParser
AddressBookParser -> DeleteLeaveCommandParser
activate DeleteLeaveCommandParser

DeleteLeaveCommandParser --> AddressBookParser
deactivate DeleteLeaveCommandParser

AddressBookParser -> DeleteLeaveCommandParser : parse("id/EID1234-5678 from/2023-11-01 to/2023-11-02")
activate DeleteLeaveCommandParser

create DeleteLeaveCommand
DeleteLeaveCommandParser -> DeleteLeaveCommand
activate DeleteLeaveCommand

DeleteLeaveCommand --> DeleteLeaveCommandParser : r
deactivate DeleteLeaveCommand

DeleteLeaveCommandParser --> AddressBookParser : r
deactivate DeleteLeaveCommandParser

DeleteLeaveCommandParser -[hidden]-> AddressBookParser
destroy DeleteLeaveCommandParser

AddressBookParser --> LogicManager : r
deactivate AddressBookParser

LogicManager -> DeleteLeaveCommand : execute()
activate DeleteLeaveCommand

DeleteLeaveCommand -> Model : setEmployee(targetEmployee, editedEmployee)
activate Model

Model --> DeleteLeaveCommand

DeleteLeaveCommand -> Model : updateFilteredEmployeeList()

Model --> DeleteLeaveCommand
deactivate Model

create CommandResult
DeleteLeaveCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteLeaveCommand
deactivate CommandResult

DeleteLeaveCommand --> LogicManager : result
deactivate DeleteLeaveCommand

[<--LogicManager
deactivate LogicManager
@enduml
23 changes: 23 additions & 0 deletions docs/diagrams/SortActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:User inputs Sort Command;

if () then ([else])
:Display error message;
else ([Valid command format])
if () then ([else])
:Display error message;
else ([Valid field])
if () then ([else])
:Display error message;
else ([Valid order])
: Sort all employees by specified field and order;
endif
endif
endif

stop

@enduml
88 changes: 88 additions & 0 deletions docs/diagrams/SortSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":SortCommandParser" as SortCommandParser LOGIC_COLOR
participant "s:SortCommand" as SortCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":AddressBook" as AddressBook MODEL_COLOR
participant ":UniqueEmployeeList" as UniqueEmployeeList MODEL_COLOR
end box
[-> LogicManager : execute("sort f/salary in/asc")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("sort f/salary in/asc")
activate AddressBookParser

create SortCommandParser
AddressBookParser -> SortCommandParser
activate SortCommandParser

SortCommandParser --> AddressBookParser
deactivate SortCommandParser

AddressBookParser -> SortCommandParser : parse("f/salary in/asc")
activate SortCommandParser

create SortCommand
SortCommandParser -> SortCommand
activate SortCommand

SortCommand --> SortCommandParser : s
deactivate SortCommand

SortCommandParser --> AddressBookParser : s
deactivate SortCommandParser

SortCommandParser -[hidden]-> AddressBookParser
destroy SortCommandParser

AddressBookParser --> LogicManager : s
deactivate AddressBookParser

LogicManager -> SortCommand : execute()
activate SortCommand

SortCommand -> SortCommand : handleSortingOrder(model, "salary", "asc")
activate SortCommand

SortCommand --> SortCommand
deactivate SortCommand

SortCommand -> Model : updateSortedEmployeeListAscending("salary");
activate Model

Model -> AddressBook : updateSortedEmployeeListAscending("salary")
activate AddressBook

AddressBook -> UniqueEmployeeList : sortEmployeesAscending("salary");
activate UniqueEmployeeList

UniqueEmployeeList --> AddressBook
deactivate UniqueEmployeeList

AddressBook --> Model
deactivate AddressBook

Model --> SortCommand
deactivate Model

create CommandResult
SortCommand -> CommandResult
activate CommandResult

CommandResult --> SortCommand
deactivate CommandResult

SortCommand --> LogicManager : result
deactivate SortCommand

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/DeleteLeaveActivityDiagram.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/DeleteLeaveSequenceDiagram.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/SortActivityDiagram.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/SortSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/team/jasonray168.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Given below are my contributions to the project.
* **New Attribute**: [OvertimeHours]
* What it represents: It keeps track of the number of overtime hours taken by an employee.
* Justification: Users will need to keep track of employee overtime hours to make changes their bonus salary and performance measures.

* **New Feature**: [Sort]
* What it does: It sorts the list of all employees based on a field and an order.
* Justification: Users will want to check for employee with the highest salary, the highest overtime hours taken, etc.
Expand All @@ -30,11 +29,12 @@ Given below are my contributions to the project.

* **Project management**: Reviewing and approving pull requests on GitHub, assign bug issues to my account on GitHub.

* **Enhancements to existing features**:

* **Documentation**:
* User Guide: Added guides for sort, add leave, and delete leave features.
* Developer Guide: Added implementation guide for sort feature.
* User Guide: Add guides for sort, add leave, and delete leave features.
* Developer Guide:
* Add implementation details for sort and delete leave features.
* Add instructions for manual testing for sort and delete leave features.
* Add details for planned enhancements.

* **Community**:

Expand Down

0 comments on commit 9515eeb

Please sign in to comment.