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 javax.validation.constraints.Size;
import java.io.Serializable;

import static javax.persistence.FetchType.LAZY;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 24/10/2023
 */
@Getter
@Setter
@Entity
@Table(name = "aturan_pakai_signa_t")
public class AturanPakaiSigna extends BaseTransaction implements Serializable {

	private static final long serialVersionUID = -4925033000498799494L;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "jumlahdosisfk")
	@NotNull(message = "Jumlah dosis tidak boleh kosong")
	@Caption(value = "Jumlah Dosis")
	private JumlahDosis jumlahDosis;

	@Column(name = "jumlahdosisfk", insertable = false, updatable = false, nullable = false)
	private Long jumlahDosisId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "satuandosisfk")
	@NotNull(message = "Satuan dosis tidak boleh kosong")
	@Caption(value = "Satuan Dosis")
	private SatuanDosis satuanDosis;

	@Column(name = "satuandosisfk", insertable = false, updatable = false, nullable = false)
	private Long satuanDosisId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "frekuensipakaiobatfk")
	@NotNull(message = "Frekuensi pakai obat tidak boleh kosong")
	@Caption(value = "Frekuensi Pakai Obat")
	private FrekuensiPakaiObat frekuensiPakaiObat;

	@Column(name = "frekuensipakaiobatfk", insertable = false, updatable = false, nullable = false)
	private Long frekuensiPakaiObatId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "keteranganpakaiobatfk")
	@NotNull(message = "Keterangan pakai obat tidak boleh kosong")
	@Caption(value = "Keterangan Pakai Obat")
	private KeteranganPakaiObat keteranganPakaiObat;

	@Column(name = "keteranganpakaiobatfk", insertable = false, updatable = false, nullable = false)
	private Long keteranganPakaiObatId;

	@Column(length = 1000)
	@Size(max = 1000)
	@Caption("Keterangan Aturan Pakai")
	private String keterangan;

}
