package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Table(name = "LimbahB3Masuk_T")
public class LimbahB3Masuk extends BaseTransaction {

	@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJenisLimbahB3MasukFk")
	@NotNull(message = "Jenis Limbah tidak boleh kosong")
	@Caption(value = "jenis Limbah")
	private JenisLimbahB3Masuk jenisLimbahB3Masuk;

	@Column(name = "ObjectJenisLimbahB3MasukFk", insertable = false, updatable = false, nullable = false)
	private Integer jenisLimbahB3MasukId;

	@Column(name = "Tanggal", nullable = true)
	@Caption(value = "Tanggal")
	private Date tanggal;

	@Column(name = "BeratSampahMedis", nullable = true)
	@Caption(value = "Berat Sampah Medis")
	private Double beratSampahMedis;

	@Column(name = "Waktu", nullable = true)
	@Caption(value = "Waktu")
	private String waktu;

	@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuanganFk")
	@Caption(value = "Pelayanan")
	private Ruangan ruangan;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false, nullable = true)
	private Integer ruanganId;

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "limbahB3Masuk")
	@Caption(value = "mapPegawaiLimbah")
	private Set<MapPegawaiLimbah> mapPegawaiLimbah = new HashSet<MapPegawaiLimbah>();

	@Column(name = "MaksimalPenyimpanan", nullable = true)
	@Caption(value = "Maksimal Penyimpanan")
	private Integer maksimalPenyimpanan;

	@Column(name = "QtyKeluar", nullable = true)
	@Caption(value = "qty Keluar")
	private Double qtyKeluar;

	public JenisLimbahB3Masuk getJenisLimbahB3Masuk() {
		return jenisLimbahB3Masuk;
	}

	public void setJenisLimbahB3Masuk(JenisLimbahB3Masuk jenisLimbahB3Masuk) {
		this.jenisLimbahB3Masuk = jenisLimbahB3Masuk;
	}

	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}

	public Double getBeratSampahMedis() {
		return beratSampahMedis;
	}

	public void setBeratSampahMedis(Double beratSampahMedis) {
		this.beratSampahMedis = beratSampahMedis;
	}

	public String getWaktu() {
		return waktu;
	}

	public void setWaktu(String waktu) {
		this.waktu = waktu;
	}

	public Ruangan getRuangan() {
		return ruangan;
	}

	public void setRuangan(Ruangan ruangan) {
		this.ruangan = ruangan;
	}

	public Set<MapPegawaiLimbah> getMapPegawaiLimbah() {
		return mapPegawaiLimbah;
	}

	public void setMapPegawaiLimbah(Set<MapPegawaiLimbah> mapPegawaiLimbah) {
		this.mapPegawaiLimbah = mapPegawaiLimbah;
	}

	public Integer getMaksimalPenyimpanan() {
		return maksimalPenyimpanan;
	}

	public void setMaksimalPenyimpanan(Integer maksimalPenyimpanan) {
		this.maksimalPenyimpanan = maksimalPenyimpanan;
	}

	public Double getQtyKeluar() {
		return qtyKeluar;
	}

	public void setQtyKeluar(Double qtyKeluar) {
		this.qtyKeluar = qtyKeluar;
	}
}