package Elements;

import DataAccess.Implementations.PurchaseDao;
import Elements.Base.DataAccessMethods;
import Elements.Base.SerializedObject;

import java.math.BigDecimal;
import java.sql.SQLException;

public class Purchase extends SerializedObject implements DataAccessMethods {
    private Person client;
    private BigDecimal total;


    public Person getClient() {
        return client;
    }

    public void setClient(Person client) {
        this.client = client;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    @Override
    public Purchase save() throws SQLException {
        PurchaseDao purchaseDao = new PurchaseDao();
        this.id = purchaseDao.insertPurchase(this);
        return this;
    }
}

@@ -184,28 +184,128 @@
 ava.sql.
-SQLException
+Date;%0Aimport java.sql.SQLException;%0Aimport java.sql.Time;%0Aimport java.time.LocalDate;%0Aimport java.time.LocalTime
 ;%0A%0Apubli
@@ -434,16 +434,61 @@
  total;%0A
+    private Date date;%0A    private Time time;
 %0A%0A    pu
@@ -763,24 +763,112 @@
 tal;%0A    %7D%0A%0A
+    public Date getDate() %7B return date; %7D%0A%0A    public Time getTime() %7B return time; %7D%0A%0A
     @Overrid
@@ -971,16 +971,118 @@
 eDao();%0A
+        this.date = Date.valueOf(LocalDate.now());%0A        this.time = Time.valueOf(LocalTime.now());%0A
         

add date and time to purchases