/*
 * 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.Person;
import com.arrebol.taxiservicios.model.enums.GenericEnumType;
import com.arrebol.taxiservicios.model.enums.TipoAbono;
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 = "abono_lote_view")
public class AbonoLoteView 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;
    
    @Column(name = "id_abono", nullable = true)
    private String idAbono;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(
            name = "id_lote",
            referencedColumnName = "id",
            nullable = false
    )
    private Lote lote;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(
            name = "id_cliente",
            referencedColumnName = "id",
            nullable = true
    )
    private Person cliente;
    
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "mensualidad")
    private Date fechaAPagar;
    
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "fecha_pago")
    private Date lastUpdatedOn;
    
    @Column(name = "pago_esperado", nullable = true)
    private Double pago;
    
    @Column(name = "cantidad_pagada", nullable = true)
    private Double cantidadPagada;
    
    @Column(name = "diferencia", nullable = true)
    private Double diferenciaPago;
    
    @Column(name = "saldo_anterior", nullable = true)
    private Double saldoAnterior;
    
    @Column(name = "saldo_nuevo", nullable = true)
    private Double saldoNuevo;
    
    @Enumerated(EnumType.STRING)
    @Column(name = "estatus", nullable = false)
    private GenericEnumType pagoEstatus;
    
    @Enumerated(EnumType.STRING)
    @Column(name = "tipo", nullable = false)
    private TipoAbono tipoAbono;
    
    @Column(name = "folio")
    private String folio;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(
            name = "id_abono_multiple",
            referencedColumnName = "id",
            nullable = true
    )
    private HitorialAbonoMultiple abonoMultiple;
    
    @Transient
    private String numeroAbono;

    public AbonoLoteView() {
    }

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

    public String getId() {
        return id;
    }

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

    public Lote getLote() {
        return lote;
    }

    public void setLote(Lote lote) {
        this.lote = lote;
    }

    public Date getFechaAPagar() {
        return fechaAPagar;
    }

    public void setFechaAPagar(Date fechaAPagar) {
        this.fechaAPagar = fechaAPagar;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

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

    public Double getPago() {
        return pago;
    }

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

    public Double getCantidadPagada() {
        return cantidadPagada;
    }

    public void setCantidadPagada(Double cantidadPagada) {
        this.cantidadPagada = cantidadPagada;
    }

    public Double getDiferenciaPago() {
        return diferenciaPago;
    }

    public void setDiferenciaPago(Double diferenciaPago) {
        this.diferenciaPago = diferenciaPago;
    }

    public Double getSaldoAnterior() {
        return saldoAnterior;
    }

    public void setSaldoAnterior(Double saldoAnterior) {
        this.saldoAnterior = saldoAnterior;
    }

    public Double getSaldoNuevo() {
        return saldoNuevo;
    }

    public void setSaldoNuevo(Double saldoNuevo) {
        this.saldoNuevo = saldoNuevo;
    }

    public GenericEnumType getPagoEstatus() {
        return pagoEstatus;
    }

    public void setPagoEstatus(GenericEnumType pagoEstatus) {
        this.pagoEstatus = pagoEstatus;
    }

    public TipoAbono getTipoAbono() {
        return tipoAbono;
    }

    public void setTipoAbono(TipoAbono tipoAbono) {
        this.tipoAbono = tipoAbono;
    }

    public String getNumeroAbono() {
        return numeroAbono;
    }

    public void setNumeroAbono(String numeroAbono) {
        this.numeroAbono = numeroAbono;
    }

    public String getIdAbono() {
        return idAbono;
    }

    public void setIdAbono(String idAbono) {
        this.idAbono = idAbono;
    }

    public Person getCliente() {
        return cliente;
    }

    public void setCliente(Person cliente) {
        this.cliente = cliente;
    }

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