forked from nus-cs2103-AY2223S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2103-AY2223S2#67 from SHni99/v1.3
V1.3 [Update DG]
- Loading branch information
Showing
7 changed files
with
172 additions
and
2 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@startuml | ||
start | ||
:User executes add command; | ||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([prefix is valid and necessary inputs are filled]) | ||
:New person is being added to the contact list; | ||
if () then ([contact does not have person]) | ||
: Add new Person to model; | ||
: Store person details in address book; | ||
: Display success message; | ||
else ([else]) | ||
: Display error message; | ||
endif | ||
else ([else]) | ||
: Display error message; | ||
endif | ||
stop | ||
@enduml |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR | ||
participant "command:AddCommand" as AddCommand LOGIC_COLOR | ||
end box | ||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
box Addressbook ADDRESSBOOK_COLOR_T1 | ||
participant ":Addressbook" as Addressbook ADDRESSBOOK_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute(add) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(add) | ||
activate AddressBookParser | ||
|
||
create AddCommandParser | ||
AddressBookParser -> AddCommandParser | ||
activate AddCommandParser | ||
|
||
AddCommandParser --> AddressBookParser | ||
deactivate AddCommandParser | ||
|
||
AddressBookParser -> AddCommandParser : parse(args) | ||
activate AddCommandParser | ||
|
||
create AddCommand | ||
AddCommandParser -> AddCommand | ||
activate AddCommand | ||
|
||
AddCommand --> AddCommandParser | ||
deactivate AddCommand | ||
|
||
AddCommandParser --> AddressBookParser : command | ||
deactivate AddCommandParser | ||
|
||
AddressBookParser -[hidden]-> AddressBookParser : command | ||
destroy AddCommandParser | ||
|
||
AddressBookParser --> LogicManager : command | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddCommand : execute(model) | ||
activate AddCommand | ||
|
||
AddCommand -> Model : hasPerson(toAdd) | ||
activate Model | ||
|
||
Model -> Addressbook : hasPerson(toAdd) | ||
activate Addressbook | ||
|
||
Addressbook --> Model : result | ||
deactivate Addressbook | ||
|
||
Model --> AddCommand : result | ||
deactivate Model | ||
|
||
AddCommand -> Model : addPerson(toAdd) | ||
activate Model | ||
|
||
Model -> Addressbook : addPerson(toAdd) | ||
activate Addressbook | ||
|
||
Addressbook --> Model : result | ||
deactivate Addressbook | ||
|
||
Model --> AddCommand : result | ||
deactivate Model | ||
|
||
AddCommand --> LogicManager :commandResult | ||
deactivate AddCommand | ||
|
||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager : commandResult | ||
deactivate LogicManager | ||
|
||
@enduml |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -22,14 +22,14 @@ public class AddCommand extends Command { | |
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. " | ||
+ "Parameters: " | ||
+ PREFIX_NAME + "NAME " | ||
+ PREFIX_STATUS + "STATUS" | ||
+ PREFIX_STATUS + "STATUS " | ||
+ PREFIX_PHONE + "PHONE " | ||
+ PREFIX_EMAIL + "EMAIL " | ||
+ PREFIX_ADDRESS + "ADDRESS " | ||
+ "[" + PREFIX_TAG + "TAG]...\n" | ||
+ "Example: " + COMMAND_WORD + " " | ||
+ PREFIX_NAME + "John Doe " | ||
+ PREFIX_STATUS + "Y2 computer science" | ||
+ PREFIX_STATUS + "Y2 computer science " | ||
+ PREFIX_PHONE + "98765432 " | ||
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " | ||
|