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 java.util.Date;

import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "AdvokasiHukumMedicolegal_M")
public class AdvokasiHukumMedicolegal extends BaseMaster {

	@Column(name = "noKasus")
	@Caption(value = "No Kasus")
	private String noKasus;

	@Column(name = "tglKasus")
	@Caption(value = "Tanggal Kasus")
	private Date tglKasus;

	@ManyToOne
	@JoinColumn(name = "ObjectUserFk")
	@NotNull(message = "User tidak boleh kosong")
	@Caption(value = "Kajian Evaluasi")
	private Pegawai user;

	@Column(name = "ObjectUserFk", insertable = false, updatable = false, nullable = false)
	private Integer userId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKasusFk")
	@NotNull(message = "Jenis Kasus tidak boleh kosong")
	@Caption(value = "Jenis Kasus")
	private JenisKasusMedicolegal jenisKasus;

	@Column(name = "ObjectJenisKasusFk", insertable = false, updatable = false, nullable = false)
	private Integer jenisKasusId;

	@Column(name = "deskripsiKasus")
	@Caption(value = "Deskripsi Kasus")
	private String deskripsiKasus;

	@ManyToOne
	@JoinColumn(name = "ObjectPenanggungJawabFk")
	@NotNull(message = "Penanggung Jawab tidak boleh kosong")
	@Caption(value = "Penanggung Jawab")
	private Pegawai penanggungJawab;

	@Column(name = "ObjectPenanggungJawabFk", insertable = false, updatable = false, nullable = false)
	private Integer penanggungJawabId;

	@Column(name = "analisaKajian")
	@Caption(value = "Analisa Kajian")
	private String analisaKajian;

	@Column(name = "hasilKeputusan")
	@Caption(value = "Hasil Keputusan")
	private String hasilKeputusan;

	@Column(name = "statusKasus")
	@Caption(value = "Status Kasus")
	private String statusKasus;

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

}