Skip to content

Commit

Permalink
Merge branch 'master' into 503-update-dg-implementation-jy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel4357 authored Nov 13, 2023
2 parents 7c43f9b + 5774324 commit 6b557de
Show file tree
Hide file tree
Showing 17 changed files with 553 additions and 492 deletions.
612 changes: 291 additions & 321 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/diagrams/CustomerAddSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ activate Model
Model --> CustomerAddCommand : isLoggedIn
deactivate Model

CustomerAddCommand -> Model : hasPerson(c)
CustomerAddCommand -> Model : hasCustomer(c)
activate Model

Model --> CustomerAddCommand
deactivate Model

CustomerAddCommand -> Model : addPerson(c)
CustomerAddCommand -> Model : addCustomer(c)
activate Model

Model --> CustomerAddCommand
Expand Down
56 changes: 28 additions & 28 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@ skinparam ArrowFontStyle plain
box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant ":CustomerDeleteCommandParser" as CustomerDeleteCommandParser LOGIC_COLOR
participant "d:CustomerDeleteCommand" as CustomerDeleteCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("delete 1")
[-> LogicManager : execute("customer delete 1")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
LogicManager -> AddressBookParser : parseCommand("customer delete 1")
activate AddressBookParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
activate DeleteCommandParser
create CustomerDeleteCommandParser
AddressBookParser -> CustomerDeleteCommandParser
activate CustomerDeleteCommandParser

DeleteCommandParser --> AddressBookParser
deactivate DeleteCommandParser
CustomerDeleteCommandParser --> AddressBookParser
deactivate CustomerDeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
activate DeleteCommandParser
AddressBookParser -> CustomerDeleteCommandParser : parse("1")
activate CustomerDeleteCommandParser

create DeleteCommand
DeleteCommandParser -> DeleteCommand
activate DeleteCommand
create CustomerDeleteCommand
CustomerDeleteCommandParser -> CustomerDeleteCommand
activate CustomerDeleteCommand

DeleteCommand --> DeleteCommandParser : d
deactivate DeleteCommand
CustomerDeleteCommand --> CustomerDeleteCommandParser : d
deactivate CustomerDeleteCommand

DeleteCommandParser --> AddressBookParser : d
deactivate DeleteCommandParser
CustomerDeleteCommandParser --> AddressBookParser : d
deactivate CustomerDeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
destroy DeleteCommandParser
CustomerDeleteCommandParser -[hidden]-> AddressBookParser
destroy CustomerDeleteCommandParser

AddressBookParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> DeleteCommand : execute()
activate DeleteCommand
LogicManager -> CustomerDeleteCommand : execute()
activate CustomerDeleteCommand

DeleteCommand -> Model : deletePerson(1)
CustomerDeleteCommand -> Model : deleteCustomer(1)
activate Model

Model --> DeleteCommand
Model --> CustomerDeleteCommand
deactivate Model

create CommandResult
DeleteCommand -> CommandResult
CustomerDeleteCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteCommand
CommandResult --> CustomerDeleteCommand
deactivate CommandResult

DeleteCommand --> LogicManager : result
deactivate DeleteCommand
CustomerDeleteCommand --> LogicManager : result
deactivate CustomerDeleteCommand

[<--LogicManager
deactivate LogicManager
Expand Down
7 changes: 3 additions & 4 deletions docs/diagrams/UserLoginActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ start
if () then ([else])
:ParseException: Invalid Command Format;
stop
([all fields are filled]) elseif () then ([user is already logged in])
( [all fields are filled]) elseif () then ([user is already logged in])
:CommandException: Already Logged In;
stop
([else]) elseif () then ([else])
( [else]) elseif () then ([else])
:CommandException: Wrong Credentials;
stop
else ([fields matches
else ( [fields matches
stored user])

endif
:User login command is executed successfully.
User is now logged in.;
:Show full Customer List;

stop
@enduml
10 changes: 8 additions & 2 deletions docs/diagrams/UserLoginSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AddressBookParser -> UserLoginCommandParser : parse(arg)
activate UserLoginCommandParser

create User
UserLoginCommandParser -> User : new User(username, password)
UserLoginCommandParser -> User : new User(username, password, true)
activate User

User --> UserLoginCommandParser
Expand All @@ -56,6 +56,12 @@ deactivate AddressBookParser
LogicManager -> UserLoginCommand : execute(model)
activate UserLoginCommand

UserLoginCommand -> Model : getStoredUser()
activate Model

Model --> UserLoginCommand : storedUser
deactivate Model

UserLoginCommand -> Model : getUserLoginStatus()
activate Model

Expand All @@ -74,7 +80,7 @@ activate Model
Model --> UserLoginCommand
deactivate Model

UserLoginCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_ALL_CUSTOMERS)
UserLoginCommand -> Model : showAllFilteredCustomerList()
activate Model

Model --> UserLoginCommand
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UserLogoutActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ if () then ([user is already logged out])
else ([else])
:User logout command is executed successfully.
User is now logged out.;
:Hide Customer and Delivery List;
endif

stop
Expand Down
4 changes: 2 additions & 2 deletions docs/diagrams/UserLogoutSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ activate Model
Model --> UserLogoutCommand
deactivate Model

UserLogoutCommand -> Model : updateFilteredPersonList(PREDICATE_SHOW_NO_CUSTOMERS)
UserLogoutCommand -> Model : clearFilteredDeliveryList()
activate Model

Model --> UserLogoutCommand
deactivate Model

UserLogoutCommand -> Model : updateFilteredDeliveryList(PREDICATE_SHOW_NO_DELIVERIES)
UserLogoutCommand -> Model : clearFilteredCustomerList()
activate Model

Model --> UserLogoutCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class CustomerDeleteCommand extends CustomerCommand {
* The message usage of the delete customer command.
*/
public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the customer identified by the customer ID used in the displayed customer list.\n\n"
+ "Parameters: CUSTOMER_ID (must be a positive integer)\n\n"
+ "Example: " + COMMAND_WORD + " 1";
+ ": Deletes the customer identified by the customer ID used in the displayed customer list.\n\n"
+ "Parameters: CUSTOMER_ID (must be a positive integer and less than 2147483648)\n\n"
+ "Example: " + COMMAND_WORD + " 1";

/**
* The pre-text to the message displayed when the customer is deleted successfully.
Expand Down Expand Up @@ -69,7 +69,7 @@ public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);

logger.info("Executing CustomerDeleteCommand:"
+ " customerID: " + customerID.getOneBased() + "\n");
+ " customerID: " + customerID.getOneBased() + "\n");

// User cannot perform this operation before logging in
if (!model.getUserLoginStatus()) {
Expand All @@ -90,7 +90,7 @@ public CommandResult execute(Model model) throws CommandException {

model.deleteCustomer(customerToDelete.get());
return new CommandResult(String.format(MESSAGE_DELETE_CUSTOMER_SUCCESS,
Messages.format(customerToDelete.get())), true);
Messages.format(customerToDelete.get())), true);
}

/**
Expand Down Expand Up @@ -122,7 +122,7 @@ public boolean equals(Object other) {
@Override
public String toString() {
return new ToStringBuilder(this)
.add("customerID", customerID)
.toString();
.add("customerID", customerID)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ public class CustomerEditCommand extends CustomerCommand {
public static final String COMMAND_WORD = CustomerCommand.COMMAND_WORD + " " + "edit";

/**
* The text displayed to show what the command does and how to use it.
* The text displayed to show what the command does and how to use it.
*/
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the person identified "
+ "by the customer ID used in the displayed person list. "
+ "Existing values will be overwritten by the input values.\n\n"
+ "Parameters: CUSTOMER_ID (must be a positive integer) "
+ "[" + PREFIX_NAME + " NAME] "
+ "[" + PREFIX_PHONE + " PHONE] "
+ "[" + PREFIX_EMAIL + " EMAIL] "
+ "[" + PREFIX_ADDRESS + " ADDRESS]\n\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_PHONE + " 91234567 "
+ PREFIX_EMAIL + " [email protected]";
+ "by the customer ID used in the displayed person list. "
+ "Existing values will be overwritten by the input values.\n\n"
+ "Parameters: CUSTOMER_ID (must be a positive integer and less than 2147483648) "
+ "[" + PREFIX_NAME + " NAME] "
+ "[" + PREFIX_PHONE + " PHONE] "
+ "[" + PREFIX_EMAIL + " EMAIL] "
+ "[" + PREFIX_ADDRESS + " ADDRESS]\n\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_PHONE + " 91234567 "
+ PREFIX_EMAIL + " [email protected]";

/**
* The text to the message displayed when the Customer is edited successfuly.
Expand All @@ -73,6 +73,7 @@ public class CustomerEditCommand extends CustomerCommand {

/**
* Creates a CustomerEditCommand to edit the customers.
*
* @param targetIndex of the person in the filtered person list to edit
* @param customerEditDescriptor details to edit the person with
*/
Expand All @@ -86,6 +87,7 @@ public CustomerEditCommand(Index targetIndex, CustomerEditDescriptor customerEdi

/**
* Executes the CustomerEditCommand.
*
* @param model {@code Model} which the command should operate on.
* @return The command result along with the message to be displayed to the user.
* @throws CommandException If the user is not logged in or if the customer does not exist or if the edited
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class DeliveryDeleteCommand extends DeliveryCommand {
public static final String COMMAND_WORD = DeliveryCommand.COMMAND_WORD + " " + "delete";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the delivery identified by the delivery ID used in the displayed delivery list.\n\n"
+ "Parameters: DELIVERY_ID (must be a positive integer)\n\n"
+ "Example: " + COMMAND_WORD + " 1";
+ ": Deletes the delivery identified by the delivery ID used in the displayed delivery list.\n\n"
+ "Parameters: DELIVERY_ID (must be a positive integer and less than 2147483648)\n\n"
+ "Example: " + COMMAND_WORD + " 1";

/**
* The text to the message displayed when the Delivery is delete successfuly.
Expand All @@ -44,6 +44,7 @@ public class DeliveryDeleteCommand extends DeliveryCommand {

/**
* Creates a DeliveryDeleteCommand to delete the specified {@code Delivery}
*
* @param targetIndex
*/
public DeliveryDeleteCommand(Index targetIndex) {
Expand All @@ -52,6 +53,7 @@ public DeliveryDeleteCommand(Index targetIndex) {

/**
* Executes the DeliveryDeleteCommand.
*
* @param model {@code Model} which the command should operate on.
* @return The command result along with the message to be displayed to the user.
* @throws CommandException If the delivery to be deleted does not exist or the user is not logged in.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ public class DeliveryEditCommand extends DeliveryCommand {
* The text displayed to show what the command does and how to use it.
*/
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the delivery identified "
+ "by the DELIVERY_ID used in the displayed delivery list. "
+ "Existing values will be overwritten by the input values.\n\n"
+ "Parameters: DELIVERY_ID (must be a positive integer)\n\n"
+ "At least one field must be specified."
+ "[" + PREFIX_NAME + " DELIVERY_NAME] "
+ "[" + PREFIX_CUSTOMER_ID + " CUSTOMER_ID] "
+ "[" + PREFIX_DATE + " DELIVERY_DATE] "
+ "[" + PREFIX_STATUS + " STATUS] "
+ "[" + PREFIX_NOTE + " NOTE]...\n\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_NAME + " 10 Chocolate Cakes "
+ PREFIX_DATE + " 2025-12-12";
+ "by the DELIVERY_ID used in the displayed delivery list. "
+ "Existing values will be overwritten by the input values.\n\n"
+ "Parameters: DELIVERY_ID (must be a positive integer and less than 2147483648)\n\n"
+ "At least one field must be specified."
+ "[" + PREFIX_NAME + " DELIVERY_NAME] "
+ "[" + PREFIX_CUSTOMER_ID + " CUSTOMER_ID] "
+ "[" + PREFIX_DATE + " DELIVERY_DATE] "
+ "[" + PREFIX_STATUS + " STATUS] "
+ "[" + PREFIX_NOTE + " NOTE]...\n\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_NAME + " 10 Chocolate Cakes "
+ PREFIX_DATE + " 2025-12-12";

/**
* The text to the message displayed when the Delivery is edited successfuly.
* The text to the message displayed when the Delivery is edited successfuly.
*/
public static final String MESSAGE_EDIT_DELIVERY_SUCCESS = "Edited Delivery:\n\n%1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field must be provided!";
Expand All @@ -70,6 +70,7 @@ public class DeliveryEditCommand extends DeliveryCommand {

/**
* Creates a DeliveryEditCommand to edit the specified {@code Delivery}
*
* @param targetIndex of the delivery in the delivery list to edit
* @param deliveryEditDescriptor details to edit the delivery with
*/
Expand Down Expand Up @@ -115,7 +116,7 @@ public CommandResult execute(Model model) throws CommandException {
model.showAllFilteredDeliveryList();

return new CommandResult(String.format(MESSAGE_EDIT_DELIVERY_SUCCESS,
Messages.format(editedDelivery)), true);
Messages.format(editedDelivery)), true);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DeliveryViewCommand extends DeliveryCommand {
public static final String COMMAND_WORD = DeliveryCommand.COMMAND_WORD + " view";
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Displays a single delivery order.\n\n"
+ "Parameters: "
+ "DELIVERY_ID (Must be a positive integer)\n\n"
+ "DELIVERY_ID (Must be a positive integer and less than 2147483648)\n\n"
+ "Example: " + COMMAND_WORD + " "
+ "1";

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class ParserUtil {

public static final String MESSAGE_INVALID_INDEX = "ID must be an integer more than 0.";
public static final String MESSAGE_INVALID_INDEX = "ID must be an integer more than 0 and less than 2147483648.";


/**
Expand Down
Loading

0 comments on commit 6b557de

Please sign in to comment.