package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@SequenceGenerator(name = "TARJETA_CREDITO_SEQ", sequenceName = "TARJETA_CREDITO_SEQ", allocationSize = 1)
@Table(name = "TARJETA_CREDITO")
public class TarjetaCredito implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "TARJETA_CREDITO_SEQ")
	@Column(name = "TARJETACREDITO_ID")
	private Integer tarjetaCreditoId;
	@Column(name = "DESCTARJETACREDITO")
	private String descTarjetaCredito;
	@Column(name = "CANTMAXSINTASA")
	private Integer cantMaxSinTasa;
	@Column(name = "CANMAXCONTASA")
	private Integer canMaxConTasa;
	@Column(name = "TASA")
	private BigDecimal tasa;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	@OneToOne
	@JoinColumn(name = "EMPRESA_ID")
	private Empresa empresa;
	@Column(name = "TARIFAMINIMA")
	private BigDecimal tarifaMinima;
	@Column(name = "INDAPLICAVENDA")
	private Boolean indAplicaVenda;

	public Integer getTarjetaCreditoId() {
		return tarjetaCreditoId;
	}

	public void setTarjetaCreditoId(Integer tarjetaCreditoId) {
		this.tarjetaCreditoId = tarjetaCreditoId;
	}

	public String getDescTarjetaCredito() {
		return descTarjetaCredito;
	}

	public void setDescTarjetaCredito(String descTarjetaCredito) {
		this.descTarjetaCredito = descTarjetaCredito;
	}

	public Integer getCantMaxSinTasa() {
		return cantMaxSinTasa;
	}

	public void setCantMaxSinTasa(Integer cantMaxSinTasa) {
		this.cantMaxSinTasa = cantMaxSinTasa;
	}

	public Integer getCanMaxConTasa() {
		return canMaxConTasa;
	}

	public void setCanMaxConTasa(Integer canMaxConTasa) {
		this.canMaxConTasa = canMaxConTasa;
	}

	public BigDecimal getTasa() {
		return tasa;
	}

	public void setTasa(BigDecimal tasa) {
		this.tasa = tasa;
	}

	public Boolean getActivo() {
		return activo;
	}

	public void setActivo(Boolean activo) {
		this.activo = activo;
	}

	public Date getFecmodif() {
		return fecmodif;
	}

	public void setFecmodif(Date fecmodif) {
		this.fecmodif = fecmodif;
	}

	public Integer getUsuarioId() {
		return usuarioId;
	}

	public void setUsuarioId(Integer usuarioId) {
		this.usuarioId = usuarioId;
	}

	public Empresa getEmpresa() {
		return empresa;
	}

	public void setEmpresa(Empresa empresa) {
		this.empresa = empresa;
	}
	
	public BigDecimal getTarifaMinima() {
		return tarifaMinima;
	}

	public void setTarifaMinima(BigDecimal tarifaMinima) {
		this.tarifaMinima = tarifaMinima;
	}

	public Boolean getIndAplicaVenda() {
		return indAplicaVenda;
	}

	public void setIndAplicaVenda(Boolean indAplicaVenda) {
		this.indAplicaVenda = indAplicaVenda;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((tarjetaCreditoId == null) ? 0 : tarjetaCreditoId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TarjetaCredito other = (TarjetaCredito) obj;
		if (tarjetaCreditoId == null) {
			if (other.tarjetaCreditoId != null)
				return false;
		} else if (!tarjetaCreditoId.equals(other.tarjetaCreditoId))
			return false;
		return true;
	}

}
