/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.model.catalog;

import com.arrebol.taxiservicios.model.core.User;
import com.arrebol.taxiservicios.model.enums.BasicType;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

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

    private static final long serialVersionUID = -6411021331465644642L;

    private String id;
    private String name;
    private String code;
    private Double amount;
    private Double utility;
    private Double amount2;
    private Double utility2;
    private Integer quantity;
    private Integer quantity2;
    private Integer life;
    private Brand brand;
    private BasicType activeStatus ;
    private BasicType service ;
    private BasicType herramienta ;
    private String tipoUso;
    private String compatibilidad;
    private User createdBy;
    private Date createdOn;
    private User lastUpdatedBy;
    private Date lastUpdatedOn;
    private ClaveUnidad claveUnidad;
    private ClaveProductoServicio claveProductoServicio;
    private Set invoiceHasProducts = new HashSet(0);
    private Set serviceOrderHasProducts = new HashSet(0);
    private Set productInvoiceBks = new HashSet(0);

    public Product() {
    }

    /**
     *
     * @param id
     * @param name
     * @param amount
     * @param utility
     * @param quantity
     */
    public Product(String id, String name, Double amount, Double utility, Integer quantity) {
        this.id = id;
        this.name = name;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
    }

    /**
     *
     * @param id
     * @param name
     * @param code
     * @param amount
     * @param utility
     * @param quantity
     * @param brand
     * @param createdBy
     * @param createdOn
     * @param lastUpdatedBy
     * @param lastUpdatedOn
     */
    public Product(String id, String name, String code, Double amount, Double utility, Integer quantity, Brand brand, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
    }

    /**
     *
     * @param id
     * @param name
     * @param code
     * @param amount
     * @param utility
     * @param quantity
     * @param brand
     */
    public Product(String id, String name, String code, Double amount, Double utility, Integer quantity, Brand brand) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
    }
    
    public Product(String id, String name, String code, Double amount, Double utility, Integer quantity, Brand brand, Double amount2, Double utility2) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.amount2 = amount2;
        this.utility2 = utility2;
    }

    /**
     *
     * @param id
     * @param name
     * @param code
     * @param amount
     * @param utility
     * @param quantity
     * @param brand
     * @param life
     */
    public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
    }
    
    public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life, Integer quantity2) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
        this.quantity2 = quantity2;
    }
    
    public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life, Integer quantity2, String tipoUso, String compatibilidad) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
        this.quantity2 = quantity2;
        this.tipoUso = tipoUso;
        this.compatibilidad = compatibilidad;
    }
    
    public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life, Integer quantity2, String tipoUso, String compatibilidad, Double amount2, Double utility2) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
        this.quantity2 = quantity2;
        this.tipoUso = tipoUso;
        this.compatibilidad = compatibilidad;
        this.amount2 = amount2;
        this.utility2 = utility2;
    }
    
    public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life, Integer quantity2, String tipoUso, String compatibilidad, Double amount2, Double utility2,
            BasicType service) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
        this.quantity2 = quantity2;
        this.tipoUso = tipoUso;
        this.compatibilidad = compatibilidad;
        this.amount2 = amount2;
        this.utility2 = utility2;
        this.service = service;
    }
    
     public Product(String id, String name, String code, Double amount,
            Double utility, Integer quantity, Brand brand, Integer life, Integer quantity2, String tipoUso, String compatibilidad, Double amount2, Double utility2,
            BasicType service, ClaveUnidad claveUnidad, ClaveProductoServicio claveProductoServicio) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.utility = utility;
        this.quantity = quantity;
        this.brand = brand;
        this.life = life;
        this.quantity2 = quantity2;
        this.tipoUso = tipoUso;
        this.compatibilidad = compatibilidad;
        this.amount2 = amount2;
        this.utility2 = utility2;
        this.service = service;
        this.claveUnidad = claveUnidad;
        this.claveProductoServicio = claveProductoServicio;
    }
    
    

    /**
     *
     * @param id
     * @param name
     * @param code
     */
    public Product(String id, String name, String code) {
        this.id = id;
        this.name = name;
        this.code = code;
    }
    
    /**
     *
     * @param id
     * @param name
     * @param code
     * @param brand
     */
    public Product(String id, String name, String code, Brand brand) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.brand = brand;
    }
    
    public Product(String id, String name, String code, Brand brand, Double amount , Integer quantity) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.brand = brand;
        this.amount = amount;
        this.quantity = quantity;
    }

    /**
     * For order of shopping.
     *
     * @param id
     * @param amount
     * @param quantity
     */
    public Product(String id, Double amount, Integer quantity) {
        this.id = id;
        this.amount = amount;
        this.quantity = quantity;
    }

    public BasicType getActiveStatus() {
        return activeStatus;
    }

    public void setActiveStatus(BasicType activeStatus) {
        this.activeStatus = activeStatus;
    }

    public Product(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Double getUtility() {
        return utility;
    }

    public void setUtility(Double utility) {
        this.utility = utility;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Brand getBrand() {
        return brand;
    }

    public void setBrand(Brand brand) {
        this.brand = brand;
    }

    public Integer getLife() {
        return life;
    }

    public void setLife(Integer life) {
        this.life = life;
    }

    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 void setInvoiceHasProducts(Set invoiceHasProducts) {
        this.invoiceHasProducts = invoiceHasProducts;
    }

    public Set getInvoiceHasProducts() {
        return invoiceHasProducts;
    }

    public Set getServiceOrderHasProducts() {
        return serviceOrderHasProducts;
    }

    public void setServiceOrderHasProducts(Set serviceOrderHasProducts) {
        this.serviceOrderHasProducts = serviceOrderHasProducts;
    }

    public Set getProductInvoiceBks() {
        return productInvoiceBks;
    }

    public void setProductInvoiceBks(Set productInvoiceBks) {
        this.productInvoiceBks = productInvoiceBks;
    }

    public Integer getQuantity2() {
        return quantity2;
    }

    public void setQuantity2(Integer quantity2) {
        this.quantity2 = quantity2;
    }

    public String getTipoUso() {
        return tipoUso;
    }

    public void setTipoUso(String tipoUso) {
        this.tipoUso = tipoUso;
    }

    public String getCompatibilidad() {
        return compatibilidad;
    }

    public void setCompatibilidad(String compatibilidad) {
        this.compatibilidad = compatibilidad;
    }

    public Double getAmount2() {
        return amount2;
    }

    public void setAmount2(Double amount2) {
        this.amount2 = amount2;
    }

    public Double getUtility2() {
        return utility2;
    }

    public void setUtility2(Double utility2) {
        this.utility2 = utility2;
    }

    public BasicType getService() {
        return service;
    }

    public void setService(BasicType service) {
        this.service = service;
    }

    public BasicType getHerramienta() {
        return herramienta;
    }

    public void setHerramienta(BasicType herramienta) {
        this.herramienta = herramienta;
    }

    public ClaveUnidad getClaveUnidad() {
        return claveUnidad;
    }

    public void setClaveUnidad(ClaveUnidad claveUnidad) {
        this.claveUnidad = claveUnidad;
    }

    public ClaveProductoServicio getClaveProductoServicio() {
        return claveProductoServicio;
    }

    public void setClaveProductoServicio(ClaveProductoServicio claveProductoServicio) {
        this.claveProductoServicio = claveProductoServicio;
    }
    
    
    
    public String getTipoDesc(){
        if(service == BasicType.ENEBLED)
        {
            return "Servicio";
        }
        if(herramienta == BasicType.ENEBLED)
        {
            return "Herramienta";
        }

        return "Producto";
    }

    @Override
    public String toString() {
        return "Product{" + "id=" + id + ", name=" + name + ", code=" + code + ", amount=" + amount + ", utility=" + utility + ", quantity=" + quantity + ", brand=" + brand + '}';
    }

}
