package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;

/**
 * class PegawaiSKGaji
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "PegawaiSKGaji_M")
public class PegawaiSKGaji extends BaseMaster {
	@NotNull(message = "Factor Rate tidak boleh kosong")
	@Column(name = "FactorRate", nullable = false)
	@Caption(value = "Factor Rate")
	private Double factorRate;

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

	public Double getFactorRate() {
		return this.factorRate;
	}

	@Column(name = "HargaSatuan", nullable = true)
	@Caption(value = "Harga Satuan")
	private Double hargaSatuan;

	public void setHargaSatuan(Double hargaSatuan) {
		this.hargaSatuan = hargaSatuan;
	}

	public Double getHargaSatuan() {
		return this.hargaSatuan;
	}

	@NotNull(message = "Is By Day tidak boleh kosong")
	@Column(name = "isByDay", nullable = false)
	@Caption(value = "Is By Day")
	private Byte isByDay;

	public void setIsByDay(Byte isByDay) {
		this.isByDay = isByDay;
	}

	public Byte getIsByDay() {
		return this.isByDay;
	}

	@NotNull(message = "Is By Month tidak boleh kosong")
	@Column(name = "isByMonth", nullable = false)
	@Caption(value = "Is By Month")
	private Byte isByMonth;

	public void setIsByMonth(Byte isByMonth) {
		this.isByMonth = isByMonth;
	}

	public Byte getIsByMonth() {
		return this.isByMonth;
	}

	@NotNull(message = "Is By Week tidak boleh kosong")
	@Column(name = "isByWeek", nullable = false)
	@Caption(value = "Is By Week")
	private Byte isByWeek;

	public void setIsByWeek(Byte isByWeek) {
		this.isByWeek = isByWeek;
	}

	public Byte getIsByWeek() {
		return this.isByWeek;
	}

	@NotNull(message = "Is By Year tidak boleh kosong")
	@Column(name = "isByYear", nullable = false)
	@Caption(value = "Is By Year")
	private Byte isByYear;

	public void setIsByYear(Byte isByYear) {
		this.isByYear = isByYear;
	}

	public Byte getIsByYear() {
		return this.isByYear;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenHargaFk")
	@NotNull(message = "Kd Komponen Harga tidak boleh kosong")

	@Caption(value = "Object Komponen Harga")
	private KomponenHarga komponenHarga;

	public void setKomponenHarga(KomponenHarga komponenHarga) {
		this.komponenHarga = komponenHarga;
	}

	public KomponenHarga getKomponenHarga() {
		return this.komponenHarga;
	}

	@Column(name = "ObjectKomponenHargaFk", insertable = false, updatable = false)
	private Integer komponenHargaId;

	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiFk")
	@NotNull(message = "Kd Pegawai tidak boleh kosong")
	@Caption(value = "Object Pegawai")
	private Pegawai pegawai;

	public void setPegawai(Pegawai pegawai) {
		this.pegawai = pegawai;
	}

	public Pegawai getPegawai() {
		return this.pegawai;
	}

	@Column(name = "ObjectPegawaiFk", insertable = false, updatable = false, nullable = false)
	private Integer pegawaiId;

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

	public void setKeteranganLainnya(String keteranganLainnya) {
		this.keteranganLainnya = keteranganLainnya;
	}

	public String getKeteranganLainnya() {
		return this.keteranganLainnya;
	}

    @ManyToOne
    @JoinColumn(name = "NoSKFk")
    @Caption(value="No S K") 
    private SuratKeputusan noSK;
	
	@Column(name = "NoSKFk", insertable = false, updatable = false)
	private Integer noSKId;

	@Caption(value = "Persen Harga Satuan")
	private Double persenHargaSatuan;
	
	@Column(name = "OperatorFactorRate")
	@Caption(value = "Operator Factor Rate")
	private String operatorFactorRate;

	public void setPersenHargaSatuan(Double persenHargaSatuan) {
		this.persenHargaSatuan = persenHargaSatuan;
	}

	public Double getPersenHargaSatuan() {
		return this.persenHargaSatuan;
	}

	public SuratKeputusan getNoSK() {
		return noSK;
	}

	public void setNoSK(SuratKeputusan noSK) {
		this.noSK = noSK;
	}

	public Integer getNoSKId() {
		return noSKId;
	}

	public void setNoSKId(Integer noSKId) {
		this.noSKId = noSKId;
	}

	public String getOperatorFactorRate() {
		return operatorFactorRate;
	}

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

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

	public Integer getId() {

		return id;
	}

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