package com.cloudycrew.cloudycar.models.requests;

import com.cloudycrew.cloudycar.Identifiable;
import com.cloudycrew.cloudycar.models.Route;
import com.cloudycrew.cloudycar.models.User;

import java.util.UUID;

/**
 * Created by George on 2016-10-13.
 */
public abstract class Request implements Identifiable {
    private String requestType;
    private String riderUsername;
    private Route route;
    private double price;
    /**
     * The Id.
     */
    protected String id;

    /**
     * Instantiates a new Request.
     *
     * @param type          the type
     * @param riderUsername the rider username
     * @param route         the route
     * @param price         the price
     */
    public Request(String type, String riderUsername, Route route, double price) {
        this.requestType = type;
        this.riderUsername = riderUsername;
        this.route = route;
        this.price = price;
    }

    /**
     * Gets request type.
     *
     * @return the request type
     */
    public String getRequestType() {
        return requestType;
    }

    /**
     * Gets rider.
     *
     * @return the rider
     */
    public String getRider() {
        return riderUsername;
    }

    /**
     * Gets route.
     *
     * @return the route
     */
    public Route getRoute() {
        return route;
    }

    /**
     * Gets price.
     *
     * @return the price
     */
    public double getPrice() {
        return price;
    }
    public String getId(){
        return this.id.toString();
    }

    /**
     * Sets rider username.
     *
     * @param name the name
     */
    public void setRiderUsername(String name) {
        this.riderUsername = name;
    }
}

@@ -182,16 +182,39 @@
 .User;%0A%0A
+import java.util.Date;%0A
 import j
@@ -228,16 +228,16 @@
 l.UUID;%0A
-
 %0A/**%0A * 
@@ -442,24 +442,55 @@
 uble price;%0A
+    private Date lastUpdated;%0A%0A
     /**%0A    
@@ -964,24 +964,63 @@
 ce = price;%0A
+        this.lastUpdated = new Date();%0A
     %7D%0A%0A    /
@@ -1746,24 +1746,24 @@
 ing name) %7B%0A
-
         this
@@ -1790,11 +1790,179 @@
 e;%0A    %7D
+%0A%0A    public Date getLastUpdated() %7B%0A        return lastUpdated;%0A    %7D%0A%0A    public void setLastUpdated(Date lastUpdated) %7B%0A        this.lastUpdated = lastUpdated;%0A    %7D
 %0A%7D%0A

Add lastUpdated field to a Request