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.Setter;

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

import static javax.persistence.FetchType.LAZY;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKapasitasJenisPemakaianFk")
	@Caption(value = "Kapasitas Jenis Pemakaian")
	private IpsrsKapasitasJenisPemakaian ipsrsKapasitasJenisPemakaian;

	@Column(name = "ObjectKapasitasJenisPemakaianFk", insertable = false, updatable = false)
	private Integer ipsrsKapasitasJenisPemakaianId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectRuanganFk")
	@Caption(value = "Ruangan")
	private Rekanan ruangan;

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

	@NotNull(message = "Periode tidak boleh kososng")
	@Caption(value = "Periode")
	@Column(name = "Periode", nullable = false)
	private Date periode;

	@NotNull(message = "Jumlah Meter Awal tidak boleh kosong")
	@Caption(value = "Jumlah Meter Awal")
	@Column(name = "JumlahMeterAwal", nullable = false)
	private float jumlahMeterAwal;

	@Caption(value = "Jumlah Meter Ahir")
	@Column(name = "JumlahMeterAhir")
	private float jumlahMeterAhir;

	@Caption(value = "Jumlah Pemakaian")
	@Column(name = "JumlahPemakaian")
	private float jumlahPemakaian;

	@Caption(value = "Biaya/Bulan")
	@Column(name = "BiayaPerBulan")
	private Double biayaPerBulan;

}
