Booking deletion fixed some minor problems remain
[RRRRHHHH_Code] / ruralHouses / src / domain / Booking.java
index 20d110e..60cfd2f 100644 (file)
@@ -1,39 +1,41 @@
 package domain;
 
-import java.io.*;
+import java.io.Serializable;
 import java.util.Date;
 
-import businessLogic.BookingManager;
-
-@SuppressWarnings("serial")
 public class Booking implements Serializable {
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private int bookingNumber;
-       private boolean isPaid;
        private Date bookingDate;
-       private String telephone;
+       private Client client;
        private Offer offer;
-       
-       
-       public Booking() {
+
+       public Booking(int bN, Offer offer, Client client, Date date) {
+               this.bookingNumber = bN;
+               this.offer = offer;
+               this.client = client;
+               // Booking date is assigned to actual date
+               this.bookingDate = date;
        }
 
-       public Booking(int bN ,String telephone, Offer offer) {
-               
+       public Booking(int bN, Offer offer, Client client) {
+
                this.bookingNumber = bN;
-               this.telephone=telephone;
                this.offer = offer;
-               //this.price = price;
-               //Booking date is assigned to actual date
-               this.bookingDate= new java.util.Date(System.currentTimeMillis());
-               this.isPaid=false;
+               this.client = client;
+               // Booking date is assigned to actual date
+               this.bookingDate = new java.util.Date(System.currentTimeMillis());
        }
-       
-       public void imprimete(){
+
+       public void imprimete() {
                System.out.println(bookingNumber);
-               System.out.println(isPaid);
                System.out.println(bookingDate);
-               System.out.println(telephone);
-               System.out.println(offer);              
+               System.out.println(client.toString());
+               System.out.println(offer);
        }
 
        public int getBookNumber() {
@@ -51,7 +53,7 @@ public class Booking implements Serializable {
        public float getPrice() {
                return this.offer.getPrice();
        }
-       
+
        public void setBookDate(Date bookDate) {
                this.bookingDate = bookDate;
        }
@@ -59,25 +61,13 @@ public class Booking implements Serializable {
        public Date getBookDate() {
                return this.bookingDate;
        }
-       
-       public void setTelephone(String telephone) {
-               this.telephone = telephone;
-       }
 
-       public String getTelephone() {
-               return this.telephone;
-       }
-       
-       public void paid() {
-               this.isPaid = true;
+       public Client getClient() {
+               return client;
        }
 
-       public void notPaid() {
-               this.isPaid=false;
+       public void setClient(Client client) {
+               this.client = client;
        }
 
-       public boolean isPaid() {
-               return isPaid;
-       }
-       
 }
\ No newline at end of file