/*
 * 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.apc.model.catalog;

import com.arrebol.apc.model.enums.GenericEnumType;
import com.arrebol.apc.model.enums.TipoMovimiento;
import com.arrebol.apc.model.loan.LoanType;
import java.io.Serializable;
import java.math.BigDecimal;
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 Oscar
 */
@Entity
@Table(name = "APC_MOVIMIENTOS_INVENTARIO")
public class MovimientosInventario implements Serializable {

   private static final long serialVersionUID = -3628564854853325265L;

   @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_loan_type",
           referencedColumnName = "id",
           nullable = false
   )
   private LoanType loanType;

   @Column(name = "tipo", length = 10)
   @Enumerated(EnumType.STRING)
   private TipoMovimiento tipo;

   @Column(name = "cantidad_movimiento", nullable = false)
   private BigDecimal cantidadMovimiento;

   @Column(name = "inventario_antiguo", nullable = false)
   private BigDecimal inventarioAntiguo;

   @Column(name = "inventario_nuevo", nullable = false)
   private BigDecimal inventarioNuevo;

   @Column(name = "comentario", nullable = false)
   private String comentario;

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

   @Column(name = "created_by", nullable = false, length = 36)
   private String createdBy;

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

   @Column(name = "last_updated_by", length = 36)
   private String lastUpdatedBy;

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

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

   public MovimientosInventario() {
   }

   public String getId() {
      return id;
   }

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

   public LoanType getLoanType() {
      return loanType;
   }

   public void setLoanType(LoanType loanType) {
      this.loanType = loanType;
   }

   public TipoMovimiento getTipo() {
      return tipo;
   }

   public void setTipo(TipoMovimiento tipo) {
      this.tipo = tipo;
   }

   public BigDecimal getCantidadMovimiento() {
      return cantidadMovimiento;
   }

   public void setCantidadMovimiento(BigDecimal cantidadMovimiento) {
      this.cantidadMovimiento = cantidadMovimiento;
   }

   public BigDecimal getInventarioAntiguo() {
      return inventarioAntiguo;
   }

   public void setInventarioAntiguo(BigDecimal inventarioAntiguo) {
      this.inventarioAntiguo = inventarioAntiguo;
   }

   public BigDecimal getInventarioNuevo() {
      return inventarioNuevo;
   }

   public void setInventarioNuevo(BigDecimal inventarioNuevo) {
      this.inventarioNuevo = inventarioNuevo;
   }

   public String getComentario() {
      return comentario;
   }

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

   public GenericEnumType getEstatusActivo() {
      return estatusActivo;
   }

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

   public String getCreatedBy() {
      return createdBy;
   }

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

   public Date getCreatedOn() {
      return createdOn;
   }

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

   public String getLastUpdatedBy() {
      return lastUpdatedBy;
   }

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

   public Date getLastUpdatedOn() {
      return lastUpdatedOn;
   }

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

}
