package com.jasamedika.medifirst2000.entities;

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

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

import static javax.persistence.TemporalType.TIMESTAMP;

@Getter
@Setter
@Entity
@Table(name = "sdm_logbookkinerjadetail_t")
public class LogbookKinerjaDetail extends BaseTransaction {

	private static final long serialVersionUID = -775261066377264716L;

	@Column(name = "namakegiatan", nullable = false)
	@Caption(value = "Nama Kegiatan")
	private String namaKegiatan;

	@Column(name = "capaian", nullable = false)
	@Caption(value = "Capaian")
	private Double capaian;

	@Column(name = "catatan")
	@Caption(value = "Catatan")
	private String catatan;

	@Column(name = "tanggalkegiatan", nullable = false)
	@Caption(value = "Tanggal Kegiatan")
	@Temporal(TIMESTAMP)
	private Date tanggalKegiatan;

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

	@ManyToOne
	@NotNull(message = "Indikator kinerja tidak boleh kosong")
	@JoinColumn(name = "objectlogbookkinerjafk")
	@Caption(value = "Logbook Kinerja")
	private LogbookKinerja logbookKinerja;

	@Column(name = "objectlogbookkinerjafk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String logbookKinerjaId;

}
