package com.jasamedika.medifirst2000.entities;

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;

/**
 * class MapAccountToProdukPelayanan
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapAccountToProdukPelayanan_M")
public class MapAccountToProdukPelayanan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectAccountFk")
	@NotNull(message = "Kd Account tidak boleh kosong")
	@Caption(value = "Object Account")
	private ChartOfAccount account;

	@Column(name = "ObjectAccountFk", insertable = false, updatable = false)
	private Integer accountId;

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenHargaFk")
	@NotNull(message = "Kd Komponen Harga tidak boleh kosong")
	@Caption(value = "Object Komponen Harga")
	private KomponenHarga komponenHarga;

	@Column(name = "ObjectKomponenHargaFk", insertable = false, updatable = false, nullable = false)
	private Integer komponenHargaId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")
	@Caption(value = "Object Produk")
	private Produk produk;

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

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

}