package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "PostingJurnalTransaksi_T")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class PostingJurnalTransaksi {

	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	@Column(columnDefinition = "CHAR(32)", unique = true)
	@Id
	public String noRec;

	@Caption(value = "Kd Profile")
	@Column(name = "KdProfile", nullable = true)
	private Integer kdProfile;

	@Caption(value = "No Posting")
	@Column(name = "NoPosting", nullable = true)
	private String noPosting;

	@Caption(value = "No Jurnal")
	@Column(name = "NoJurnal", nullable = true)
	private Integer noJurnal;

	@Caption(value = "No Jurnal Intern")
	@Column(name = "NoJurnal_Intern", nullable = true)
	private String noJurnalIntern;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisJurnalFk")
	@Caption(value = "Object Jenis Jurnal")
	private JenisJurnal jenisJurnal;

	@Column(name = "ObjectJenisJurnalFk", insertable = false, updatable = false, nullable = true)
	private Integer jenisJurnalId;

	@Caption(value = "No Bukti Transaksi")
	@Column(name = "NoBuktiTransaksi", nullable = true)
	private String noBuktiTransaksi;

	@Caption(value = "Tgl Bukti Transaksi")
	@Column(name = "TglBuktiTransaksi", nullable = true)
	private Date tglBuktiTransaksi;

	@Caption(value = "kd Produk")
	@Column(name = "KdProduk", nullable = true)
	private String kdProduk;

	@Caption(value = "NamaProdukTransaksi")
	@Column(name = "NamaProdukTransaksi", nullable = true)
	private String namaProdukTransaksi;

	@Caption(value = "Deskripsi Produk Transaksi")
	@Column(name = "DeskripsiProdukTransaksi", nullable = true)
	private String deskripsiProdukTransaksi;

	@Caption(value = "Keterangan Lainnya")
	@Column(name = "KeteranganLainnya", nullable = true)
	private String keteranganLainnya;

	@ManyToOne
	@JoinColumn(name = "NoRetur")
	@Caption(value = "Object No Retur")
	private StrukRetur noRetur;

	@Column(name = "NoRetur", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String noReturId;

	@Caption(value = "Status Enabled")
	@Column(name = "StatusEnabled", nullable = true)
	private Byte statusEnabled;

	@ManyToOne
	@JoinColumn(name = "NoVerifikasi")
	@Caption(value = "Object No Verifikasi")
	private StrukVerifikasi noVerifikasi;

	@Column(name = "NoVerifikasi", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String noVerifikasiId;

	@ManyToOne
	@JoinColumn(name = "NoClosing")
	@Caption(value = "Object No Closing")
	private StrukClosing noClosing;

	@Column(name = "NoClosing", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = true)
	private String noClosingId;

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "postingJurnalTransaksi")
	private Set<PostingJurnalTransaksiD> detailPostingJurnalTransaksi = new HashSet<PostingJurnalTransaksiD>();

	public String getNoPosting() {
		return noPosting;
	}

	public void setNoPosting(String noPosting) {
		this.noPosting = noPosting;
	}

	public Integer getNoJurnal() {
		return noJurnal;
	}

	public void setNoJurnal(Integer noJurnal) {
		this.noJurnal = noJurnal;
	}

	public String getNoJurnalIntern() {
		return noJurnalIntern;
	}

	public void setNoJurnalIntern(String noJurnalIntern) {
		this.noJurnalIntern = noJurnalIntern;
	}

	public JenisJurnal getJenisJurnal() {
		return jenisJurnal;
	}

	public void setJenisJurnal(JenisJurnal jenisJurnal) {
		this.jenisJurnal = jenisJurnal;
	}

	public String getNoBuktiTransaksi() {
		return noBuktiTransaksi;
	}

	public void setNoBuktiTransaksi(String noBuktiTransaksi) {
		this.noBuktiTransaksi = noBuktiTransaksi;
	}

	public Date getTglBuktiTransaksi() {
		return tglBuktiTransaksi;
	}

	public void setTglBuktiTransaksi(Date tglBuktiTransaksi) {
		this.tglBuktiTransaksi = tglBuktiTransaksi;
	}

	public String getKdProduk() {
		return kdProduk;
	}

	public void setKdProduk(String kdProduk) {
		this.kdProduk = kdProduk;
	}

	public String getNamaProdukTransaksi() {
		return namaProdukTransaksi;
	}

	public void setNamaProdukTransaksi(String namaProdukTransaksi) {
		this.namaProdukTransaksi = namaProdukTransaksi;
	}

	public String getDeskripsiProdukTransaksi() {
		return deskripsiProdukTransaksi;
	}

	public void setDeskripsiProdukTransaksi(String deskripsiProdukTransaksi) {
		this.deskripsiProdukTransaksi = deskripsiProdukTransaksi;
	}

	public String getKeteranganLainnya() {
		return keteranganLainnya;
	}

	public void setKeteranganLainnya(String keteranganLainnya) {
		this.keteranganLainnya = keteranganLainnya;
	}

	public String getNoRec() {
		return noRec;
	}

	public void setNoRec(String noRec) {
		this.noRec = noRec;
	}

	public Integer getKdProfile() {
		return kdProfile;
	}

	public void setKdProfile(Integer kdProfile) {
		this.kdProfile = kdProfile;
	}

	public StrukRetur getNoRetur() {
		return noRetur;
	}

	public void setNoRetur(StrukRetur noRetur) {
		this.noRetur = noRetur;
	}

	public StrukVerifikasi getNoVerifikasi() {
		return noVerifikasi;
	}

	public void setNoVerifikasi(StrukVerifikasi noVerifikasi) {
		this.noVerifikasi = noVerifikasi;
	}

	public StrukClosing getNoClosing() {
		return noClosing;
	}

	public void setNoClosing(StrukClosing noClosing) {
		this.noClosing = noClosing;
	}

	public Set<PostingJurnalTransaksiD> getDetailPostingJurnalTransaksi() {
		return detailPostingJurnalTransaksi;
	}

	public void setDetailPostingJurnalTransaksi(Set<PostingJurnalTransaksiD> detailPostingJurnalTransaksi) {
		this.detailPostingJurnalTransaksi = detailPostingJurnalTransaksi;
	}

	public Byte getStatusEnabled() {
		return statusEnabled;
	}

	public void setStatusEnabled(Byte statusEnabled) {
		this.statusEnabled = statusEnabled;
	}

}
