Skip to content

Commit

Permalink
Merge pull request #356 from B-enguin/355-update-customer-delivery-me…
Browse files Browse the repository at this point in the history
…ssage-display

Update message format for Customer and Delivery Display
  • Loading branch information
jianyangg authored Nov 2, 2023
2 parents 0443648 + 4b765db commit 27d8508
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public static String format(Customer customer) {
final StringBuilder builder = new StringBuilder();
builder.append(String.format("[%d]", customer.getCustomerId()))
.append(String.format(" %s", customer.getName()))
.append(String.format("\n Phone: %s", customer.getPhone().toString()))
.append(String.format("\n Email: %s", customer.getEmail().toString()))
.append(String.format("\n Address: %s", customer.getAddress().toString()));
.append(String.format("\n\nPhone: %s", customer.getPhone().toString()))
.append(String.format("\n\nEmail: %s", customer.getEmail().toString()))
.append(String.format("\n\nAddress: %s", customer.getAddress().toString()));
return builder.toString();
}

Expand All @@ -64,14 +64,14 @@ public static String format(Delivery delivery) {
final StringBuilder builder = new StringBuilder();
builder.append(String.format("[%d]", delivery.getDeliveryId()))
.append(String.format(" %s", delivery.getName()))
.append(String.format("\n %s", delivery.getStatus().toString()))
.append(String.format("\n Customer: %s", delivery.getCustomer().getName()))
.append(String.format("\n Customer Id: %d", delivery.getCustomer().getCustomerId()))
.append(String.format("\n Address: %s", delivery.getAddress().toString()))
.append(String.format("\n Ordered On: %s", delivery.getOrderDate().toString()))
.append(String.format("\n Expected Delivery Date: %s", delivery.getDeliveryDate().toString()))
.append(String.format("\n\nStatus: %s", delivery.getStatus().toString()))
.append(String.format("\n\nCustomer: %s", delivery.getCustomer().getName()))
.append(String.format("\n\nCustomer ID: %d", delivery.getCustomer().getCustomerId()))
.append(String.format("\n\nAddress: %s", delivery.getAddress().toString()))
.append(String.format("\n\nOrdered On: %s", delivery.getOrderDate().toString()))
.append(String.format("\n\nExpected Delivery Date: %s", delivery.getDeliveryDate().toString()))
.append(Optional.ofNullable(delivery.getNote())
.map(n -> String.format("\n Note: %s", n)).orElse(""));
.map(n -> String.format("\n\nNote: %s", n)).orElse(""));

return builder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CustomerAddCommand extends CustomerCommand {
+ PREFIX_EMAIL + " [email protected] "
+ PREFIX_ADDRESS + " 311, Clementi Ave 2, #02-25";

public static final String MESSAGE_SUCCESS = "New customer added: %1$s";
public static final String MESSAGE_SUCCESS = "New customer added:\n\n%1$s";
public static final String MESSAGE_DUPLICATE_CUSTOMER = "This customer already exists in HomeBoss";

private final Customer toAdd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CustomerDeleteCommand extends CustomerCommand {
+ "Parameters: CUSTOMER_ID (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

public static final String MESSAGE_DELETE_CUSTOMER_SUCCESS = "Deleted Customer: %1$s";
public static final String MESSAGE_DELETE_CUSTOMER_SUCCESS = "Deleted Customer:\n\n%1$s";

private final Index targetIndex;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CustomerEditCommand extends CustomerCommand {
+ PREFIX_PHONE + " 91234567 "
+ PREFIX_EMAIL + " [email protected]";

public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s";
public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person:\n\n%1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class DeliveryAddCommand extends DeliveryCommand {
+ PREFIX_CUSTOMER_ID + " 5 "
+ PREFIX_DATE + " 2023-12-03 ";

public static final String MESSAGE_SUCCESS = "New delivery added: %1$s";
public static final String MESSAGE_SUCCESS = "New delivery added:\n\n%1$s";
public static final String MESSAGE_DUPLICATE_DELIVERY = "This delivery already exists in HomeBoss";

private final DeliveryAddDescriptor deliveryAddDescriptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DeliveryCreateNoteCommand extends Command {
+ PREFIX_NOTE + " Note\n"
+ "Example: " + COMMAND_WORD + " 1 --note This is a note";

public static final String MESSAGE_NOTE_SUCCESS = "Added Note to Delivery: %1$s";
public static final String MESSAGE_NOTE_SUCCESS = "Added Note to Delivery:\n\n%1$s";

private final int targetId;
private final Note newNote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DeliveryDeleteCommand extends DeliveryCommand {
+ "Parameters: DELIVERY_ID (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

public static final String MESSAGE_DELETE_DELIVERY_SUCCESS = "Deleted Delivery: %1$s";
public static final String MESSAGE_DELETE_DELIVERY_SUCCESS = "Deleted Delivery:\n\n%1$s";

private final Index targetIndex;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class DeliveryEditCommand extends DeliveryCommand {
+ PREFIX_NAME + " 10 Chocolate Cakes "
+ PREFIX_DATE + " 2025-12-12";

public static final String MESSAGE_EDIT_DELIVERY_SUCCESS = "Edited Delivery: %1$s";
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!";
private final Index targetIndex;
private final DeliveryEditDescriptor deliveryEditDescriptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class DeliveryStatusCommand extends DeliveryCommand {
+ "STATUS (must be one of CREATED/SHIPPED/COMPLETED/CANCELLED)\n"
+ "Example: " + COMMAND_WORD + " 1 COMPLETED";

public static final String MESSAGE_EDIT_DELIVERY_SUCCESS = "Edited Delivery: %1$s";
public static final String MESSAGE_EDIT_DELIVERY_SUCCESS = "Edited Delivery:\n\n%1$s";

private final int targetId;
private final DeliveryStatus updatedStatus;
Expand Down

0 comments on commit 27d8508

Please sign in to comment.