package com.jasamedika.medifirst2000.entities;

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

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

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

@Getter
@Setter
@Entity
@Table(name = "PegawaiStrukturGajiByJaPe_M")
public class GajiPerJabatanPendidikan extends BaseMaster {

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

	@ManyToOne(fetch = LAZY)
	@NotNull(message = "Jabatan tidak boleh kosong")
	@JoinColumn(name = "KdJabatanFk", nullable = false)
	@Caption(value = "Jabatan")
	private Jabatan jabatan;

	@ManyToOne(fetch = LAZY)
	@NotNull(message = "Pendidikan tidak boleh kosong")
	@JoinColumn(name = "KdPendidikan", nullable = false)
	@Caption(value = "Pendidikan")
	private Pendidikan pendidikan;

	@ManyToOne(fetch = 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;

}
