Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the DG #199

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ title: Developer Guide
5. [Storage Component](#storage-component)
6. [Common Classes](#common-classes)
4. [Implementations](#implementation)
1. [Editing a specific tag](#editing-tag)
1. [Add new employee](#adding-new-employee)
1. [Implementation](#implementation-add-new-employee)
2. [Design considerations](#design-consideration-add-employee)
2. [Editing a specific tag](#editing-tag)
1. [Design considerations](#design-consideration-edit-tag)
2. [Implementation](#implementation-edit-tag)
3. [Deleting a specific employee](#deleting-employee)
1. [Implementation](#implementation-delete-employee)
4. [Finding a specific employee with name](#finding-employee-name)
1. [Implementation](#implementation-fiding-employee-name)
5. [Documentation, logging, testing, configuration, dev-ops](#documentation)
6. [Appendix: Requirements](#requirements)
1. [Product scope](#product-scope)
Expand Down Expand Up @@ -189,9 +196,9 @@ Classes used by multiple components are in the `seedu.address.commons` package.

This section describes some noteworthy details on how certain features are implemented.

### \[Implemented\] Add new employee
### \[Implemented\] Add new employee <a name="adding-new-employee"></a>

#### Implementation
#### Implementation <a name="implementation-add-new-employee"></a>

The proposed implementation of adding a new employee is facilitated by `AddCommand` and `AddCommandParser`. The `AddCommand` class encapsulates the logic for adding a new employee, while the `AddCommandParser` class is responsible for parsing the arguments and returning an `AddCommand` object.

Expand Down Expand Up @@ -228,7 +235,7 @@ The following activity diagram summarizes what happens when a user executes an `

The `AddCommand` class is designed to be easily extensible. For example, if a new field is added to the `Person` class, the `AddCommand` class can be easily modified to accommodate the new field.

#### Design considerations:
#### Design considerations: <a name="design-consideration-add-employee"></a>

**Aspect: How `/add` executes:**

Expand All @@ -240,7 +247,6 @@ The `AddCommand` class is designed to be easily extensible. For example, if a ne
* Pros: Provides a more guided experience.
* Cons: May be slower for users who are comfortable with the system.


### Editing a specific tag <a name="editing-tag"></a>

#### Design considerations: <a name="design-consideration-edit-tag"></a>
Expand Down Expand Up @@ -297,6 +303,28 @@ The following activity diagram summarizes what happens when a user executes a `/

![DeleteActivityDiagram](images/DeleteActivityDiagram.png)

### Finding a specific emplyoee <a name="finding-employee-name"></a>

#### Implementation <a name="implementation-fiding-employee-name"></a>

Given below is an example usage scenario and how the `/find :name KEYWORD` mechanism behaves at each step.

Step 1. The user launches the application for the first time.

Step 2. The user executes `/add NAME; PHONE; EMAIL; ADDRESS; YEAR_JOINED[; TAG]…` command to add a new employee.

Step 3: The user executes `/find :name KEYWORD` command to find the employee who contains the `KEYWORD`.

Step 5: Show the updated employee panel list containing the employee who matches the `KEYWORD`.

The following sequence diagram shows how find operation finds a specific employee:

![FindEmployeeNameSequenceDiagram](images/FindEmployeeNameSequenceDiagram.png)

The following activity diagram what happens when a user executes a `/find :name KEYWORD`.

![FindEmployeeNameActivityDiagram](images/FindEmployeeNameActivityDiagram.png)

--------------------------------------------------------------------------------------------------------------------

## **Documentation, logging, testing, configuration, dev-ops** <a name="documentation"></a>
Expand Down
17 changes: 17 additions & 0 deletions docs/diagrams/FindEmployeeNameActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12

start
repeat
:User enters the /find command and the
:name with a keyword to find the employee.;
:PayBack reads user input;
repeat while () is (Incorrect [Command Format])
->[else];
:PayBack creates a NameContainsKeywordsPredicate object;
:PayBack updates filtered list of employees based on the predicate;
:PayBack displays updated list of employees;
stop
@enduml
69 changes: 69 additions & 0 deletions docs/diagrams/FindEmployeeNameSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain
box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":PayBackParser" as PayBackParser LOGIC_COLOR
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR
participant "f:FindCommand" as FindCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("/find :name Patrick")
activate LogicManager

LogicManager -> PayBackParser : parseCommand("/find :name Patrick")
activate PayBackParser

create FindCommandParser
PayBackParser -> FindCommandParser
activate FindCommandParser

FindCommandParser --> PayBackParser
deactivate FindCommandParser

PayBackParser -> FindCommandParser : parse(":name Patrick")
activate FindCommandParser

create FindCommand
FindCommandParser -> FindCommand
activate FindCommand

FindCommand --> FindCommandParser :
deactivate FindCommand

FindCommandParser --> PayBackParser : f
deactivate FindCommandParser

PayBackParser -[hidden]-> PayBackParser
destroy FindCommandParser

PayBackParser --> LogicManager : f
deactivate PayBackParser

LogicManager -> FindCommand : execute(m)
activate FindCommand

FindCommand -> Model : updateFilteredPersonList(predicate)
activate Model

Model --> FindCommand
deactivate Model

create CommandResult
FindCommand -> CommandResult
activate CommandResult

CommandResult --> FindCommand
deactivate CommandResult

FindCommand --> LogicManager : r
deactivate FindCommand

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/FindEmployeeNameActivityDiagram.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/FindEmployeeNameSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading