From f69b8a2a1da5efd7b911418ea621cd4ab44404aa Mon Sep 17 00:00:00 2001 From: Mary Tran Date: Mon, 19 Nov 2018 21:33:39 -0500 Subject: [PATCH 1/2] Added a few things to Booking --- .../olympus/olympusservices/Booking.java | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java index c3d9de1..c809331 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java @@ -8,17 +8,35 @@ public class Booking { private int day; private int month; private int year; - private String serviceprovider; //username - private String homeowner; //username + private ServiceProvider serviceprovider; //username + private HomeOwner homeowner; //username + private Service service; 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; int rating; //out of 5 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.startmin = startmin; this.endh = endh; @@ -88,19 +106,21 @@ public class Booking { this.year = year; } - public String getServiceprovider() { + public ServiceProvider getServiceprovider() { return serviceprovider; } - public void setServiceprovider(String serviceprovider) { + public void setServiceprovider(ServiceProvider serviceprovider) { this.serviceprovider = serviceprovider; } - public String getHomeowner() { + public HomeOwner getHomeowner() { return homeowner; } - public void setHomeowner(String homeowner) { + public Service getService(){ return service; } + + public void setHomeowner(HomeOwner homeowner) { this.homeowner = homeowner; } From 944c1226b70664e1b72cf7f2813f03690075fbfe Mon Sep 17 00:00:00 2001 From: Mary Tran Date: Mon, 19 Nov 2018 21:37:27 -0500 Subject: [PATCH 2/2] Updated booking --- .../java/com/uottawa/olympus/olympusservices/Booking.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java index c809331..8800853 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/Booking.java @@ -46,6 +46,7 @@ public class Booking { this.year = year; this.serviceprovider = serviceprovider; this.homeowner = homeowner; + this.service = service; this.status = Status.PENDING; } @@ -118,12 +119,14 @@ public class Booking { return homeowner; } - public Service getService(){ return service; } - public void setHomeowner(HomeOwner homeowner) { this.homeowner = homeowner; } + public Service getService(){ return service; } + + public void setService(Service service) { this.service = service;} + public void setStatus(Status status){ this.status = status; }