package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "IpsrsPreventiveMaintenance_T")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class IpsrsPreventiveMaintenance extends BaseTransaction{
	
	@ManyToOne(fetch = FetchType.LAZY)
	@Caption(value = "Registrasi Aset")
	@JoinColumn(name = "ObjectRegistrasiAsetFk")
	private RegistrasiAset registrasiAset;
	
	@Column(name = "ObjectRegistrasiAsetFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String registrasiAsetId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@Caption(value = "Pegawai")
	@JoinColumn(name = "ObjectPegawaiFk")
	private Pegawai pegawai;
	
	@Column(name = "ObjectPegawaiFk", insertable = false, updatable = false)
	private Integer pegawaiId;
	
	@Caption(value = "Tanggal")
	@Column(name = "Tanggal", nullable = false)
	private String tanggal;
	
	@Caption(value = "Teknisi Pendamping")
	@Column(name = "TeknisiPendamping", nullable = true)
	private String teknisiPendamping;
	
	@Caption(value = "Catatan")
	@Column(name = "Catatan", nullable = true)
	private String catatan;
	
	@JsonBackReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "ipsrsPreventiveMaintenance")
	private Set<IpsrsPemeriksaan> ipsrsPemeriksaan = new HashSet<>();
	
	@Caption(value = "Kebutuhan Alat Catu Tegangan")
	@Column(name = "KebutuhanAlatCatuTegangan", nullable = true)
	private Float kebutuhanAlatCatuTegangan;
	
	@Caption(value = "Kebutuhan Alat Temperatur Ruangan")
	@Column(name = "KebutuhanAlatTemperaturRuangan", nullable = true)
	private Float kebutuhanAlatTemperaturRuangan;
	
	@Caption(value = "Kebutuhan Alat Kelembaban Ruangan")
	@Column(name = "KebutuhanAlatKelembabanRuangan", nullable = true)
	private Float kebutuhanAlatKelembabanRuangan;
	
	@Caption(value = "Terukur Catu Tegangan")
	@Column(name = "TerukurCatuTegangan", nullable = true)
	private Float terukurCatuTegangan;
	
	@Caption(value = "Terukur Temperatur Ruangan")
	@Column(name = "TerukurTemperaturRuangan", nullable = true)
	private Float terukurTemperaturRuangan;
	
	@Caption(value = "Terukur Kelembaban Ruangan")
	@Column(name = "TerukurKelembabanRuangan", nullable = true)
	private Float terukurKelembabanRuangan;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@Caption(value = "Rekanan")
	@JoinColumn(name = "ObjectRekananFk")
	private Rekanan rekanan;
	
	@Column(name = "ObjectRekananFk", nullable=true, insertable = false, updatable = false)
	private Integer rekananId;
	
	@Caption(value = "Teknisi Luar")
	@Column(name = "TeknisiLuar", nullable = true)
	private String teknisiLuar;
	
	@Caption(value = "Jenis Preventive")
	@Column(name = "JenisPreventive", nullable = true)
	private String jenisPreventive;
	
	@Caption(value = "Jenis Penjadwalan")
	@Column(name = "JenisPenjadwalan", nullable = true)
	private Integer jenisPenjadwalan;
	
	@Caption(value = "NoRec Penjadwalan")
	@Column(name = "NoRecPenjadwalan", nullable = true)
	private String noRecPenjadwalan;
	
	@Caption(value = "TglPreventive")
	@Column(name = "TglPreventive", nullable = true)
	private Date tglPreventive;

	public RegistrasiAset getRegistrasiAset() {
		return registrasiAset;
	}

	public void setRegistrasiAset(RegistrasiAset registrasiAset) {
		this.registrasiAset = registrasiAset;
	}

	public String getRegistrasiAsetId() {
		return registrasiAsetId;
	}

	public void setRegistrasiAsetId(String registrasiAsetId) {
		this.registrasiAsetId = registrasiAsetId;
	}

	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;
	}

	public String getTanggal() {
		return tanggal;
	}

	public void setTanggal(String tanggal) {
		this.tanggal = tanggal;
	}

	public String getTeknisiPendamping() {
		return teknisiPendamping;
	}

	public void setTeknisiPendamping(String teknisiPendamping) {
		this.teknisiPendamping = teknisiPendamping;
	}

	public String getCatatan() {
		return catatan;
	}

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

	public Set<IpsrsPemeriksaan> getIpsrsPemeriksaan() {
		return ipsrsPemeriksaan;
	}

	public void setIpsrsPemeriksaan(Set<IpsrsPemeriksaan> ipsrsPemeriksaan) {
		this.ipsrsPemeriksaan = ipsrsPemeriksaan;
	}

	public Float getKebutuhanAlatCatuTegangan() {
		return kebutuhanAlatCatuTegangan;
	}

	public void setKebutuhanAlatCatuTegangan(Float kebutuhanAlatCatuTegangan) {
		this.kebutuhanAlatCatuTegangan = kebutuhanAlatCatuTegangan;
	}

	public Float getKebutuhanAlatTemperaturRuangan() {
		return kebutuhanAlatTemperaturRuangan;
	}

	public void setKebutuhanAlatTemperaturRuangan(Float kebutuhanAlatTemperaturRuangan) {
		this.kebutuhanAlatTemperaturRuangan = kebutuhanAlatTemperaturRuangan;
	}

	public Float getKebutuhanAlatKelembabanRuangan() {
		return kebutuhanAlatKelembabanRuangan;
	}

	public void setKebutuhanAlatKelembabanRuangan(Float kebutuhanAlatKelembabanRuangan) {
		this.kebutuhanAlatKelembabanRuangan = kebutuhanAlatKelembabanRuangan;
	}

	public Float getTerukurCatuTegangan() {
		return terukurCatuTegangan;
	}

	public void setTerukurCatuTegangan(Float terukurCatuTegangan) {
		this.terukurCatuTegangan = terukurCatuTegangan;
	}

	public Float getTerukurTemperaturRuangan() {
		return terukurTemperaturRuangan;
	}

	public void setTerukurTemperaturRuangan(Float terukurTemperaturRuangan) {
		this.terukurTemperaturRuangan = terukurTemperaturRuangan;
	}

	public Float getTerukurKelembabanRuangan() {
		return terukurKelembabanRuangan;
	}

	public void setTerukurKelembabanRuangan(Float terukurKelembabanRuangan) {
		this.terukurKelembabanRuangan = terukurKelembabanRuangan;
	}

	public Rekanan getRekanan() {
		return rekanan;
	}

	public void setRekanan(Rekanan rekanan) {
		this.rekanan = rekanan;
	}

	public Integer getRekananId() {
		return rekananId;
	}

	public void setRekananId(Integer rekananId) {
		this.rekananId = rekananId;
	}

	public String getTeknisiLuar() {
		return teknisiLuar;
	}

	public void setTeknisiLuar(String teknisiLuar) {
		this.teknisiLuar = teknisiLuar;
	}

	public String getJenisPreventive() {
		return jenisPreventive;
	}

	public void setJenisPreventive(String jenisPreventive) {
		this.jenisPreventive = jenisPreventive;
	}

	public Integer getJenisPenjadwalan() {
		return jenisPenjadwalan;
	}

	public void setJenisPenjadwalan(Integer jenisPenjadwalan) {
		this.jenisPenjadwalan = jenisPenjadwalan;
	}

	public String getNoRecPenjadwalan() {
		return noRecPenjadwalan;
	}

	public void setNoRecPenjadwalan(String noRecPenjadwalan) {
		this.noRecPenjadwalan = noRecPenjadwalan;
	}

	public Date getTglPreventive() {
		return tglPreventive;
	}

	public void setTglPreventive(Date tglPreventive) {
		this.tglPreventive = tglPreventive;
	}

	
}
