package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.Set;

/**
 * class DestroyProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "DestroyProduk_T")
public class DestroyProduk extends BaseTransaction {

	@ManyToOne
	@JoinColumn(name = "ObjectAsalProdukFk")
	@NotNull(message = "Object Asal Produk Harus Diisi")
	@Caption(value = "Object Asal Produk")
	private AsalProduk asalProduk;

	@Column(name = "ObjectAsalProdukFk", insertable = false, updatable = false)
	private Integer asalProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Object Produk Harus Diisi")
	@Caption(value = "Object Produk")
	private Produk produk;

	@Column(name = "ObjectProdukFk", insertable = false, updatable = false)
	private Integer produkId;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	@NotNull(message = "Object Ruangan Harus Diisi")
	@Caption(value = "Object Ruangan")
	private Ruangan ruangan;

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

	@Caption(value = "Keterangan Alasan")
	@Column(name = "KeteranganAlasan", length = 225)
	private String keteranganAlasan;

	@ManyToOne
	@JoinColumn(name = "NoHistoriFk")
	@NotNull(message = "No Histori Harus Diisi")
	@Caption(value = "No Histori")
	private StrukHistori strukHistory;

	@Column(name = "NoHistoriFk", insertable = false, updatable = false)
	private String strukHistoryId;

	@ManyToOne
	@JoinColumn(name = "NoStrukTerimaFk")
	@NotNull(message = "No Struk Terima Harus Diisi")
	@Caption(value = "No Struk Terima")
	private StrukPelayanan strukPelayanan;

	@Column(name = "NoStrukTerimaFk", insertable = false, updatable = false)
	private String strukPelayananId;

	@ManyToOne
	@JoinColumn(name = "NoVerifikasiFk")
	@Caption(value = "No Verifikasi")
	private StrukVerifikasi strukVerifikasi;

	@Column(name = "NoVerifikasiFk", insertable = false, updatable = false)
	private String strukVerifikasiId;

	@Caption(value = "Qty Produk")
	@Column(name = "QtyProduk", nullable = false)
	private Double qtyProduk;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "destroyProduk")
	private Set<DestroyProdukDetail> destroyProdukDetail = new HashSet<>();

}
