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;

@Getter
@Setter
@Entity
@Table(name = "KartuPengendaliDetail_T")
public class KartuPengendaliDetail extends BaseTransaction {

	@Column(name = "NoUsulan")
	@Caption(value = "No Usulan")
	private String noUsulan;

	@ManyToOne
	@JoinColumn(name = "ObjectKartuPengendalik")
	@NotNull(message = "Kartu Pengendali harus Diisi")
	@Caption(value = "Kartu Pengendali")
	private KartuPengendali kartuPengendali;

	@Column(name = "ObjectKartuPengendalik", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = false)
	private String kartuPengendaliId;

	@ManyToOne
	@JoinColumn(name = "ObjectStrukRekapPemangan")
	@Caption(value = "Kartu Pengendali")
	private StrukRekapPemenang strukRekapPemenang;

	@Column(name = "ObjectStrukRekapPemangan", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String strukRekapPemenangId;

	@ManyToOne
	@JoinColumn(name = "ObjectDetailRupFk")
	@NotNull(message = "Rup harus Diisi ")
	@Caption(value = "Detail Rup")
	private DetailRup detailRup;

	@Column(name = "ObjectDetailRupFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = false)
	private String detailRupId;

	@Column(name = "VolumeBarang")
	@Caption(value = "Volume Barang")
	private float volumeBarang;

	@Caption(value = "Ppn")
	@Column(name = "Ppn")
	private Double ppn;

	@Caption(value = "Harga Satuan Barang")
	@Column(name = "HargaSatuanBarang")
	private Double hargaSatuanBarang;

	@Caption(value = "Total Harga Barang")
	@Column(name = "TotalHargaBarang")
	private Double totalHargaBarang;

	@Caption(value = "Pembulatan")
	@Column(name = "Pembulatan")
	private Double pembulatan;

	@Column(name = "Terbilang")
	@Caption(value = "Terbilang")
	private String terbilang;

	@Caption(value = "Harga Satuan Barang Hps")
	@Column(name = "hargaSatuanBarangHps")
	private Double hargaSatuanBarangHps;

	@Caption(value = "Total Harga Barang Hps")
	@Column(name = "TotalHargaBarangHps")
	private Double totalHargaBarangHps;

	@Caption(value = "PembulatanHps")
	@Column(name = "PembulatanHps")
	private Double pembulatanHps;

	@Column(name = "TerbilangHps")
	@Caption(value = "Terbilang Hps")
	private String terbilangHps;

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

	@ManyToOne
	@JoinColumn(name = "ObjectKartuPengendaliDetailFk")
	@Caption(value = "Kartu Pengendali Detail")
	private KartuPengendaliDetail kartuPengendaliDetail;

	@Column(name = "ObjectKartuPengendaliDetailFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String kartuPengendaliDetailId;

	@ManyToOne
	@JoinColumn(name = "ObjectRekananFk")
	@Caption(value = "Supplier")
	private Rekanan supplier;

	@Column(name = "ObjectRekananFk", insertable = false, updatable = false)
	private Integer supplierId;

	@Caption(value = "Harga Supplier")
	@Column(name = "HargaSupplier")
	private Double hargaSupplier;

	@Column(name = "StatusCode")
	@Caption(value = "Status Code")
	private Integer statusCode;

	@Column(name = "isVerifikasi")
	public String isVerifikasi;

	@Column(name = "isActive")
	public Boolean isActive;

}
