Skip to content

Commit

Permalink
Merge pull request AY2425S1-CS2103T-W10-2#186 from Vangmay/update-dev…
Browse files Browse the repository at this point in the history
…eloper-guide

Developer Guide - Add general entity commands
  • Loading branch information
zaidansani authored Nov 5, 2024
2 parents 3827012 + 29578bd commit d0131c7
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 66 deletions.
88 changes: 26 additions & 62 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,99 +222,63 @@ The activity diagram shows the general sequence of steps when a user interacts w

## **Implementation of main features**

### Add person feature
## **Implementation of Entity Commands**
Entity commands include `add`, `delete`, `find`, `clear` commands.
So `xyzCommand` can be `addPersonCommand`, `addCommandParser` and so on.

#### Implementation

#### Design considerations

<br>

### Edit person feature

#### Implementation

#### Design considerations

<br>

### Delete person feature

#### Implementation

#### Design considerations

<br>

### Find person feature

#### Implementation

#### Design considerations

<br>

### List person feature
**Step 1**. The user types an `xyz` command in the `CommandBox`, followed by the type of entity `person` or `appt`. This is followed by appropriate arguments and prefixes.

#### Implementation

#### Design considerations

<br>
**Step 2**. The command is passed to the `LogicManager`. `LogicManager` then calls the `AddressBookParser::parseCommand` method to parse the command.

### Clear person feature

#### Implementation

#### Design considerations
**Step 3**. The `AddressBookParser` creates a `xyzEntityCommand` object, and call the `xyzCommandParser::parse` method, which is returned to the `LogicManager`. This may be different based on the entity type as commands like `addPersonCommand` and `addApptCommand` have a different set of arguments the user can provide.

<br>

### Add appointment feature
**Step 4**. The `LogicManager` calls the `xyzCommand : execute` method which creates a `CommandResult` Object.

#### Implementation

#### Design considerations
**Step 5**. The `CommandResult` object is returned to the `LogicManager`.

<br>
<puml src="diagrams/EntityCommandSequenceDiagram.puml" alt="EntityCommandSequenceDiagram"></puml>
- The entity referred in `FindEntityCommand` etc, refers to `FindPersonCommand` and `FindAppointmentCommand` because we have two entities called person and appointment on which operations can be performed.

### Edit appointment feature
#### Find Appointment Command
**Aspect: How to show find appointment.**

#### Implementation
- **Alternative 1 (Current choice)**: Find the information based on what the user has provided (name, date).
- Pros: Fast and easy to find by date and name
- Cons: Confusing syntax from user's perspective

#### Design considerations
- **Alternative 2**: Create different find commands, find by date, find by name etc.
- Pros: Much easy in terms of user experience
- Cons: Harder to implement as more code needs to be written.

<br>

### Delete appointment feature
### List appointment feature

#### Implementation

#### Design considerations

<br>
**Aspect**: How to show list

### Find appointment feature
- **Alternative 1 (Current choice)**: Print them out individually on the listpanel
- Pros: Easy to scroll through
- Cons: Might look cluttered to some users

#### Implementation

#### Design considerations

<br>

### List appointment feature
### Clear appointment feature

#### Implementation

#### Design considerations

<br>

### Clear appointment feature
**Aspect**: How to show list

#### Implementation

#### Design considerations
- **Alternative 1 (Current choice)**: Replace the appointment book with a new appointment book.

<br>

Expand Down
8 changes: 4 additions & 4 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ _If you type fast, this application can serve as an excellent substitute for you

5. A GUI similar to the one below should appear in a few seconds. Note how the DocTrack application contains some sample data.
<br>
![Ui](images/Ui.png)
![Ui](images/Updated_UI.png)

<br>

Expand Down Expand Up @@ -255,7 +255,7 @@ Deletes the specified person from the address book.

##### Clearing all persons : `clear person`

Clears all entries from the address book after a validation check from the user.
Deletes all entries from the address book.

**Format**: `clear person`

Expand Down Expand Up @@ -356,7 +356,7 @@ Deletes the specified appointment from DocTrack.

##### Clearing all appointments : `clear appt`

Clears all entries from the appointment book after a validation check from the user.
Deletes all entries from the appointment book.

**Format**: `clear appt`

Expand Down Expand Up @@ -398,7 +398,7 @@ Exits the program.

##### Saving the data

AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
AddressBook and AppointmentBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.

<br>

Expand Down
60 changes: 60 additions & 0 deletions docs/diagrams/EntityCommandSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":xyzCommandParser" as CommandParser LOGIC_COLOR
participant "e:XYZCommand" as XYZCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

[-> LogicManager : execute("xyz")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("xyz")

create CommandParser
activate AddressBookParser
AddressBookParser -> CommandParser
activate CommandParser
AddressBookParser <-- CommandParser
deactivate CommandParser



AddressBookParser -> CommandParser : parse("xyz")
activate CommandParser


create XYZCommand
CommandParser -> XYZCommand
activate XYZCommand

note right of XYZCommand: XYZCommand = \nFindEntityCommand, \nAddEntityCommand, \nDeleteEntityCommand, \nEditEntityCommand, \nClearEntityCommand, \nListEntityCommand

XYZCommand --> CommandParser
CommandParser --> AddressBookParser
deactivate CommandParser
deactivate XYZCommand

AddressBookParser --> LogicManager : e
deactivate AddressBookParser

LogicManager -> XYZCommand : execute(e)
activate XYZCommand

create CommandResult
XYZCommand -> CommandResult
activate CommandResult

CommandResult --> XYZCommand
deactivate CommandResult

XYZCommand --> LogicManager : r
deactivate XYZCommand

[<--LogicManager : Model
deactivate LogicManager
@enduml
Binary file added docs/images/Updated_UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/team/vangmay.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,17 @@
**DocTrack** helps general practitioners (GPs) at small clinics quickly access patient contact details, appointments, and treatment records. It is optimized for users who prefer a command-line interface (CLI), enabling faster completion of frequent tasks through typed commands.

---
Role:
- Developer
- QA Tester
- Responsible for overseeing Logic

Given below are my contributions to the project:
- Refactor Find Persons Command
- Create add appointment command
- Create AppointmentDescriptor in the AppointmentModel
- Created tests for Appointment book
- Wrote test cases to increase code coverage
- Implement changes in UI to add 2 windows
- Update user guide
- Update Developer guide (Find, List, Clear appt)

0 comments on commit d0131c7

Please sign in to comment.