/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.arrebol.taxiservicios.model.spa;

import com.arrebol.taxiservicios.model.core.User;
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author Crov
 */
@Entity
@Table(name = "cesiones")
public class Cesiones implements Serializable {

    private static final long serialVersionUID = -6653037938225719593L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    @Column(name = "id", length = 36)
    private String id;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(
            name = "id_venta",
            referencedColumnName = "id",
            nullable = false
    )
    private Ventas venta;

    @Enumerated(EnumType.STRING)
    @Column(name = "estatus_activo", nullable = false)
    private GenericEnumType estatusActivo;

    @Enumerated(EnumType.STRING)
    @Column(name = "estatus_cesion", nullable = false)
    private GenericEnumType estatusCesion;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "fecha_cesion")
    private Date fechaCesion;

    @Column(name = "hora")
    private Integer hora;

    @Column(name = "minutos")
    private Integer minutos;

    @Column(name = "duracion")
    private double duracion;

    @Column(name = "comentario")
    private String comentario;

    @Column(name = "confirmada")
    private boolean confirmada;

    @Transient
    private Integer numeroSesion;

    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(
            name = "id_catalogo_productos",
            referencedColumnName = "id",
            nullable = true
    )
    private CatalogoProductos producto;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created_on")
    private Date createdOn;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(
            name = "created_by",
            referencedColumnName = "id",
            nullable = false
    )
    private User createdBy;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_updated_on")
    private Date lastUpdatedOn;

    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(
            name = "last_updated_by",
            referencedColumnName = "id",
            nullable = true
    )
    private User lastUpdatedBy;

    public Cesiones() {
    }

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

    public String getId() {
        return id;
    }

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

    public Ventas getVenta() {
        return venta;
    }

    public void setVenta(Ventas venta) {
        this.venta = venta;
    }

    public GenericEnumType getEstatusActivo() {
        return estatusActivo;
    }

    public void setEstatusActivo(GenericEnumType estatusActivo) {
        this.estatusActivo = estatusActivo;
    }

    public GenericEnumType getEstatusCesion() {
        return estatusCesion;
    }

    public void setEstatusCesion(GenericEnumType estatusCesion) {
        this.estatusCesion = estatusCesion;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

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

    public User getCreatedBy() {
        return createdBy;
    }

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

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

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

    public User getLastUpdatedBy() {
        return lastUpdatedBy;
    }

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

    public Date getFechaCesion() {
        return fechaCesion;
    }

    public void setFechaCesion(Date fechaCesion) {
        this.fechaCesion = fechaCesion;
    }

    public CatalogoProductos getProducto() {
        return producto;
    }

    public void setProducto(CatalogoProductos producto) {
        this.producto = producto;
    }

    public Integer getHora() {
        return hora;
    }

    public void setHora(Integer hora) {
        this.hora = hora;
    }

    public Integer getMinutos() {
        return minutos;
    }

    public void setMinutos(Integer minutos) {
        this.minutos = minutos;
    }

    public Integer getNumeroSesion() {
        return numeroSesion;
    }

    public void setNumeroSesion(Integer numeroSesion) {
        this.numeroSesion = numeroSesion;
    }

    public boolean isConfirmada() {
        return confirmada;
    }

    public void setConfirmada(boolean confirmada) {
        this.confirmada = confirmada;
    }

    public double getDuracion() {
        return duracion;
    }

    public void setDuracion(double duracion) {
        this.duracion = duracion;
    }

    public String getComentario() {
        return comentario;
    }

    public void setComentario(String comentario) {
        this.comentario = comentario;
    }

}
