package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name = "Asset_T")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Asset extends BaseTransaction {

	private static final long serialVersionUID = 5653555162465402457L;

	public Asset(String noRegisterAset, String noRegisterAset_Int, String noPolisi, String noRec) {
		this.noRegisterAset = noRegisterAset;
		this.noRegisterAset_Int = noRegisterAset_Int;
		this.noPolisi = noPolisi;
		this.noRec = noRec;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokAsetFk")
	@Caption(value = "Kelompok Asset")
	private KelompokAset kelompokAset;

	@Column(name = "ObjectKelompokAsetFk", insertable = false, updatable = false)
	private Integer kelompokAsetId;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	private Ruangan ruangan;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false)
	private Integer ruanganId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@Caption(value = "Nama Barang")
	private Produk produk;

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

	@ManyToOne
	@JoinColumn(name = "ObjectAsalProdukFk")
	private AsalProduk asalProduk;

	@Column(name = "ObjectAsalProdukFk", insertable = false, updatable = false)
	private Integer asalProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectTypeProdukFk")
	@Caption(value = "Type")
	private TypeProduk typeProduk;

	@Column(name = "ObjectTypeProdukFk", insertable = false, updatable = false)
	private Integer typeProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectBahanProdukFk")
	private BahanProduk bahanProduk;

	@Column(name = "ObjectBahanProdukFk", insertable = false, updatable = false)
	private Integer bahanProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectWarnaProdukFk")
	private WarnaProduk warnaProduk;

	@Column(name = "ObjectWarnaProdukFk", insertable = false, updatable = false)
	private Integer warnaProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdusenProdukFk")
	private ProdusenProduk produsenProduk;

	@Column(name = "ObjectProdusenProdukFk", insertable = false, updatable = false)
	private Integer produsenProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKontruksiFk")
	private JenisKontruksi jenisKontruksi;

	@Column(name = "ObjectJenisKontruksiFk", insertable = false, updatable = false)
	private Integer jenisKontruksiId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisSetifikatFk")
	private JenisSertifikat jenisSertifikat;

	@Column(name = "ObjectJenisSetifikatFk", insertable = false, updatable = false)
	private Integer jenisSertifikatId;

	@ManyToOne
	@JoinColumn(name = "ObjectAlamatFk")
	private Alamat alamat;

	@Column(name = "ObjectAlamatFk", insertable = false, updatable = false)
	private Integer alamatId;

	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiPenggunaFk")
	private PegawaiPengguna pegawaiPengguna;

	@Column(name = "ObjectPegawaiPenggunaFk", insertable = false, updatable = false)
	private Integer pegawaiPenggunaId;

	@ManyToOne
	@JoinColumn(name = "ObjectKondisiProdukAwalFk")
	private KondisiProdukAwal kondisiProdukAwal;

	@Column(name = "ObjectKondisiProdukAwalFk", insertable = false, updatable = false)
	private Integer kondisiProdukAwalId;

	@ManyToOne
	@JoinColumn(name = "ObjectKondisiProdukCurrentFk")
	private KondisiProdukCurrent kondisiProdukCurrent;

	@Column(name = "ObjectKondisiProdukCurrentFk", insertable = false, updatable = false)
	private Integer kondisiProdukCurrentId;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganPosisiCurrentFk")
	private RuanganPosisiCurrent ruanganPosisiCurrent;

	@Column(name = "ObjectRuanganPosisiCurrentFk", insertable = false, updatable = false)
	private Integer ruanganPosisiCurrentId;

	@ManyToOne
	@JoinColumn(name = "ObjectMerkProdukFk")
	@Caption(value = "Merk Produk")
	private MerkProduk merkProduk;

	@Column(name = "ObjectMerkProdukFk", insertable = false, updatable = false)
	private Integer merkProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectSatuanAsetFk")
	@Caption(value = "Satuan")
	private SatuanAset satuanAset;

	@Column(name = "ObjectSatuanAsetFk", insertable = false, updatable = false)
	private Integer satuanAsetId;

	@ManyToOne
	@JoinColumn(name = "ObjectKlasifikasiTeknologiFk")
	@Caption(value = "Klasifikasi Teknologi")
	private KlasifikasiTeknologi klasifikasiTeknologi;

	@Column(name = "ObjectKlasifikasiTeknologiFk", insertable = false, updatable = false)
	private Integer klasifikasiTeknologiId;

	@ManyToOne
	@JoinColumn(name = "ObjectUsiaAsetFk")
	@Caption(value = "Usia Asset")
	private UsiaAset usiaAset;

	@Column(name = "ObjectUsiaAsetFk", insertable = false, updatable = false)
	private Integer usiaAsetId;

	@ManyToOne
	@JoinColumn(name = "ObjectTahunPerolehanFk")
	@Caption(value = "Tahun Perolehan")
	private TahunPerolehan tahunPerolehan;

	@Column(name = "ObjectTahunPerolehanFk", insertable = false, updatable = false)
	private Integer tahunPerolehanId;

	@ManyToOne
	@JoinColumn(name = "ObjectKondisiAsetFk")
	@Caption(value = "Kondisi Asset")
	private KondisiAset kondisiAset;

	@Column(name = "ObjectKondisiAsetFk", insertable = false, updatable = false)
	private Integer kondisiAsetId;

	@ManyToOne
	@JoinColumn(name = "ObjectRekananFk")
	@Caption("Distributor")
	private Rekanan rekanan;

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

	@ManyToOne
	@JoinColumn(name = "ObjectLokasiFk")
	@Caption("Lokasi Asset")
	private Lokasi lokasi;

	@Column(name = "ObjectLokasiFk", insertable = false, updatable = false)
	private Integer lokasiId;

	@Column(name = "NoRegisterAset", length = 15)
	@Caption(value = "No Registrasi Asset")
	private String noRegisterAset;

	@Column(name = "NoRegisterAset_Int", length = 30)
	@Caption(value = "No Register Aset Int")
	private String noRegisterAset_Int;

	@NotNull(message = "Kode Aspac tidak boleh kosong")
	@Column(name = "KdAspac", length = 50)
	@Caption(value = "Kode Aspac")
	private String kdAspac;

	@NotNull(message = "Kode BMN tidak boleh kosong")
	@Column(name = "KdBmn", length = 50)
	@Caption(value = "Kode BMN")
	private String kdBmn;

	@NotNull(message = "Kode RSABHK tidak boleh kosong")
	@Column(name = "KdRsabhk", length = 50)
	@Caption(value = "Kode RSABHK")
	private String kdRsabhk;

	@NotNull(message = "No seri tidak boleh kosong")
	@Column(name = "NoSeri", nullable = false, length = 50)
	@Caption(value = "No Seri")
	private String noSeri;

	@NotNull(message = "Daya listrik tidak boleh kosong")
	@Column(name = "DayaListrik", nullable = false, length = 50)
	@Caption(value = "Daya Listrik")
	private String dayaListrik;

	@NotNull(message = "tidak boleh kosong")
	@Caption(value = "Keterangan Lainya")
	@Column(name = "KeteranganLainya", nullable = false, length = 150)
	private String keteranganLainya;

	@Column(name = "NoModel", length = 15)
	@Caption(value = "No Model")
	private String noModel;

	@Column(name = "NamaModel", length = 50)
	@Caption(value = "Nama Model")
	private String namaModel;

	@Column(name = "NoSerial", length = 30)
	@Caption(value = "No Serial")
	private String noSerial;

	@Column(name = "NoPolisi", length = 15)
	@Caption(value = "No Polisi")
	private String noPolisi;

	@Column(name = "NoBpkb", length = 30)
	@Caption(value = "No BPKB")
	private String noBPKB;

	@Column(name = "NoMesin", length = 30)
	@Caption(value = "No Mesin")
	private String noMesin;

	@Column(name = "NoRangka", length = 30)
	@Caption(value = "No Rangka")
	private String noRangka;

	@Column(name = "BpkbAtasNama", length = 80)
	@Caption(value = "BPKB Atas Nama")
	private String bpkbAtasNama;

	@Column(name = "NamaPengguna", length = 80)
	@Caption(value = "Nama Pengguna")
	private String namaPengguna;

	@Column(name = "NoStrukText", length = 10)
	@Caption(value = "No Struk")
	private String noStrukText;

	@Column(name = "NoSertifikat", length = 30)
	@Caption(value = "No Sertifikat")
	private String noSertifikat;

	@Column(name = "SertifikatAtasNama", length = 80)
	@Caption(value = "Sertifikat Atas Nama")
	private String sertifikatAtasNama;

	@Column(name = "NamaRuasJalan", length = 100)
	@Caption(value = "Nama Ruas Jalan")
	private String namaRuasJalan;

	@Column(name = "FungsiKegunaan", length = 100)
	@Caption(value = "Fungsi Kegunaan")
	private String fungsiKegunaan;

	@Column(name = "TglPenerimaanAset")
	@Caption(value = "Tgl Penerimaan Asset")
	private Date tglPenerimaanAset;

	@Column(name = "MasaBerlakuSertifikat")
	@Caption(value = "Masa Berlaku Sertifikat")
	private Date masaBerlakuSertifikat;

	@Column(name = "TglProduksi")
	@Caption(value = "Tgl Produksi")
	private Date tglProduksi;

	@Column(name = "TglRegisterAset")
	@Caption(value = "Tgl Register Asset")
	private Date tglRegisterAset;

	@Column(name = "TglStrukTerima")
	@Caption(value = "Tgl Struk Terima")
	private Date tglStrukTerima;

	@NotNull(message = "Qty tidak boleh kosong")
	@Column(name = "QtyProdukAset", nullable = false)
	@Caption(value = "Qty")
	private Integer qtyAset;

	@Column(name = "HargaPenyusutan")
	@Caption(value = "Harga Penyusutan")
	private float hargaPenyusutan;

	@Column(name = "TotalSudahMenyusut")
	@Caption(value = "Total Sudah Menyusut")
	private float totalSudahMenyusut;

	@Column(name = "HargaPertambahan")
	@Caption(value = "Harga Pertambahan")
	private float hargaPertambahan;

	@Column(name = "TotalSudahBertambah")
	@Caption(value = "Total Sudah Bertambah")
	private float totalSudahBertambah;

	@Column(name = "HargaSatuanRevaluasi")
	@Caption(value = "Harga Satuan Revaluasi")
	private float hargaSatuanRevaluasi;

	@Column(name = "HargaNetto")
	@Caption(value = "Harga Netto")
	private float hargaNetto;

	@NotNull(message = "Harga tidak boleh kosong")
	@Column(name = "Harga", nullable = false)
	@Caption(value = "Harga")
	private Double harga;

	@Column(name = "UmurEkonomisRevaluasiTahun")
	@Caption(value = "Umur Ekonomi sRevaluasi Tahun")
	private Double umurEkonomisRevaluasiTahun;

	@Column(name = "TotalSisaUmurEkonomisTahun")
	@Caption(value = "Total SisaUmur Ekonomis Tahun")
	private Double totalSisaUmurEkonomisTahun;

	@Column(name = "KapasitasMesin")
	@Caption(value = "Kapasitas Mesin")
	private Double kapasitasMesin;

	@Column(name = "LtPanjang")
	@Caption(value = "LT Panjang")
	private Double ltPanjang;

	@Column(name = "LtLebar")
	@Caption(value = "LT Lebar")
	private Double ltLebar;

	@Column(name = "LbPanjang")
	@Caption(value = "LB Panjang")
	private Double lbPanjang;

	@Column(name = "LbLebar")
	@Caption(value = "LB Lebar")
	private Double lbLebar;

	@Column(name = "LbTinggi")
	@Caption(value = "LB Tinggi")
	private Double lbTinggi;

	@Column(name = "QtyLantai")
	@Caption(value = "Qty Lantai")
	private Double qtyLantai;

}
