package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "IpsrsPeminjamanAlat_T")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class IpsrsPeminjamanAlat extends BaseTransaction{
	
	@Caption(value = "No Peminjaman")
	@Column(name = "NoPeminjaman", nullable = false)
	private String noPeminjaman;
	
	@NotNull(message = "Tanggal Peminjaman tidak boleh kososng")
	@Caption(value = "Tanggal Peminjaman")
	@Column(name = "TglPeminjaman", nullable = false)
	private Date tglPeminjaman;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuanganPeminjamFk")
	@Caption(value = "RuanganPeminjam")
	private Ruangan ruanganPeminjam;
	
	@Column(name = "ObjectRuanganPeminjamFk",insertable = false, updatable = false)
	private Integer ruanganPeminjamId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuanganAsalFk")
	@Caption(value = "RuanganAsal")
	private Ruangan ruanganAsal;
	
	@Column(name = "ObjectRuanganAsalFk",insertable = false, updatable = false)
	private Integer ruanganAsalId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectPeminjamFk")
	@Caption(value = "Peminjam")
	private Pegawai peminjam;

	@Column(name = "ObjectPeminjamFk",insertable = false, updatable = false)
	private Integer peminjamId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRegisterAssetFk")
	@Caption(value = "register aset")
	private RegistrasiAset registrasiAset;
	
	@Column(name = "ObjectRegisterAssetFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String registrasiAsetId;
	
	@Caption(value = "Jumlah")
	@NotNull(message = "Jumlah tidak boleh kososng")
	@Column(name = "Jumlah", nullable = false)
	private Integer jumlah;
	
	@NotNull(message = "Tanggal Pengembalian tidak boleh kososng")
	@Caption(value = "Tanggal Pengembalian")
	@Column(name = "TglPengembalian", nullable = false)
	private Date tglPengembalian;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectPetugasFk")
	@Caption(value = "Petugas")
	private Pegawai petugas;

	@Column(name = "ObjectPetugasFk",insertable = false, updatable = false)
	private Integer petugasId;
	
	@Caption(value = "Status")
	@Column(name = "Status", nullable = false)
	private String status;

	public String getNoPeminjaman() {
		return noPeminjaman;
	}

	public void setNoPeminjaman(String noPeminjaman) {
		this.noPeminjaman = noPeminjaman;
	}

	public Date getTglPeminjaman() {
		return tglPeminjaman;
	}

	public void setTglPeminjaman(Date tglPeminjaman) {
		this.tglPeminjaman = tglPeminjaman;
	}

	public Ruangan getRuanganPeminjam() {
		return ruanganPeminjam;
	}

	public void setRuanganPeminjam(Ruangan ruanganPeminjam) {
		this.ruanganPeminjam = ruanganPeminjam;
	}

	public Integer getRuanganPeminjamId() {
		return ruanganPeminjamId;
	}

	public void setRuanganPeminjamId(Integer ruanganPeminjamId) {
		this.ruanganPeminjamId = ruanganPeminjamId;
	}

	public Pegawai getPeminjam() {
		return peminjam;
	}

	public void setPeminjam(Pegawai peminjam) {
		this.peminjam = peminjam;
	}

	public Integer getPeminjamId() {
		return peminjamId;
	}

	public void setPeminjamId(Integer peminjamId) {
		this.peminjamId = peminjamId;
	}


	public Integer getJumlah() {
		return jumlah;
	}

	public void setJumlah(Integer jumlah) {
		this.jumlah = jumlah;
	}

	public Date getTglPengembalian() {
		return tglPengembalian;
	}

	public void setTglPengembalian(Date tglPengembalian) {
		this.tglPengembalian = tglPengembalian;
	}

	public Pegawai getPetugas() {
		return petugas;
	}

	public void setPetugas(Pegawai petugas) {
		this.petugas = petugas;
	}

	public Integer getPetugasId() {
		return petugasId;
	}

	public void setPetugasId(Integer petugasId) {
		this.petugasId = petugasId;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public RegistrasiAset getRegistrasiAset() {
		return registrasiAset;
	}

	public void setRegistrasiAset(RegistrasiAset registrasiAset) {
		this.registrasiAset = registrasiAset;
	}

	public String getRegistrasiAsetId() {
		return registrasiAsetId;
	}

	public void setRegistrasiAsetId(String registrasiAsetId) {
		this.registrasiAsetId = registrasiAsetId;
	}

	public Ruangan getRuanganAsal() {
		return ruanganAsal;
	}

	public void setRuanganAsal(Ruangan ruanganAsal) {
		this.ruanganAsal = ruanganAsal;
	}

	public Integer getRuanganAsalId() {
		return ruanganAsalId;
	}

	public void setRuanganAsalId(Integer ruanganAsalId) {
		this.ruanganAsalId = ruanganAsalId;
	}
	
	
}
