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.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class KelompokProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KelompokProduk_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class KelompokProduk extends BaseMaster {

	@Caption(value = "Is Having Price")
	private Byte isHavingPrice;

	@Caption(value = "Is Having Stok")
	private Byte isHavingStok;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Object Departemen Harus Diisi")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectJenisTransaksiFk")
	@Caption(value = "Object Jenis Transaksi")
	private JenisTransaksi jenisTransaksi;

	@Column(name = "ObjectJenisTransaksiFk", insertable = false, updatable = false)
	private Integer jenisTransaksiId;

	@Caption(value = "Kode Kelompok Produk")
	private Byte kdKelompokProduk;

	@Caption(value = "Kelompok Produk")
	private String kelompokProduk;

	@Caption(value = "QKelompok Produk")
	private Byte qKelompokProduk;

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

}