package com.arrebol.taxiservicios.model.admin;

import com.arrebol.taxiservicios.model.catalog.Color;
import com.arrebol.taxiservicios.model.catalog.Location;
import com.arrebol.taxiservicios.model.catalog.Vehicle;
import com.arrebol.taxiservicios.model.core.Person;
import com.arrebol.taxiservicios.model.core.User;
import com.arrebol.taxiservicios.model.enums.BasicType;
import com.arrebol.taxiservicios.model.enums.PlatformType;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 *
 * @author Picasso
 */
public class Taxi implements Serializable {

    private static final long serialVersionUID = 3773719666400846100L;

    private String id;
    private String placa;
    private String economicNumber;
    private String serialNumber;
    private String motorNmumber;
    private String comments;
    private String year;
    private String insuranceNumber;
    private String insuranceName;
    private String insuranceCobertura;
    private Date insuranceEndDate;
    private Double payDay;
    private Double paySaving;
    private Double payAccident;
    private Double paymentCar;
    private Boolean active;
    private Float km;
    private Float kmMaintenance;
    private PlatformType platform;
    private BasicType monday;
    private BasicType tuesday;
    private BasicType wednesday;
    private BasicType thursday;
    private BasicType friday;
    private BasicType saturday;
    private BasicType sunday;
    private Vehicle vehicle;
    private Color color;
    private Person customer;
    private Person driver;
    private User createdBy;
    private Date createdOn;
    private User lastUpdatedBy;
    private Date lastUpdatedOn;
    private Date deletedOn;
    private String commentsDeleted;
    private float adeudo;
    private BasicType gps;
    private BasicType apc;
    private String gpsNumber;
    private Location location;
    private int workDays;
    private Set contracts = new HashSet(0);
    private Set serviceOrders = new HashSet(0);
    private Set sales = new HashSet(0);
    private Set expenses = new HashSet(0);
    private Set releaseResources = new HashSet(0);
    private Set invoices = new HashSet(0);

    public Taxi() {
    }

    /**
     * Usint to create a new Taxi with Idnumber.
     *
     * @param id Identofy number.
     */
    public Taxi(String id) {
        this.id = id;
    }

    /**
     *
     * @param driver
     */
    public Taxi(Person driver) {
        this.driver = driver;
    }

    /**
     *
     * @param id
     * @param placa
     * @param year
     * @param vehicle
     * @param color
     */
    public Taxi(String id, String placa, String year, Vehicle vehicle, Color color) {
        this.id = id;
        this.placa = placa;
        this.year = year;
        this.vehicle = vehicle;
        this.color = color;
    }

