forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update DG (JY) #505
Merged
Gabriel4357
merged 3 commits into
AY2324S1-CS2103T-T13-3:master
from
jianyangg:503-update-dg-implementation-jy
Nov 13, 2023
Merged
Update DG (JY) #505
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,8 +277,6 @@ This section describes some noteworthy details on how certain features are imple | |
- [Customer Edit Command](#customer-edit-command) | ||
- [Delivery Add Command](#delivery-add-command) | ||
|
||
<br> | ||
|
||
### Update Delivery Status Feature | ||
|
||
#### Overview | ||
|
@@ -324,6 +322,7 @@ The sequence of the `delivery status` command is as follows: | |
|
||
The following sequence diagram illustrates the `delivery status` command sequence: | ||
|
||
|
||
<puml src="diagrams/DeliveryStatusCommandSequenceDiagram.puml" width="900" /> | ||
|
||
<br> | ||
|
@@ -381,7 +380,7 @@ The following diagram illustrates the `delivery note` command sequence: | |
|
||
<br> | ||
|
||
### User Register Account Command | ||
### <br/>User Register Account Command | ||
|
||
**Overview:** | ||
The `register` command is used to register a new user account. | ||
|
@@ -391,42 +390,47 @@ The format for the `register` command can be found [here](UserGuide.md#register) | |
|
||
**Feature details:** | ||
|
||
1. The user specifies the `Username`, `Password`, `Confirm Password`, `Forget Password Question` | ||
and `Forget Password Answer` in the `register` command. | ||
2. If any of the fields is not provided, an error message with the correct command usage will be shown. | ||
3. If invalid command parameters are provided, an error message with the correct parameter format will be shown. | ||
4. If the `Password` and `Confirm Password` fields do not match, an error message will be shown. | ||
5. If the user is currently logged in, an error message will be shown. | ||
6. The `User` is then cross-referenced with the stored user in `Model` to check if there's already a user stored. If | ||
1. The user specifies the `USERNAME`{.swift}, `PASSWORD`{.swift}, `CONFIRM_PASSWORD`{.swift}, `SECRET_QUESTION`{.swift} | ||
and `ANSWER`{.swift} in the `register`{.swift} command. | ||
1. If any of the fields is not provided, an error message with the correct command format will be shown. | ||
1. If command parameters provided are not within the acceptable value range, an error message with the correct command format will be shown. | ||
1. If the `PASSWORD`{.swift} and `CONFIRM_PASSWORD`{.swift} fields do not match, an error message will be shown to | ||
inform the user that the passwords do not match. | ||
1. If the user is currently logged in, an error message will be shown. | ||
1. The `User` is then cross-referenced with the stored user in `Model` to check if there's already a user stored. If | ||
there's already a user stored, an error message will be shown. | ||
7. If all the previous steps are completed without exceptions, the user will be registered and the `User` will be stored | ||
1. If all the previous steps are completed without exceptions, the user will be registered and the `User` will be stored | ||
in `Model`. The `isLoggedIn` status in `Model` will be updated to `true`. | ||
1. The user's username, password, secret question and answer will then be stored in the `authentication.json` file. The password is hashed using SHA-256. | ||
|
||
The following activity diagram shows the logic of a user registering an account: | ||
|
||
<puml src="diagrams/UserRegisterActivityDiagram.puml" alt="UserRegisterActivityDiagram" /> | ||
|
||
The sequence of the `register` command is as follows: | ||
|
||
1. The command `register INPUT` is entered by the user (e.g., register --user gab --password pass1234 --confirmPass | ||
pass1234 --secretQn First Pet? --answer Koko). | ||
2. Logic Manager calls the `AddressBookParser#parseCommand` with the `INPUT`. | ||
3. The `AddressBookParser` parses the command word, creating an instance of `UserRegisterCommandParser` to parse the | ||
1. The `register` command is entered by the user (i.e., `register --user gab --password pass1234 --confirmPass | ||
pass1234 --secretQn First Pet? --answer Koko`). | ||
1. Logic Manager calls the `AddressBookParser#parseCommand` with the full user input. | ||
1. The `AddressBookParser` parses the command word, creating an instance of `UserRegisterCommandParser` to parse the | ||
rest of the command. | ||
4. If all fields are present, it checks if password and confirm password match. | ||
5. If password and confirm password match, it creates an instance of `UserRegisterCommand`. | ||
6. `Logic Manager` executes `UserRegisterCommand` by calling `UserRegisterCommand#execute()`. | ||
7. `UserRegisterCommand` checks if a user is already registered by calling `Model#getStoredUser`. | ||
8. If no user is registered, `UserRegisterCommand` calls `Model#registerUser` to store the user. Login status is set to | ||
1. If not all fields are present, a `ParseException` is thrown saying incorrect command format. | ||
1. If all fields are present, it checks if `PASSWORD`{.swift} and `CONFIRM_PASSWORD`{.swift} match. | ||
Comment on lines
+417
to
+418
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would a check for password format be missing here? |
||
1. If `PASSWORD`{.swift} and `CONFIRM_PASSWORD`{.swift} match, it creates an instance of `UserRegisterCommand`. | ||
1. `Logic Manager` executes `UserRegisterCommand` by calling `UserRegisterCommand#execute()`. | ||
1. `UserRegisterCommand` checks if a user is already registered by calling `Model#getStoredUser`. | ||
1. If no user is registered, `UserRegisterCommand` calls `Model#registerUser` to store the user. Login status is set to | ||
true. | ||
9. `UserRegisterCommand` calls `Model#updateFilteredPersonList` to display the list of customers. | ||
10. `UserRegisterCommand` returns a `CommandResult` with a success message. | ||
1. `UserRegisterCommand` calls `Model#showAllFilteredCustomerList` to display the list of customers. | ||
1. `UserRegisterCommand` returns a `CommandResult` with a success message. | ||
|
||
The following sequence diagram shows how the `register` command works: | ||
|
||
<puml src="diagrams/UserRegisterSequenceDiagram.puml" alt="UserRegisterSequenceDiagram" /> | ||
|
||
<br> | ||
|
||
<br/> | ||
|
||
|
||
### List Delivery Feature | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would value range sound abit wrong, since its not really a range?