- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOrder.java
More file actions
Latest commit
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
importjava.time.LocalDate;
publicclassOrder {
publicintorderID;
publicCustomercustomer;
publicLocalDatedeliveryDate;
publicStringorderType;
publicStringaddress;
publicStringmethod;
publicdoubletotalAmount;
publicStringstatus = "Pending";
publicStringpaymentStatus = "pending";
publicOrder(intorderID, Customercustomer, LocalDatedeliveryDate,
StringorderType, Stringaddress, Stringmethod, doubletotalAmount) {
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
publicintgetOrderID() { returnorderID; }
publicLocalDategetDeliveryDate() { returndeliveryDate; }
publicStringgetOrderType() { returnorderType; }
publicStringgetStatus() { returnstatus; }
publicStringgetPaymentStatus() { returnpaymentStatus; }
// Setters used by managers
publicvoidsetStatus(Stringstatus) { this.status = status; }
publicvoidsetPaymentStatus(Stringst) { this.paymentStatus = st; }
publicStringbriefString() {
returncustomer.getName() + " | Due: " + deliveryDate + " | " + orderType + " | $" + totalAmount;
}
@Override
publicStringtoString() {
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---------------------------------------------";
}
}