package com.jasamedika.medifirst2000.entities;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

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

import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "Fasilitas_M")
public class FasilitasM extends BaseMaster {

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

	@NotNull(message = "Kd Fasilitas tidak boleh kosong")
	@Column(name = "KdFasilitas", nullable = false)
	@Caption(value = "Kode Fasilitas")
	private Byte kdFasilitas;

	@NotNull(message = "Nama Fasilitas tidak boleh kosong")
	@Column(name = "NamaFasilitas", length = 150)
	@Caption(value = "Nama Fasilitas")
	private String namaFasilitas;

	@NotNull(message = "Report Fasilitas tidak boleh kosong")
	@Column(name = "ReportFasilitas", nullable = false, length = 150)
	@Caption(value = "Report Fasilitas")
	private String reportFasilitas;

	@Column(name = "DeskripsiDetailFasilitas", length = 1000)
	@Caption(value = "Deskripsi Detail Fasilitas")
	private String deskirpsiDetailFasilitas;

	@Column(name = "PathFileGambar1", length = 300)
	@Caption(value = "Path File Gambar 1")
	private String pathFileGambar1;

	@Column(name = "PathFileGambar2", length = 300)
	@Caption(value = "Path File Gambar 2")
	private String pathFileGambar2;

	@Column(name = "PathFileGambar3", length = 300)
	@Caption(value = "Path File Gambar 3")
	private String pathFileGambar3;

	@Column(name = "PathFileGambar4", length = 300)
	@Caption(value = "Path File Gambar 4")
	private String pathFileGambar4;

	@Column(name = "FileGambar1")
	@Caption(value = "File Gambar 1")
	private String fileGambar1;

	@Column(name = "FileGambar2")
	@Caption(value = "File Gambar 2")
	private String fileGambar2;

	@Column(name = "FileGambar3")
	@Caption(value = "File Gambar 3")
	private String fileGambar3;

	@Column(name = "KdFasilitasHead", nullable = false)
	@Caption(value = "Kode Fasilitas Head")
	private Byte kdFasilitasHead;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "KdJenisProduk")
	@Caption(value = "Kode Jenis Produk")
	private JenisProduk kdJenisProduk;

	@Column(name = "KdJenisProduk", insertable = false, updatable = false)
	private Integer kdJenisProdukId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "KdPegawaiJawab")
	@Caption(value = "Kode Pegawai Jawab")
	private Pegawai kdPegawaiPJawab;

	@Column(name = "KdPegawaiJawab", insertable = false, updatable = false)
	private Integer kdPegawaiJawabId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "KdRuangan")
	@Caption(value = "Kode Ruangan")
	private Ruangan kdRuangan;

	@Column(name = "KdRuangan", insertable = false, updatable = false)
	private Integer kdRuanganId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "KdKelas")
	@Caption(value = "Kode Kelas")
	private Kelas kdKelas;

	@Column(name = "KdKelas", insertable = false, updatable = false)
	private Integer kdKelasId;

	@Column(name = "QtyFasilitas")
	@Caption(value = "Qty Fasilitas")
	private Integer qtyFasilitas;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "KdDepartemen")
	@Caption(value = "Kode Departemen")
	private Departemen kdDepartemen;

	@Column(name = "KdDepartemen", insertable = false, updatable = false)
	private Integer kdDepartemenId;

}