    public Taxi(String id, String economicNumber, Person driver, Person customer, Vehicle vehicle) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.driver = driver;
        this.customer = customer;
        this.vehicle = vehicle;
    }
    
    public Taxi(String id, String economicNumber, Person driver, Person customer, Vehicle vehicle,String year, Color color) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.driver = driver;
        this.customer = customer;
        this.vehicle = vehicle;
        this.year = year;
        this.color = color;
    }

    public Taxi(String id, String economicNumber) {

        this.id = id;
        this.economicNumber = economicNumber;
    }

    public Taxi(String id, String economicNumber, Person driver) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.driver = driver;
    }
    
    public Taxi(String id, Person customer, String economicNumber) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.customer = customer;
    }
    
    public Taxi(String id, Person customer, String economicNumber, Color color, Vehicle vehicle) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.customer = customer;
        this.color = color;
        this.vehicle = vehicle;
    }

    public Taxi(String id, String economicNumber, Person driver, Person customer, Vehicle vehicle, Color color,
            String placa, String serialNumber, String motorNmumber, String comments, String year) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.driver = driver;
        this.customer = customer;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
    }

    public Taxi(String id, String placa, String economicNumber, String serialNumber, String motorNmumber, String comments, String year, String insuranceNumber, String insuranceName, String insuranceCobertura, Date insuranceEndDate, Double payDay, Double paySaving, Double payAccident, Double paymentCar, Boolean active, Float km, Float kmMaintenance, PlatformType platform, BasicType monday, BasicType tuesday, BasicType wednesday, BasicType thursday, BasicType friday, BasicType saturday, BasicType sunday, Vehicle vehicle, Color color, Person customer, Person driver, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn) {
        this.id = id;
        this.placa = placa;
        this.economicNumber = economicNumber;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceName = insuranceName;
        this.insuranceCobertura = insuranceCobertura;
        this.insuranceEndDate = insuranceEndDate;
        this.payDay = payDay;
        this.paySaving = paySaving;
        this.payAccident = payAccident;
        this.paymentCar = paymentCar;
        this.active = active;
        this.km = km;
        this.kmMaintenance = kmMaintenance;
        this.platform = platform;
        this.monday = monday;
        this.tuesday = tuesday;
        this.wednesday = wednesday;
        this.thursday = thursday;
        this.friday = friday;
        this.saturday = saturday;
        this.sunday = sunday;
        this.vehicle = vehicle;
        this.color = color;
        this.customer = customer;
        this.driver = driver;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public Taxi(String id, String economicNumber, Person driver, Person customer,
            Vehicle vehicle, Color color, String placa, String serialNumber,
            String motorNmumber, String comments, String year,
            String insuranceNumber, Date insuranceEndDate) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.driver = driver;
        this.customer = customer;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceEndDate = insuranceEndDate;
    }
    
    public Taxi(String id, String economicNumber,  Person customer,
            Vehicle vehicle, Color color, String placa, String serialNumber,
            String motorNmumber, String comments, String year,
            String insuranceNumber, Date insuranceEndDate) {
        this.id = id;
        this.economicNumber = economicNumber;
       
        this.customer = customer;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceEndDate = insuranceEndDate;
    }

    public Taxi(String id, String economicNumber,
            Vehicle vehicle, Color color, String placa, String serialNumber,
            String motorNmumber, String comments, String year,
            String insuranceNumber, Date insuranceEndDate) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceEndDate = insuranceEndDate;
    }

    public Taxi(String id, String economicNumber,
            Vehicle vehicle, Color color, String placa, String serialNumber,
            String motorNmumber, String comments, String year,
            String insuranceNumber, Date insuranceEndDate, float adeudo) {
        this.id = id;
        this.economicNumber = economicNumber;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceEndDate = insuranceEndDate;
        this.adeudo = adeudo;
    }

    public Taxi(String economicNumber, Date insuranceEndDate, Person driver) {
        this.economicNumber = economicNumber;
        this.insuranceEndDate = insuranceEndDate;
        this.driver = driver;
    }

    public Taxi(String economicNumber, Date insuranceEndDate, Person driver, Person customer, String insuranceName, String insuranceCobertura) {
        this.economicNumber = economicNumber;
        this.insuranceEndDate = insuranceEndDate;
        this.driver = driver;
        this.customer = customer;
        this.insuranceName = insuranceName;
        this.insuranceCobertura = insuranceCobertura;
    }

    /**
     *
     * @param payDay
     * @param paySaving
     * @param payAccident
     */
    public Taxi(Double payDay, Double paySaving, Double payAccident) {
        this.payDay = payDay;
        this.paySaving = paySaving;
        this.payAccident = payAccident;
    }

    /**
     *
     * @param id
     * @param placa
     * @param year
     * @param vehicle
     * @param color
     */
    public Taxi(String id, String placa, String year, Vehicle vehicle, Color color, float adeudo) {
        this.id = id;
        this.placa = placa;
        this.year = year;
        this.vehicle = vehicle;
        this.color = color;
        this.adeudo = adeudo;
    }

    public Taxi(String id, String placa, String economicNumber, String serialNumber, String motorNmumber, String comments, String year, String insuranceNumber, String insuranceName, String insuranceCobertura, Date insuranceEndDate, Double payDay, Double paySaving, Double payAccident, Double paymentCar, Boolean active, Float km, Float kmMaintenance, PlatformType platform, BasicType monday, BasicType tuesday, BasicType wednesday, BasicType thursday, BasicType friday, BasicType saturday, BasicType sunday, Vehicle vehicle, Color color, Person customer, Person driver, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn, float adeudo, BasicType gps, String gpsNumber, Location location) {
        this.id = id;
        this.placa = placa;
        this.economicNumber = economicNumber;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceName = insuranceName;
        this.insuranceCobertura = insuranceCobertura;
        this.insuranceEndDate = insuranceEndDate;
        this.payDay = payDay;
        this.paySaving = paySaving;
        this.payAccident = payAccident;
        this.paymentCar = paymentCar;
        this.active = active;
        this.km = km;
        this.kmMaintenance = kmMaintenance;
        this.platform = platform;
        this.monday = monday;
        this.tuesday = tuesday;
        this.wednesday = wednesday;
        this.thursday = thursday;
        this.friday = friday;
        this.saturday = saturday;
        this.sunday = sunday;
        this.vehicle = vehicle;
        this.color = color;
        this.customer = customer;
        this.driver = driver;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.adeudo = adeudo;
        this.gps = gps;
        this.gpsNumber = gpsNumber;
        this.location = location;
    }
    
     public Taxi(String id, String economicNumber, Person customer,
            Vehicle vehicle, Color color, String placa, String serialNumber,
            String motorNmumber, String comments, String year,
            String insuranceNumber, Date insuranceEndDate, Float km, Double paymentCar) {
        this.id = id;
        this.economicNumber = economicNumber;
        
        this.customer = customer;
        this.vehicle = vehicle;
        this.color = color;
        this.placa = placa;
        this.serialNumber = serialNumber;
        this.motorNmumber = motorNmumber;
        this.comments = comments;
        this.year = year;
        this.insuranceNumber = insuranceNumber;
        this.insuranceEndDate = insuranceEndDate;
        this.km = km;
        this.paymentCar = paymentCar;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public BasicType getGps() {
        return gps;
    }

    public void setGps(BasicType gps) {
        this.gps = gps;
    }

    public String getGpsNumber() {
        return gpsNumber;
    }

    public void setGpsNumber(String gpsNumber) {
        this.gpsNumber = gpsNumber;
    }

    public float getAdeudo() {
        return adeudo;
    }

    public void setAdeudo(float adeudo) {
        this.adeudo = adeudo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPlaca() {
        return placa;
    }

    public void setPlaca(String placa) {
        this.placa = placa;
    }

    public String getEconomicNumber() {
        return economicNumber;
    }

    public void setEconomicNumber(String economicNumber) {
        this.economicNumber = economicNumber;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getMotorNmumber() {
        return motorNmumber;
    }

    public void setMotorNmumber(String motorNmumber) {
        this.motorNmumber = motorNmumber;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getInsuranceNumber() {
        return insuranceNumber;
    }

    public void setInsuranceNumber(String insuranceNumber) {
        this.insuranceNumber = insuranceNumber;
    }

    public Date getInsuranceEndDate() {
        return insuranceEndDate;
    }

    public void setInsuranceEndDate(Date insuranceEndDate) {
        this.insuranceEndDate = insuranceEndDate;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public Float getKm() {
        return km;
    }

    public void setKm(Float km) {
        this.km = km;
    }

    public PlatformType getPlatform() {
        return platform;
    }

    public void setPlatform(PlatformType platform) {
        this.platform = platform;
    }

    public BasicType getMonday() {
        return monday;
    }

    public void setMonday(BasicType monday) {
        this.monday = monday;
    }

    public BasicType getTuesday() {
        return tuesday;
    }

    public void setTuesday(BasicType tuesday) {
        this.tuesday = tuesday;
    }

    public BasicType getWednesday() {
        return wednesday;
    }

    public void setWednesday(BasicType wednesday) {
        this.wednesday = wednesday;
    }

    public BasicType getThursday() {
        return thursday;
    }

    public void setThursday(BasicType thursday) {
        this.thursday = thursday;
    }

    public BasicType getFriday() {
        return friday;
    }

    public void setFriday(BasicType friday) {
        this.friday = friday;
    }

    public BasicType getSaturday() {
        return saturday;
    }

    public void setSaturday(BasicType saturday) {
        this.saturday = saturday;
    }

    public BasicType getSunday() {
        return sunday;
    }

    public void setSunday(BasicType sunday) {
        this.sunday = sunday;
    }

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    public Person getCustomer() {
        return customer;
    }

    public void setCustomer(Person customer) {
        this.customer = customer;
    }

    public Person getDriver() {
        return driver;
    }

    public void setDriver(Person driver) {
        this.driver = driver;
    }

    public User getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(User createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public User getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(User lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

    public void setLastUpdatedOn(Date lastUpdatedOn) {
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public Set getContracts() {
        return contracts;
    }

    public void setContracts(Set contracts) {
        this.contracts = contracts;
    }

    public Set getServiceOrders() {
        return serviceOrders;
    }

    public void setServiceOrders(Set serviceOrders) {
        this.serviceOrders = serviceOrders;
    }

    public Set getSales() {
        return sales;
    }

    public void setSales(Set sales) {
        this.sales = sales;
    }

    public Set getExpenses() {
        return expenses;
    }

    public void setExpenses(Set expenses) {
        this.expenses = expenses;
    }

    public Double getPayDay() {
        return payDay;
    }

    public void setPayDay(Double payDay) {
        this.payDay = payDay;
    }

    public Double getPaySaving() {
        return paySaving;
    }

    public void setPaySaving(Double paySaving) {
        this.paySaving = paySaving;
    }

    public Double getPayAccident() {
        return payAccident;
    }

    public void setPayAccident(Double payAccident) {
        this.payAccident = payAccident;
    }

    public Double getPaymentCar() {
        return paymentCar;
    }

    public void setPaymentCar(Double paymentCar) {
        this.paymentCar = paymentCar;
    }

    public Float getKmMaintenance() {
        return kmMaintenance;
    }

    public void setKmMaintenance(Float kmMaintenance) {
        this.kmMaintenance = kmMaintenance;
    }

    public String getInsuranceName() {
        return insuranceName;
    }

    public void setInsuranceName(String insuranceName) {
        this.insuranceName = insuranceName;
    }

    public String getInsuranceCobertura() {
        return insuranceCobertura;
    }

    public void setInsuranceCobertura(String insuranceCobertura) {
        this.insuranceCobertura = insuranceCobertura;
    }

    public Set getReleaseResources() {
        return releaseResources;
    }

    public void setReleaseResources(Set releaseResources) {
        this.releaseResources = releaseResources;
    }

    public Set getInvoices() {
        return invoices;
    }

    public void setInvoices(Set invoices) {
        this.invoices = invoices;
    }

    public Date getDeletedOn() {
        return deletedOn;
    }

    public void setDeletedOn(Date deletedOn) {
        this.deletedOn = deletedOn;
    }

    public String getCommentsDeleted() {
        return commentsDeleted;
    }

    public void setCommentsDeleted(String commentsDeleted) {
        this.commentsDeleted = commentsDeleted;
    }

    public int getWorkDays() {
        return workDays;
    }

    public void setWorkDays(int workDays) {
        this.workDays = workDays;
    }

    
    
    public String getContractName() {
        String dato = "No tiene contrato";
        if (!getContracts().isEmpty()) {
            for (Iterator<Contract> it = getContracts().iterator(); it.hasNext();) {
                dato = it.next().getName();
                break;
            }
        }

        return dato;
    }

    public BasicType getApc() {
        return apc;
    }

    public void setApc(BasicType apc) {
        this.apc = apc;
    }

    @Override
    public String toString() {
        return "Taxi{" + "id=" + id + ", placa=" + placa + ", economicNumber=" + economicNumber + ", serialNumber=" + serialNumber + ", motorNmumber=" + motorNmumber + ", comments=" + comments + ", year=" + year + ", insuranceNumber=" + insuranceNumber + ", insuranceEndDate=" + insuranceEndDate + ", active=" + active + ", vehicle=" + vehicle + ", color=" + color + ", customer=" + customer + ", driver=" + driver + '}';
    }

}
