-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOrder.java
More file actions
58 lines (47 loc) · 1.94 KB
/
Copy pathOrder.java
File metadata and controls
58 lines (47 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.time.LocalDate;
public class Order {
public int orderID;
public Customer customer;
public LocalDate deliveryDate;
public String orderType;
public String address;
public String method;
public double totalAmount;
public String status = "Pending";
public String paymentStatus = "pending";
public Order(int orderID, Customer customer, LocalDate deliveryDate,
String orderType, String address, String method, double totalAmount) {
this.orderID = orderID;
this.customer = customer;
this.deliveryDate = deliveryDate;
this.orderType = orderType;
this.address = address;
this.method = method;
this.totalAmount = totalAmount;
}
// Getters used by managers & DataStore
public int getOrderID() { return orderID; }
public LocalDate getDeliveryDate() { return deliveryDate; }
public String getOrderType() { return orderType; }
public String getStatus() { return status; }
public String getPaymentStatus() { return paymentStatus; }
// Setters used by managers
public void setStatus(String status) { this.status = status; }
public void setPaymentStatus(String st) { this.paymentStatus = st; }
public String briefString() {
return customer.getName() + " | Due: " + deliveryDate + " | " + orderType + " | $" + totalAmount;
}
@Override
public String toString() {
return "Order ID: " + orderID +
"\nCustomer: " + customer.getName() + " (" + customer.getCustomerID() + ")" +
"\nDelivery Date: " + deliveryDate +
"\nType: " + orderType +
"\nAddress: " + address +
"\nPayment Method: " + method +
"\nTotal Amount: $" + totalAmount +
"\nStatus: " + status +
"\nPayment Status: " + paymentStatus +
"\n---------------------------------------------";
}
}