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.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "sdm_indikatorkinerja_m")
public class IndikatorKinerja extends BaseMaster {

	@Column(name = "namaindikator", nullable = false)
	@Caption(value = "Nama Indikator")
	private String namaIndikator;

	@ManyToOne
	@NotNull(message = "Satuan indikator tidak boleh kosong")
	@JoinColumn(name = "objectsatuanindikatorfk")
	@Caption(value = "Satuan Indikator")
	private SatuanIndikator satuanIndikator;

	@Column(name = "objectsatuanindikatorfk", insertable = false, updatable = false)
	private Integer satuanIndikatorId;

	@Column(name = "statusverifikasi", nullable = false)
	@Caption(value = "Status Verifikasi")
	private Boolean statusVerifikasi;

	/**
	 * jenisIndikator = 1: Kuantitas, 2: Kualitas, 3: Perilaku
	 */
	@Column(name = "jenisIndikator", nullable = false)
	@Caption(value = "Jenis Indikator")
	private Integer jenisIndikator;

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

}
