package com.jasamedika.medifirst2000.entities;

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

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

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

import lombok.Getter;
import lombok.Setter;

/**
 * @author Salman Manoe
 * @version 1.0.0
 * @since 07 Sep 2023
 */
@Getter
@Setter
@Entity
@Table(name = "sayatan_operasi_m")
public class Sayatan extends BaseMaster {

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

	@Column(name = "nama_sayatan")
	@Caption(value = "Nama Sayatan")
	private String nama;

	@Column(name = "urutan_sayatan")
	@Caption(value = "Urutan Sayatan")
	private Integer urutan;

	@Column(name = "jumlah_persen")
	@Caption(value = "Jumlah Persen")
	private Double persen;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objectpegawaifk")
	@Caption(value = "Pegawai")
	private Pegawai pegawai;

	@Column(name = "objectpegawaifk", insertable = false, updatable = false)
	private Integer pegawaiId;

	@Column(name = "tglinput")
	@Caption(value = "Tanggal Input")
	private Date tglInput;

}
