package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseActive;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import static javax.persistence.FetchType.LAZY;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 24/04/2024
 */
@Getter
@Setter
@Entity
@Table(name = "m_ruangan_jenis_layanan_remun_medis", schema = "remun")
public class RuanganJenisLayananRemunMedis extends BaseActive {

	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	@Column(name = "no_rec", columnDefinition = "CHAR(32)", unique = true)
	protected String noRec;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "id_ruangan", nullable = false)
	@NotNull(message = "Ruangan tidak boleh kosong")
	@Caption(value = "Ruangan")
	private Ruangan ruangan;

	@Column(name = "id_ruangan", insertable = false, updatable = false, nullable = false)
	private Integer ruanganId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "id_jenis_layanan", nullable = false)
	@NotNull(message = "Jenis layanan tidak boleh kosong")
	@Caption(value = "Jenis Layanan Remun Medis")
	private JenisLayananRemunMedis jenisLayanan;

	@Column(name = "id_jenis_layanan", insertable = false, updatable = false, nullable = false)
	private Long jenisLayananId;
}
