package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 KelompokAset
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KelompokAset_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class KelompokAset extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectAccountFk")
	@Caption(value = "Object Account")
	private ChartOfAccount account;

	@Column(name = "ObjectAccountFk", insertable = false, updatable = false)
	private Integer accountId;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisAsetFk")
	@NotNull(message = "Kd Jenis Aset tidak boleh kosong")
	@Caption(value = "Object Jenis Aset")
	private JenisAset jenisAset;

	@Column(name = "ObjectJenisAsetFk", insertable = false, updatable = false, nullable = false)
	private Integer jenisAsetId;

	@NotNull(message = "Kd Kelompok Aset tidak boleh kosong")
	@Column(name = "KdKelompokAset", nullable = false)
	@Caption(value = "Kode Kelompok Aset")
	private Byte kdKelompokAset;

	@ManyToOne
	@JoinColumn(name = "ObjectMetodePenyusutanFk")
	@Caption(value = "Object Metode Penyusutan")
	private MetodePenyusutan metodePenyusutan;

	@Column(name = "ObjectMetodePenyusutanFk", insertable = false, updatable = false, nullable = false)
	private Integer metodePenyusutanId;

	@NotNull(message = "Kelompok Aset tidak boleh kosong")
	@Column(name = "KelompokAset", nullable = false, length = 50)
	@Caption(value = "Kelompok Aset")
	private String kelompokAset;

	@Column(name = "PersenPenyusutan")
	@Caption(value = "Persen Penyusutan")
	private Double persenPenyusutan;

	@NotNull(message = "QKelompok Aset tidak boleh kosong")
	@Column(name = "QKelompokAset", nullable = false)
	@Caption(value = "QKelompok Aset")
	private Byte qKelompokAset;

	@Column(name = "RumusPenyusutan", length = 20)
	@Caption(value = "Rumus Penyusutan")
	private String rumusPenyusutan;

	@NotNull(message = "Umur Ekonomis_ Thn tidak boleh kosong")
	@Column(name = "UmurEkonomis_Thn", nullable = false)
	@Caption(value = "Umur Ekonomis_ Thn")
	private Double umurEkonomis_Thn;

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

}