package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Getter
@Setter
@Entity
@DynamicUpdate
@Table(name = "Bowidick_T")
public class Bowidick extends BaseTransaction {

	@Column(name = "Tanggal")
	@Caption(value = "Tanggal")
	private Date tanggal;

	@ManyToOne
	@JoinColumn(name = "ObjectMesinFk")
	@NotNull(message = "Mesin tidak boleh kosong")
	@Caption(value = "Object Mesin")
	private Mesin mesin;

	@Column(name = "ObjectMesinFk", insertable = false, updatable = false, nullable = false)
	private Integer mesinId;

	@Column(name = "ProgramMesin")
	@Caption(value = "Program Mesin")
	private String programMesin;

	@Column(name = "Suhu")
	@Caption(value = "Suhu")
	private String suhu;

	@Column(name = "Hasil")
	@Caption(value = "Hasil")
	private String hasil;

	@ManyToOne
	@JoinColumn(name = "ObjectSupervisorFk")
	@NotNull(message = "Supervisor tidak boleh kosong")
	@Caption(value = "Object Supervisor")
	private Pegawai supervisor;

	@Column(name = "ObjectSupervisorFk", insertable = false, updatable = false)
	private Integer supervisorId;

	@ManyToOne
	@JoinColumn(name = "ObjectOperatorFk")
	@NotNull(message = "Operator tidak boleh kosong")
	@Caption(value = "Object Operator")
	private Pegawai operator;

	@Column(name = "ObjectOperatorFk", insertable = false, updatable = false, nullable = false)
	private Integer operatorId;

	@ManyToOne
	@JoinColumn(name = "ObjectPencataanSuhuMesinFk")
	private PencatatanSuhuMesin pencatatanSuhuMesin;

	@Column(name = "ObjectPencataanSuhuMesinFk", insertable = false, updatable = false, nullable = false)
	private String pencatatanSuhuMesinId;

	@Column(name = "Keterangan", length = 50)
	private String keterangan;

}
