commit
49b01c0e5a
1 changed files with 31 additions and 8 deletions
|
@ -8,17 +8,35 @@ public class Booking {
|
||||||
private int day;
|
private int day;
|
||||||
private int month;
|
private int month;
|
||||||
private int year;
|
private int year;
|
||||||
private String serviceprovider; //username
|
private ServiceProvider serviceprovider; //username
|
||||||
private String homeowner; //username
|
private HomeOwner homeowner; //username
|
||||||
|
private Service service;
|
||||||
public enum Status {
|
public enum Status {
|
||||||
PENDING, CONFIRMED, CANCELLED
|
PENDING{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Pending";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
CONFIRMED{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Confirmed";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
CANCELLED{
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Cancelled";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private Status status;
|
private Status status;
|
||||||
|
|
||||||
int rating; //out of 5
|
int rating; //out of 5
|
||||||
|
|
||||||
public Booking(int starth, int startmin, int endh, int endmin, int day, int month, int year,
|
public Booking(int starth, int startmin, int endh, int endmin, int day, int month, int year,
|
||||||
String serviceprovider, String homeowner){
|
ServiceProvider serviceprovider, HomeOwner homeowner, Service service){
|
||||||
this.starth = starth;
|
this.starth = starth;
|
||||||
this.startmin = startmin;
|
this.startmin = startmin;
|
||||||
this.endh = endh;
|
this.endh = endh;
|
||||||
|
@ -28,6 +46,7 @@ public class Booking {
|
||||||
this.year = year;
|
this.year = year;
|
||||||
this.serviceprovider = serviceprovider;
|
this.serviceprovider = serviceprovider;
|
||||||
this.homeowner = homeowner;
|
this.homeowner = homeowner;
|
||||||
|
this.service = service;
|
||||||
this.status = Status.PENDING;
|
this.status = Status.PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,22 +107,26 @@ public class Booking {
|
||||||
this.year = year;
|
this.year = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getServiceprovider() {
|
public ServiceProvider getServiceprovider() {
|
||||||
return serviceprovider;
|
return serviceprovider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setServiceprovider(String serviceprovider) {
|
public void setServiceprovider(ServiceProvider serviceprovider) {
|
||||||
this.serviceprovider = serviceprovider;
|
this.serviceprovider = serviceprovider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHomeowner() {
|
public HomeOwner getHomeowner() {
|
||||||
return homeowner;
|
return homeowner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHomeowner(String homeowner) {
|
public void setHomeowner(HomeOwner homeowner) {
|
||||||
this.homeowner = homeowner;
|
this.homeowner = homeowner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Service getService(){ return service; }
|
||||||
|
|
||||||
|
public void setService(Service service) { this.service = service;}
|
||||||
|
|
||||||
public void setStatus(Status status){
|
public void setStatus(Status status){
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue