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;

/**
 * @author salmanoe
 * @since Mar 9, 2022
 */
@Getter
@Setter
@Entity
@Table(name = "mapprodukkelompokkerja_t")
public class MapProdukKelompokKerja extends BaseTransaction {

	private static final long serialVersionUID = -1207938953500724939L;

	@ManyToOne
	@NotNull(message = "Tindakan tidak boleh kosong")
	@JoinColumn(name = "produkfk")
	@Caption(value = "Tindakan")
	private Produk produk;

	@Column(name = "produkfk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;

	@ManyToOne
	@NotNull(message = "Kelompok kerja tidak boleh kosong")
	@JoinColumn(name = "subunitkerjafk")
	@Caption(value = "Kelompok Kerja")
	private SubUnitKerjaPegawai kelompokKerja;

	@Column(name = "subunitkerjafk", insertable = false, updatable = false, nullable = false)
	private Integer kelompokKerjaId;

}
