package com.jasamedika.medifirst2000.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

/**
 * @author salmanoe
 * @since Jun 20, 2022
 * 
 */
@Entity
@Table(name = "pelayananfarmakologi_t")
public class PelayananFarmakologi extends BaseTransaction {
	
	private static final long serialVersionUID = 778638186623894491L;

	@ManyToOne(fetch = FetchType.LAZY)
	@NotNull(message = "Produk Farmakologi tidak boleh kosong")
	@JoinColumn(name = "objectprodukfarmakologifk")
	@Caption(value = "Produk Farmakologi")
	private ProdukFarmakologi produk;

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

	@Column(name = "tglpelayanan", nullable = false)
	@Caption(value = "Tanggal Pelayanan")
	@Temporal(TemporalType.TIMESTAMP)
	private Date tglPelayanan;

	@Column(name = "skor", nullable = false)
	@Caption(value = "Nilai Skor")
	private Double skor;

	@Column(name = "jumlah", nullable = false)
	@Caption(value = "Jumlah")
	private Double jumlah;

	@Column(name = "catatan", nullable = true)
	@Caption(value = "Catatan")
	private String catatan;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "objectpegawaifk")
	@Caption(value = "Pegawai")
	private Pegawai pegawai;

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

	public ProdukFarmakologi getProduk() {
		return produk;
	}

	public void setProduk(ProdukFarmakologi produk) {
		this.produk = produk;
	}

	public Integer getProdukId() {
		return produkId;
	}

	public void setProdukId(Integer produkId) {
		this.produkId = produkId;
	}

	public Date getTglPelayanan() {
		return tglPelayanan;
	}

	public void setTglPelayanan(Date tglPelayanan) {
		this.tglPelayanan = tglPelayanan;
	}

	public Double getSkor() {
		return skor;
	}

	public void setSkor(Double skor) {
		this.skor = skor;
	}

	public Double getJumlah() {
		return jumlah;
	}

	public void setJumlah(Double jumlah) {
		this.jumlah = jumlah;
	}

	public String getCatatan() {
		return catatan;
	}

	public void setCatatan(String catatan) {
		this.catatan = catatan;
	}

	public Pegawai getPegawai() {
		return pegawai;
	}

	public void setPegawai(Pegawai pegawai) {
		this.pegawai = pegawai;
	}

	public Integer getPegawaiId() {
		return pegawaiId;
	}

	public void setPegawaiId(Integer pegawaiId) {
		this.pegawaiId = pegawaiId;
	}

}
