package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "JadwalPraktikDokter_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class JadwalPraktikDokter extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectJadwalPraktekFk")
	@NotNull(message = "Kd Jadwal Praktek tidak boleh kosong")
	@Caption(value = "Object JadwalPraktek")
	private JadwalPraktek jadwalPraktek;

	@Column(name = "ObjectJadwalPraktekFk", insertable = false, updatable = false, nullable = false)
	private Integer jadwalPraktekId;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	@NotNull(message = "Kd ruangan tidak boleh kosong")
	@Caption(value = "Object Ruangan")
	private Ruangan ruangan;

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

	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiFk")
	@NotNull(message = "Kd pegawai tidak boleh kosong")
	@Caption(value = "Object Pegawai")
	private Pegawai dokter;

	@Column(name = "ObjectPegawaiFk", insertable = false, updatable = false, nullable = false)
	private Integer dokterId;

	@ManyToOne
	@JoinColumn(name = "ObjectHariFk")
	@NotNull(message = "Kd hari tidak boleh kosong")
	@Caption(value = "Object hari")
	private Hari hari;

	@Column(name = "ObjectHariFk", insertable = false, updatable = false, nullable = false)
	private Integer hariId;

	@Column(name = "Quota")
	@Caption(value = "Quota")
	private Integer quota;

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

}