-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicket.java
More file actions
183 lines (165 loc) · 5.57 KB
/
Ticket.java
File metadata and controls
183 lines (165 loc) · 5.57 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
public class Ticket {
private int ticketID;
private Showtime showtime;
private int showtimeID;
private RegisteredUser RU;
private int seatID;
private int paymentID;
private int RUID;
private Seat seat;
private double ticketPrice;
private Payment payment;
private String email;
private String paymentMethod;
private boolean ticketStatus;
private boolean refunded;
private String datePurchased;
private String timePurchased;
private boolean isAnRUSeat; //boolean to check if the ticket saves a seat that was reserved for an RU
@Override
public String toString() {
// Return a string in the format: "TicketID: [ticketID], Date Purchased: [datePurchased], Time Purchased: [timePurchased]"
return "TicketID: " + ticketID + ", Date Purchased: " + datePurchased + ", Time Purchased: " + timePurchased;
}
public Ticket(int ticketID, Showtime showtime, RegisteredUser RU, Seat seat, double ticketPrice, String paymentMethod, boolean isAnRUSeat ){
this.ticketID = ticketID;
this.showtime = showtime;
this.RU = RU;
this.seat = seat;
this.ticketPrice = ticketPrice;
this.paymentMethod = paymentMethod;
this.isAnRUSeat = isAnRUSeat;
this.ticketStatus = true; // ticketStatus is TRUE when it is still a valid ticket
}
public Ticket(int ticketID, Showtime showtime, Seat seat, RegisteredUser RU,String email, double ticketPrice, Payment payment, boolean isAnRUSeat, boolean refunded){
this.ticketID = ticketID;
this.showtime = showtime;
this.RU = RU;
this.email = email;
this.seat = seat;
this.ticketPrice = ticketPrice;
this.payment = payment;
this.isAnRUSeat = isAnRUSeat;
this.refunded = refunded;
this.ticketStatus = true; // ticketStatus is TRUE when it is still a valid ticket
}
public Ticket(int ticketID, int showtimeID, int seatID, int RUID, String email, double ticketPrice, int paymentID, String datePurchased, String timePurchased, boolean refunded){
this.ticketID = ticketID;
this.showtimeID = showtimeID;
this.RUID = RUID;
this.email = email;
this.seatID = seatID;
this.ticketPrice = ticketPrice;
this.paymentID = paymentID;
this.datePurchased = datePurchased;
this.timePurchased = timePurchased;
//this.isAnRUSeat = isAnRUSeat;
this.refunded = refunded;
this.ticketStatus = true; // ticketStatus is TRUE when it is still a valid ticket
}
public Ticket(Showtime showtime, Seat seat, RegisteredUser RU, String email, double ticketPrice, Payment payment, String datePurchased, String timePurchased, boolean isAnRUSeat, boolean refunded){
this.showtime = showtime;
this.RU = RU;
this.email = email;
this.seat = seat;
this.ticketPrice = ticketPrice;
this.payment = payment;
this.isAnRUSeat = isAnRUSeat;
this.datePurchased = datePurchased;
this.timePurchased = timePurchased;
this.refunded = refunded;
this.ticketStatus = true; // ticketStatus is TRUE when it is still a valid ticket
}
//setters
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public void setSeat(Seat seat) {
this.seat = seat;
}
public void setShowtime(Showtime showtime) {
this.showtime = showtime;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void setPayment(Payment payment) {
this.payment = payment;
}
public Payment getPayment() {
return payment;
}
public void setShowtimeID(int id) {
this.showtimeID = id;
}
public int getShowtimeID() {
return showtimeID;
}
public void setSeatID(int id) {
this.seatID = id;
}
public int getSeatID() {
return seatID;
}
public void setRefunded(boolean ref) {
this.refunded = ref;
}
public boolean getRefunded() {
return refunded;
}
public void setTicketID(int ticketID) {
this.ticketID = ticketID;
}
public void setPaymentID(int id){
this.paymentID = id;
}
public int getPaymentID(){
return this.paymentID;
}
public void setTicketPrice(double ticketPrice) {
this.ticketPrice = ticketPrice;
}
public void setTicketStatus(boolean ticketStatus) {
this.ticketStatus = ticketStatus;
}
public void setRU(RegisteredUser RU) {
this.RU = RU;
}
// getters
public String getPaymentMethod() {
return paymentMethod;
}
public String getDatePurchased() {
return datePurchased;
}
public void setDatePurchased(String datePurchased) {
this.datePurchased = datePurchased;
}
// Getters and Setters for timePurchased
public String getTimePurchased() {
return timePurchased;
}
public void setTimePurchased(String timePurchased) {
this.timePurchased = timePurchased;
}
public Seat getSeat() {
return seat;
}public Showtime getShowtime() {
return showtime;
}public int getTicketID() {
return ticketID;
}public double getTicketPrice() {
return ticketPrice;
}
public RegisteredUser getRU() {
return RU;
}public boolean getTicketStatus() {
return ticketStatus;
}public boolean getIsAnRUSeat(){
return isAnRUSeat;
}
// more functions
}