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.Date;

import static javax.persistence.FetchType.LAZY;

@Getter
@Setter
@Entity
@Table(name = "HistoriPelayananCs_T")
public class HistoriPelayananCs extends BaseTransaction {

	@Caption(value = "No Histori")
	@Column(name = "NoHistori", length = 10, nullable = false)
	private String noHistori;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectRuanganTujuanFk")
	@NotNull(message = "Kd ruangan tidak boleh kosong")
	@Caption(value = "Object Ruangan Tujuan")
	private Ruangan ruanganTujuan;

	@Column(name = "ObjectRuanganTujuanFk", insertable = false, updatable = false, nullable = false)
	private Integer ruanganTujuanId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectPegawaiTujuanFk")
	@NotNull(message = "Kd pegawai Tujuan tidak boleh kosong")
	@Caption(value = "Object Pegawai Tujuan")
	private Pegawai pegawaiTujuan;

	@Column(name = "ObjectPegawaiTujuanFk", insertable = false, updatable = false, nullable = false)
	private Integer pegawaiTujuanId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectJenisResponFk")
	@NotNull(message = "Jenis Respon tidak boleh kosong")
	@Caption(value = "Object Jenis Respon")
	private JenisRespon jenisRespon;

	@Column(name = "ObjectJenisResponFk", insertable = false, updatable = false, nullable = false)
	private Integer jenisResponId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKelompokTransaksiFk")
	@Caption(value = "Object Kelompok Transaksi")
	private KelompokTransaksi kelompokTransaksi;

	@Column(name = "ObjectKelompokTransaksiFk", insertable = false, updatable = false)
	private Integer kelompokTransaksiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKomunikasiFk")
	@Caption(value = "Object Komunikasi")
	private Komunikasi komunikasi;

	@Column(name = "ObjectKomunikasiFk", insertable = false, updatable = false)
	private Integer komunikasiId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "NoCMFk")
	@Caption(value = "No CM")
	private Pasien noCM;

	@Column(name = "NoCMFk", insertable = false, updatable = false)
	private Integer NoCMId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectAlamatCustomerFk")
	@Caption(value = "Object Alamat Customer")
	private Alamat alamatCustomer;

	@Column(name = "ObjectAlamatCustomerFk", insertable = false, updatable = false)
	private Integer ObjectAlamatCustomerId;

	@Column(name = "ObjectAlamatCsId")
	private Integer ObjectAlamatCsId;

	@Column(name = "DetailRespon")
	@Caption(value = "Detail Respon")
	private String detailRespon;

	@Column(name = "Deskripsi")
	@Caption(value = "Deskripsi")
	private String deskripsi;

	@Caption(value = "Tgl Pelayanan Awal")
	@Column(name = "TglPelayananAwal")
	private Date tglPelayananAwal;

	@Caption(value = "Tgl Pelayanan Akhir")
	@Column(name = "TglPelayananAkhir")
	private Date tglPelayananAkhir;

	@Column(name = "Keterangan")
	@Caption(value = "Keterangan")
	private String keterangan;

	@Caption(value = " Kode Produk")
	@Column(name = "kdProduk")
	private Integer kdProduk;

	@Caption(value = "Nama Customer")
	@Column(name = "NamaCustomer", nullable = false, length = 80)
	private String namaCustomer;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectJenisKelaminFk")
	@Caption(value = "Object Jenis Kelamin")
	private JenisKelamin kelamin;

	@Column(name = "ObjectJenisKelaminFk", insertable = false, updatable = false)
	private Integer jenisKelaminId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKelompokProdukFk")
	@Caption(value = "Object Kelompok Produk")
	private KelompokProduk kelompokProduk;

	@Column(name = "ObjectKelompokProdukFk", insertable = false, updatable = false)
	private Integer kelompokProdukId;

	@Caption(value = "Tgl Lahir")
	@Column(name = "TglLahir")
	private Date tglLahir;

	@Caption(value = "Is Cito")
	@Column(name = "IsCito")
	private Integer isCito;

	@Caption(value = "Is Pelayanan")
	@Column(name = "IsPelayanan")
	private Integer isPelayanan;

}
