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 static javax.persistence.FetchType.LAZY;

/**
 * @author salmanoe
 * @since Aug 9, 2022
 * 
 */
@Getter
@Setter
@Entity
@Table(name = "t_resep_dokter")
public class ResepDokter extends BaseTransaction {

	private static final long serialVersionUID = 5479407357558365912L;

	@Column(name = "keteranganlainnya", length = 150)
	@Caption(value = "Keterangan Lainnya")
	private String keteranganLainnya;

	@Column(name = "keteranganpakai", length = 150)
	@Caption(value = "Keterangan Pakai")
	private String keteranganPakai;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objectprodukfk")
	@Caption(value = "Produk")
	private Produk produk;

	@Column(name = "objectprodukfk", insertable = false, updatable = false)
	private String produkId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objectruanganfk")
	@Caption(value = "Ruangan")
	private Ruangan ruangan;

	@Column(name = "objectruanganfk", insertable = false, updatable = false)
	private String ruanganId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objectsatuanstandarfk")
	@Caption(value = "Satuan Standard")
	private SatuanStandar satuanStandard;

	@Column(name = "objectsatuanstandarfk", insertable = false, updatable = false)
	private String satuanStandardId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "strukorderfk")
	@Caption(value = "No Order")
	private StrukOrder strukOrder;

	@Column(name = "strukorderfk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String strukOrderId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "jenisobatfk")
	@Caption(value = "Jenis Obat")
	private JenisObat jenisObat;

	@Column(name = "jenisobatfk", insertable = false, updatable = false)
	private String jenisObatId;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "jeniskemasanfk")
	@Caption(value = "Jenis Kemasan")
	private JenisKemasan jenisKemasan;

	@Column(name = "jeniskemasanfk", insertable = false, updatable = false)
	private String jenisKemasanId;

	@Column(name = "isverifikasi")
	@Caption(value = "Status Verifikasi")
	private Boolean isVerifikasi;

	@Column(name = "satuanview", length = 50)
	@Caption(value = "Satuan View")
	private String satuanView;

	@Column(name = "racikanke", length = 10)
	@Caption(value = "No Resep")
	private String racikanKe;

	@Column(name = "namaobat")
	@Caption(value = "Nama Obat")
	private String namaObat;

	@Column(name = "qtyproduk", length = 10)
	@Caption(value = "Jumlah Obat")
	private String qtyProduk;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "aturanpakaifk")
	@Caption(value = "Aturan Pakai")
	private AturanPakai aturanPakai;

	@Column(name = "aturanpakaifk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String aturanPakaiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "aturanpakaisignafk")
	@Caption(value = "Aturan Pakai Signa")
	private AturanPakaiSigna aturanPakaiSigna;

	@Column(name = "aturanpakaisignafk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String aturanPakaiSignaId;
}
