package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

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

@Entity
@Table(name = "Shiftkerja_m")
public class ShiftKerja extends BaseMaster {

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJadwalPraktekFk")
	@Caption(value = "Object JadwalPraktek")
	private JadwalPraktek jadwalPraktek;

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

	@Column(name = "NamaShift", nullable = false, length = 100)
	@Caption(value = "NamaShift")
	private String namaShift;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "JamPraktek")
	@Caption(value = "JamPraktek")
	private JamPraktek jamPraktek;

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

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectKelompokShiftFk")
	@Caption(value = "Kelompok Shift")
	private KelompokShift kelompokShift;

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

	@NotNull(message = "Kd Shift tidak boleh kosong")
	@Column(name = "KdShift", nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Caption(value = "Kode Shift")
	private Byte kdShift;

	@Column(name = "JamMasuk", nullable = true, length = 100)
	@Caption(value = "JamMasuk")
	private String jamMasuk;

	@Column(name = "JamPulang", nullable = true, length = 100)
	@Caption(value = "JamPulang")
	private String jamPulang;

	@Column(name = "JamBreakAkhir", nullable = true, length = 5)
	@Caption(value = "Jam Break Akhir")
	private String jamBreakAkhir;

	@Column(name = "JamBreakAwal", nullable = true, length = 5)
	@Caption(value = "Jam Break Awal")
	private String jamBreakAwal;

	@Column(name = "FactorRate")
	@Caption(value = "Factor Rate")
	private Float factorRate;

	@Column(name = "OperatorFactorRate")
	@Caption(value = "Operator Factor Rate")
	private String operatorFactorRate;

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenIndex")
	@Caption(value = "Komponen Index")
	private KomponenIndex komponenIndex;

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

	@Column(name = "QShift")
	@Caption(value = "Kode Shift")
	private Integer qShift;
	
	@Column(name = "waktuIstirahat", nullable = true, length = 100)
	@Caption(value = "waktuIstirahat")
	private Long waktuIstirahat;
	
	@Column(name = "flagKetidakhadiran")
	@Caption(value = "flagKetidakhadiran")
	private Boolean flagKetidakhadiran;

	public Long getWaktuIstirahat() {
		return waktuIstirahat;
	}

	public void setWaktuIstirahat(Long waktuIstirahat) {
		this.waktuIstirahat = waktuIstirahat;
	}

	public JadwalPraktek getJadwalPraktek() {
		return jadwalPraktek;
	}

	public void setJadwalPraktek(JadwalPraktek jadwalPraktek) {
		this.jadwalPraktek = jadwalPraktek;
	}

	public Integer getJadwalPraktekId() {
		return jadwalPraktekId;
	}

	public void setJadwalPraktekId(Integer jadwalPraktekId) {
		this.jadwalPraktekId = jadwalPraktekId;
	}

	public String getNamaShift() {
		return namaShift;
	}

	public void setNamaShift(String namaShift) {
		this.namaShift = namaShift;
	}

	public JamPraktek getJamPraktek() {
		return jamPraktek;
	}

	public void setJamPraktek(JamPraktek jamPraktek) {
		this.jamPraktek = jamPraktek;
	}

	public Integer getJamPraktekId() {
		return jamPraktekId;
	}

	public void setJamPraktekId(Integer jamPraktekId) {
		this.jamPraktekId = jamPraktekId;
	}

	public KelompokShift getKelompokShift() {
		return kelompokShift;
	}

	public void setKelompokShift(KelompokShift kelompokShift) {
		this.kelompokShift = kelompokShift;
	}

	public Integer getKelompokShiftId() {
		return kelompokShiftId;
	}

	public void setKelompokShiftId(Integer kelompokShiftId) {
		this.kelompokShiftId = kelompokShiftId;
	}

	public Byte getKdShift() {
		return kdShift;
	}

	public void setKdShift(Byte kdShift) {
		this.kdShift = kdShift;
	}

	public String getJamMasuk() {
		return jamMasuk;
	}

	public void setJamMasuk(String jamMasuk) {
		this.jamMasuk = jamMasuk;
	}

	public String getJamPulang() {
		return jamPulang;
	}

	public void setJamPulang(String jamPulang) {
		this.jamPulang = jamPulang;
	}

	public String getJamBreakAkhir() {
		return jamBreakAkhir;
	}

	public void setJamBreakAkhir(String jamBreakAkhir) {
		this.jamBreakAkhir = jamBreakAkhir;
	}

	public String getJamBreakAwal() {
		return jamBreakAwal;
	}

	public void setJamBreakAwal(String jamBreakAwal) {
		this.jamBreakAwal = jamBreakAwal;
	}

	public Float getFactorRate() {
		return factorRate;
	}

	public void setFactorRate(Float factorRate) {
		this.factorRate = factorRate;
	}

	public String getOperatorFactorRate() {
		return operatorFactorRate;
	}

	public void setOperatorFactorRate(String operatorFactorRate) {
		this.operatorFactorRate = operatorFactorRate;
	}

	public KomponenIndex getKomponenIndex() {
		return komponenIndex;
	}

	public void setKomponenIndex(KomponenIndex komponenIndex) {
		this.komponenIndex = komponenIndex;
	}

	public Integer getKomponenIndexId() {
		return komponenIndexId;
	}

	public void setKomponenIndexId(Integer komponenIndexId) {
		this.komponenIndexId = komponenIndexId;
	}

	public Integer getqShift() {
		return qShift;
	}

	public void setqShift(Integer qShift) {
		this.qShift = qShift;
	}

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

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Boolean getFlagKetidakhadiran() {
		return flagKetidakhadiran;
	}

	public void setFlagKetidakhadiran(Boolean flagKetidakhadiran) {
		this.flagKetidakhadiran = flagKetidakhadiran;
	}

}