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.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

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

@Entity
@Table(name = "PegawaiStrukturGajiByMaKaPe_M")
public class GajiPerMasaKerjaPendidikan extends BaseMaster {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.gaji_per_masa_kerja_pendidikan_m_id_seq")
	@SequenceGenerator(name = "public.gaji_per_masa_kerja_pendidikan_m_id_seq", sequenceName = "public.gaji_per_masa_kerja_pendidikan_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	private Integer id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@NotNull(message = "Detail Kategory Pegawai tidak boleh kosong")
	@JoinColumn(name = "KdDetailKategoryPegawaiFk", nullable = false)
	@Caption("Detail Kategory Pegawai")
	private DetailKategoryPegawai detailKategoryPegawai;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@NotNull(message = "Kode Pendidikan tidak boleh kosong")
	@JoinColumn(name = "KdPendidikanFk", nullable = false)
	@Caption("Pendidikan")
	private Pendidikan pendidikan;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@NotNull(message = "Range Masa Kerja tidak boleh kosong")
	@JoinColumn(name = "KdRangeMasaKerjaFk", nullable = false)
	@Caption("Range Masa Kerja")
	private Range range;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@NotNull(message = "Komponen Harga tidak boleh kosong")
	@JoinColumn(name = "KdKomponenHargaFk", nullable = false)
	@Caption(value = "Komponen Harga")
	private KomponenHarga komponenHarga;
	
	@NotNull(message = "Harga Satuan tidak boleh kosong")
	@Column(name = "HargaSatuan", nullable = false)
	@Caption(value = "Harga Satuan")
	private float hargaSatuan;
	
	@NotNull(message = "Factor Rate tidak boleh kosong")
	@Column(name = "FactorRate", nullable = false)
	@Caption(value = "Factor Rate")
	private long factorRate;
	
	@NotNull(message = "Operator Factor Rate tidak boleh kosong")
	@Column(name = "OperatorFactorRate", length = 1, nullable = false)
	@Caption(value = "Operator Factor Rate")
	private String operatorFactorRate;

	public Integer getId() {
		return id;
	}

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

	public DetailKategoryPegawai getDetailKategoryPegawai() {
		return detailKategoryPegawai;
	}

	public void setDetailKategoryPegawai(DetailKategoryPegawai detailKategoryPegawai) {
		this.detailKategoryPegawai = detailKategoryPegawai;
	}

	public Pendidikan getPendidikan() {
		return pendidikan;
	}

	public void setPendidikan(Pendidikan pendidikan) {
		this.pendidikan = pendidikan;
	}

	public Range getRange() {
		return range;
	}

	public void setRange(Range range) {
		this.range = range;
	}

	public KomponenHarga getKomponenHarga() {
		return komponenHarga;
	}

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

	public float getHargaSatuan() {
		return hargaSatuan;
	}

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

	public long getFactorRate() {
		return factorRate;
	}

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

	public String getOperatorFactorRate() {
		return operatorFactorRate;
	}

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

}
