package com.jasamedika.medifirst2000.entities;

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

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class HargaNettoDiscPasienPulang
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "HargaNettoDiscPasienPulang_M")
public class HargaNettoDiscPasienPulang extends BaseMaster {

	@Column(name = "HargaDiscount")
	@Caption(value = "Harga Discount")
	private Double hargaDiscount;

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenHargaFk")
	@NotNull(message = "Kd Komponen Harga tidak boleh kosong")
	@Caption(value = "Object Komponen Harga")
	private KomponenHarga komponenHarga;

	@Column(name = "ObjectKomponenHargaFk", insertable = false, updatable = false)
	private Integer komponenHargaId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")
	@Caption(value = "Object Produk")
	private Produk produk;

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

	@ManyToOne
	@JoinColumn(name = "ObjectRangeFk")
	@NotNull(message = "Kd Range tidak boleh kosong")

	@Caption(value = "Object Range")
	private Range range;

	@Column(name = "ObjectRangeFk", insertable = false, updatable = false, nullable = false)
	private Integer rangeId;

	@NotNull(message = "Persen Discount tidak boleh kosong")
	@Column(name = "PersenDiscount", nullable = false)
	@Caption(value = "Persen Discount")
	private Double persenDiscount;

	@Column(name = "TglBerlakuAkhir")
	@Caption(value = "Tanggal Berlaku Akhir")
	private Date tglBerlakuAkhir;

	@NotNull(message = "Tgl Berlaku Awal tidak boleh kosong")
	@Column(name = "TglBerlakuAwal", nullable = false)
	@Caption(value = "Tanggal Berlaku Awal")
	private Date tglBerlakuAwal;

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "public.harganettodiscpasienpulang_m_id_seq")
	@SequenceGenerator(name = "public.harganettodiscpasienpulang_m_id_seq", sequenceName = "public.harganettodiscpasienpulang_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

}