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 KomponenIndexDetailRange
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KomponenIndexDetailRange_M")
public class KomponenIndexDetailRange extends BaseMaster {

	@NotNull(message = "Factor Rate Index Range tidak boleh kosong")
	@Column(name = "FactorRateIndexRange", nullable = false)
	@Caption(value = "Factor Rate Index Range")
	private Double factorRateIndexRange;

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenIndexDetailFk")
	@NotNull(message = "Kd Komponen Index Detail tidak boleh kosong")
	@Caption(value = "Object Komponen Index Detail")
	private KomponenIndex komponenIndexDetail;

	@Column(name = "ObjectKomponenIndexDetailFk", insertable = false, updatable = false)
	private Integer komponenIndexDetailId;

	@ManyToOne
	@JoinColumn(name = "ObjectRangeFk")
	@NotNull(message = "Kd Range tidak boleh kosong")
	@Caption(value = "Object Range")
	private Range range;

	@Column(name = "ObjectRangeFk", insertable = false, updatable = false, nullable = false)
	private Integer rangeId;

	@Column(name = "NilaiIndexRange")
	@Caption(value = "Nilai Index Range")
	private Double nilaiIndexRange;

	@Column(name = "PersenNilaiIndexRange")
	@Caption(value = "Persen Nilai Index Range")
	private Double persenNilaiIndexRange;

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

}