/*
 * 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.predio;

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 org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author pc one
 */
@Entity
@Table(name = "abono_lote_detalle")
public class AbonoLoteDetalle 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_abono_lote",
            referencedColumnName = "id",
            nullable = false
    )
    private AbonoLote abonoLote;

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

    @Column(name = "pago", nullable = true)
    private Double pago;

    @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;

    @Column(name = "mandado", nullable = true)
    private Double mandado;

    @Column(name = "cobranza", nullable = true)
    private Double cobranza;

    @Column(name = "folio", nullable = true)
    private String folio;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(
            name = "id_abono_multiple",
            referencedColumnName = "id",
            nullable = true
    )
    private HitorialAbonoMultiple abonoMultiple;

    public AbonoLoteDetalle() {
    }

    public AbonoLoteDetalle(String id, AbonoLote abonoLote, GenericEnumType estatusActivo, Double pago, Date createdOn, User createdBy, Date lastUpdatedOn, User lastUpdatedBy) {
        this.id = id;
        this.abonoLote = abonoLote;
        this.estatusActivo = estatusActivo;
        this.pago = pago;
        this.createdOn = createdOn;
        this.createdBy = createdBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public AbonoLoteDetalle(String id, AbonoLote abonoLote, GenericEnumType estatusActivo, Double pago, Date createdOn, User createdBy, Date lastUpdatedOn, User lastUpdatedBy, Double mandado, Double cobranza) {
        this.id = id;
        this.abonoLote = abonoLote;
        this.estatusActivo = estatusActivo;
        this.pago = pago;
        this.createdOn = createdOn;
        this.createdBy = createdBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.mandado = mandado;
        this.cobranza = cobranza;
    }

    @Override
    public String toString() {
        return "AbonoLote{" + "id=" + id + ", lote=" + abonoLote + '}';
    }

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

    public String getId() {
        return id;
    }

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

    public AbonoLote getAbonoLote() {
        return abonoLote;
    }

    public void setAbonoLote(AbonoLote abonoLote) {
        this.abonoLote = abonoLote;
    }

    public GenericEnumType getEstatusActivo() {
        return estatusActivo;
    }

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

    public Double getPago() {
        return pago;
    }

    public void setPago(Double pago) {
        this.pago = pago;
    }

    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 Double getMandado() {
        return mandado;
    }

    public void setMandado(Double mandado) {
        this.mandado = mandado;
    }

    public Double getCobranza() {
        return cobranza;
    }

    public void setCobranza(Double cobranza) {
        this.cobranza = cobranza;
    }

    public String getFolio() {
        return folio;
    }

    public void setFolio(String folio) {
        this.folio = folio;
    }

    public HitorialAbonoMultiple getAbonoMultiple() {
        return abonoMultiple;
    }

    public void setAbonoMultiple(HitorialAbonoMultiple abonoMultiple) {
        this.abonoMultiple = abonoMultiple;
    }

}
