package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class Departemen
 * 
 * @author Generator
 */
@Entity
@Table(name = "Departemen_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Departemen extends BaseMaster {

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

	@Caption(value = "Nama Departemen")
	private String namaDepartemen;

	@Caption(value = "Kode Departemen")
	private String kdDepartemen;

	@Caption(value = "QDepartemen")
	private Byte qDepartemen;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectPegawaiKepalaFk")
	@Caption(value = "Object Pegawai Kepala")
	private LoginUser pegawaiKepala;

	@Column(name = "ObjectPegawaiKepalaFk", insertable = false, updatable = false)
	private Integer pegawaiKepalaId;

	@Caption(value = "Alamat Email")
	private String alamatEmail;

	@Caption(value = "Website")
	private String website;

	@Caption(value = "Faksimile")
	private String faksimile;

	@Caption(value = "Fixed Phone")
	private String fixedPhone;

	@Caption(value = "Mobile Phone")
	private String mobilePhone;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJenisPerawatanFk")
	@NotNull(message = "Object Jenis Perawatan Harus Diisi")
	@Caption(value = "Object Jenis Perawatan")
	private JenisPerawatan jenisPerawatan;

	@Column(name = "ObjectJenisPerawatanFk", insertable = false, updatable = false)
	private Integer jenisPerawatanId;

	@Caption(value = "Prefix No Antrian")
	private String prefixNoAntrian;

	public Departemen(String kdDepartemen, String namaDepartemen, Integer id) {
		super();
		this.kdDepartemen = kdDepartemen;
		this.namaDepartemen = namaDepartemen;
		this.id = id;
	}

	public Departemen() {
		super();
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setNamaDepartemen(String namaDepartemen) {
		this.namaDepartemen = namaDepartemen;
	}

	@NotNull(message = "Nama Departemen tidak boleh kosong")
	@Column(name = "NamaDepartemen", nullable = true, length = 50)
	public String getNamaDepartemen() {
		return this.namaDepartemen;
	}

	public void setKdDepartemen(String kdDepartemen) {
		this.kdDepartemen = kdDepartemen;
	}

	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Column(name = "KdDepartemen", nullable = true, length = 1)
	public String getKdDepartemen() {
		return this.kdDepartemen;
	}

	public void setqDepartemen(Byte qDepartemen) {
		this.qDepartemen = qDepartemen;
	}

	@NotNull(message = "QDepartemen tidak boleh kosong")
	@Column(name = "QDepartemen", nullable = true)
	public Byte getqDepartemen() {
		return this.qDepartemen;
	}

	public void setPegawaiKepala(LoginUser pegawaiKepala) {
		this.pegawaiKepala = pegawaiKepala;
	}

	public LoginUser getPegawaiKepala() {
		return this.pegawaiKepala;
	}

	public void setPegawaiKepalaId(Integer pegawaiKepalaId) {
		this.pegawaiKepalaId = pegawaiKepalaId;
	}

	public Integer getPegawaiKepalaId() {
		return pegawaiKepalaId;
	}

	public void setAlamatEmail(String alamatEmail) {
		this.alamatEmail = alamatEmail;
	}

	@Column(name = "AlamatEmail", nullable = true, length = 50)
	public String getAlamatEmail() {
		return this.alamatEmail;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	@Column(name = "Website", nullable = true, length = 80)
	public String getWebsite() {
		return this.website;
	}

	public void setFaksimile(String faksimile) {
		this.faksimile = faksimile;
	}

	@Column(name = "Faksimile", nullable = true, length = 30)
	public String getFaksimile() {
		return this.faksimile;
	}

	public void setFixedPhone(String fixedPhone) {
		this.fixedPhone = fixedPhone;
	}

	@Column(name = "FixedPhone", nullable = true, length = 30)
	public String getFixedPhone() {
		return this.fixedPhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	@Column(name = "MobilePhone", nullable = true, length = 30)
	public String getMobilePhone() {
		return this.mobilePhone;
	}

	public void setJenisPerawatan(JenisPerawatan jenisPerawatan) {
		this.jenisPerawatan = jenisPerawatan;
	}

	@NotNull(message = "Kd Jenis Perawatan tidak boleh kosong")
	public JenisPerawatan getJenisPerawatan() {
		return this.jenisPerawatan;
	}

	public void setJenisPerawatanId(Integer jenisPerawatanId) {
		this.jenisPerawatanId = jenisPerawatanId;
	}

	public Integer getJenisPerawatanId() {
		return jenisPerawatanId;
	}

	public void setPrefixNoAntrian(String prefixNoAntrian) {
		this.prefixNoAntrian = prefixNoAntrian;
	}

	@Column(name = "PrefixNoAntrian", nullable = true, length = 4)
	public String getPrefixNoAntrian() {
		return this.prefixNoAntrian;
	}

	@Override
	public String toString() {
		return "Departemen [id=" + id + ", namaDepartemen=" + namaDepartemen + ", statusEnabled=" + statusEnabled + "]";
	}

}