/*
 * 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.catalog.Location;
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 Crov
 */
@Entity
@Table(name = "devolucion_pago_venta")
public class DevolucionPagoVenta 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 = true)
   @JoinColumn(
           name = "id_solicitud_devolucion_pago_venta",
           referencedColumnName = "id",
           nullable = false
   )
   private SolicitudDevolucionPagoVenta solicitud;

   @ManyToOne(fetch = FetchType.LAZY, optional = false)
   @JoinColumn(
           name = "id_location",
           referencedColumnName = "id",
           nullable = false
   )
   private Location location;

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

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

   @Column(name = "cantidad_devuelta", nullable = false)
   private Double cantidadDevuelta;

   @Column(name = "detalles", nullable = true)
   private String detalles;

   @Column(name = "tipo_movimiento", nullable = false)
   private int tipoMovimiento;

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

   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "created_on", length = 19)
   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", length = 19)
   private Date lastUpdatedOn;

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

   public DevolucionPagoVenta() {
   }

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

   public String getId() {
      return id;
   }

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

   public SolicitudDevolucionPagoVenta getSolicitud() {
      return solicitud;
   }

   public void setSolicitud(SolicitudDevolucionPagoVenta solicitud) {
      this.solicitud = solicitud;
   }

   public Location getLocation() {
      return location;
   }

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

   public GenericEnumType getPagoEstatus() {
      return pagoEstatus;
   }

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

   public GenericEnumType getEstatusActivo() {
      return estatusActivo;
   }

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

   public Double getCantidadDevuelta() {
      return cantidadDevuelta;
   }

   public void setCantidadDevuelta(Double cantidadDevuelta) {
      this.cantidadDevuelta = cantidadDevuelta;
   }

   public int getTipoMovimiento() {
      return tipoMovimiento;
   }

   public void setTipoMovimiento(int tipoMovimiento) {
      this.tipoMovimiento = tipoMovimiento;
   }

   public User getSolicitante() {
      return solicitante;
   }

   public void setSolicitante(User solicitante) {
      this.solicitante = solicitante;
   }

   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 String getDetalles() {
      return detalles;
   }

   public void setDetalles(String detalles) {
      this.detalles = detalles;
   }

}
