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 DeveloperGuide.md to include enhancements #134

Merged
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
45 changes: 45 additions & 0 deletions docs/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@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 "deleteParser:DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "icNumber:IcNumber" as icNumber LOGIC_COLOR
participant "delete:DeleteCommand" as DeleteCommand LOGIC_COLOR
end box

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

[-> LogicManager : execute("delete i/T0000000A")]
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete i/T0000000A")
activate AddressBookParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
activate DeleteCommandParser

create IcNumber
DeleteCommandParser -> IcNumber
activate IcNumber
IcNumber --> DeleteCommandParser:deleteCommand
deactivate IcNumber

create DeleteCommand
DeleteCommandParser -> DeleteCommand:deleteCommand
activate deleteCommand

DeleteCommand --> DeleteCommandParser:deleteCommand
deactivate DeleteCommand
DeleteCommandParser --> AddressBookParser:parsedDeleteCommand
deactivate DeleteCommandParser

AddressBookParser --> LogicManager:parsedDeleteCommand
deactivate AddressBookParser

@enduml
60 changes: 51 additions & 9 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,24 +620,66 @@ testers are expected to do more *exploratory* testing.

1. Deleting a patient while all patients are being shown

1. Prerequisites: List all patients using the `list` command. Multiple patients in the list.
1. Prerequisites: List all patients using the `list` command. Multiple patients in the list.
2. Test case: `delete i/T0000000A`<br>
Expected: Will iterate through the list to search for Patient with matching IC Number and delete that patient
Timestamp in the status bar is updated.
3. Test case: `delete I/T0000000B`<br>
Expected: If patient is not found or does not exist, no patient is deleted.
Error details shown in the status message. Status bar remains the same.
4. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)<br>
Expected: Similar to previous.

1. Test case: `delete 1`<br>
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message.
Timestamp in the status bar is updated.
### Editing a patient
1. Editing a patient's attributes that are specified based on the prefixes in the user inputs
1. Prerequisites: List all patients using the `list` command. Multiple patients in the list.
2. Test case: `edit i/T0000000A n/John Doe`<br>
Expected: Will iterate through the list to search for Patient with matching IC Number and edit that patient
Timestamp in the status bar is updated.
3. Test case: `edit i/T0000000A`
Expected: Will throw an exception if the fields to be edited are left empty.
Error details shown in the status message. Status bar remains the same.
4. Other incorrect edit commands to try: `edit`, `delete x`, `...`
Expected: Similar to previous.
1. _{ more test cases …​ }_

1. Test case: `delete 0`<br>
Expected: No patient is deleted. Error details shown in the status message. Status bar remains the same.
### Class `Birthday` and Testing
1. Patient requires to have a birthday as a compulsory characteristic to be considered
**Format:** A `Birthday` object can be initialized as follows:

1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)<br>
Expected: Similar to previous.
{

1. _{ more test cases …​ }_
Birthday birthday = new Birthday("01/01/1991")

}
### Explanation:

**string input** : User Input must be in the dd/MM/yyyy format to be parsed
correctly using LocalDateTime as implemented in the Birthday Class

**incorrect inputs** : Inputs are checked for null and validity based on regex before initializing the Birthday object
User Inputs which do not follow the correct format will receive an error message accordingly

**tests** : Array of tests to account for various inputs that can be given by the user
and checks on validity of the arguments given to prevent invocation errors

**LocalDateTime** : LocalDateTime used instead of String as Age is a non-constant attribute of the Patient
A patient's age constantly changes. Hence LocalDateTime offers flexibility to auto calculate a patient's age
based on Birthday without requiring manual interferance as a potential extension.

### Saving data

1. Dealing with missing/corrupted data files

1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_
2. Saving Assigned Department to Storage
### Explanation:
**Storage**: Storage classes are to save the details of the patients upon exiting the app. While the basic attributes of the patients like IC Number,
Gender and all were being saved, complicated attributes like Assigned Department were not.

**Assigned Department**: The patient will be assigned to a department when being admitted.

**Enhancement**: Made changes to the storage and RecordBuilder classes and the tests
to ensure the department assigned is saved as well.

1. _{ more test cases …​ }_
7 changes: 7 additions & 0 deletions docs/style.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@startuml
!define LOGIC_COLOR #3333C4
!define LOGIC_COLOR_T2 #5252CE
!define LOGIC_COLOR_T3 #1616B0
!define LOGIC_COLOR_T4 #101086
!define MODEL_COLOR_T1 #ff0000
@enduml
Loading