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;

/**
 * class AsuransiPasienBerlaku
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "AsuransiPasienBerlaku_M")
public class AsuransiPasienBerlaku extends BaseMaster {

	@NotNull(message = "Is Collective Plafon tidak boleh kosong")
	@Column(name = "isCollectivePlafon", nullable = false)
	@Caption(value = "Is Collective Plafon")
	private Byte isCollectivePlafon;

	@ManyToOne
	@JoinColumn(name = "ObjectHubunganPesertaFk")
	@NotNull(message = "Kd Hubungan Peserta tidak boleh kosong")
	@Caption(value = "Object Hubungan Peserta")
	private HubunganPesertaAsuransi hubunganPeserta;

	@Column(name = "ObjectHubunganPesertaFk", insertable = false, updatable = false)
	private Integer hubunganPesertaId;

	@NotNull(message = "Kd Penjamin Pasien tidak boleh kosong")
	@Column(name = "KdPenjaminPasien", nullable = false)
	@Caption(value = "Kode Penjamin Pasien")
	private short kdPenjaminPasien;

	@NotNull(message = "No Asuransi tidak boleh kosong")
	@Column(name = "NoAsuransi", nullable = false, length = 30)
	@Caption(value = "No Asuransi")
	private String noAsuransi;

	@Column(name = "TglAkhirBerlaku")
	@Caption(value = "Tanggal Akhir Berlaku")
	private Date tglAkhirBerlaku;

	@NotNull(message = "Tgl Mulai Berlaku tidak boleh kosong")
	@Column(name = "TglMulaiBerlaku", nullable = false)
	@Caption(value = "Tanggal Mulai Berlaku")
	private Date tglMulaiBerlaku;

	@NotNull(message = "Total Current Terpakai tidak boleh kosong")
	@Column(name = "TotalCurrentTerpakai", nullable = false)
	@Caption(value = "Total Current Terpakai")
	private Double totalCurrentTerpakai;

	@NotNull(message = "Total Plafon Tanggungan tidak boleh kosong")
	@Column(name = "TotalPlafonTanggungan", nullable = false)
	@Caption(value = "Total Plafon Tanggungan")
	private Double totalPlafonTanggungan;

	@NotNull(message = "Total Saldo Tanggungan tidak boleh kosong")
	@Column(name = "TotalSaldoTanggungan", nullable = false)
	@Caption(value = "Total Saldo Tanggungan")
	private Double totalSaldoTanggungan;

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

}