package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

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

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "DraftSurat_T")
public class DraftSurat extends BaseTransaction{
	
	@ManyToOne
	@JoinColumn(name = "ObjectDokumenFk")
	@NotNull(message="Object Dokumen Harus Diisi")
	@Caption(value="Object Dokumen")
	private Dokumen dokumen;
	
	@Column(name = "ObjectDokumenFk", insertable=false,updatable=false)
	private Integer ObjectDokumenId;
	
	@Column(name = "NoSurat", nullable = true )
	@Caption(value="noSurat")
	private String noSurat;
	
	@Column(name = "Judul", nullable = true )
	@Caption(value="judul")
	private String judul;
	
	@Column(name = "verbalKonsep", nullable = true)
	@Caption(value="verbal Konsep")
	private String verbalKonsep;
	
	@Column(name = "lembarCatatan", nullable = true)
	@Caption(value="Lembar Catatan")
	private String lembarCatatan;
	
	@ManyToOne
	@JoinColumn(name = "ObjectJenisSuratFk")
	@Caption(value="JenisSurat")
	private JenisSurat jenisSurat;
	
	@Column(name = "ObjectJenisSuratFk", insertable=false,updatable=false, nullable = true)
	private Integer jenisSuratId;
	
	@Column(name = "IsiSurat", nullable = true)
	@Caption(value="isiSurat")
	private String isiSurat;
	
	@JsonManagedReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "draftSurat")
	private Set<DraftSuratRuangan> draftSuratRuangan=new HashSet<DraftSuratRuangan>();
	
	@Column(name = "Keterangan", nullable = true)
	@Caption(value="Keterangan")
	private String keterangan;
	
	@Column(name = "tanggal", nullable = true )
	@Caption(value="Tanggal")
	private Date tanggal;
	
	
	public String getKeterangan() {
		return keterangan;
	}

	public void setKeterangan(String keterangan) {
		this.keterangan = keterangan;
	}


	public Set<DraftSuratRuangan> getDraftSuratRuangan() {
		return draftSuratRuangan;
	}

	public void setDraftSuratRuangan(Set<DraftSuratRuangan> draftSuratRuangan) {
		this.draftSuratRuangan = draftSuratRuangan;
	}

	public String getNoSurat() {
		return noSurat;
	}

	public void setNoSurat(String noSurat) {
		this.noSurat = noSurat;
	}

	public String getJudul() {
		return judul;
	}

	public void setJudul(String judul) {
		this.judul = judul;
	}

	public JenisSurat getJenisSurat() {
		return jenisSurat;
	}

	public void setJenisSurat(JenisSurat jenisSurat) {
		this.jenisSurat = jenisSurat;
	}

	public String getIsiSurat() {
		return isiSurat;
	}

	public void setIsiSurat(String isiSurat) {
		this.isiSurat = isiSurat;
	}
	
	public Dokumen getDokumen() {
		return dokumen;
	}

	public void setDokumen(Dokumen dokumen) {
		this.dokumen = dokumen;
	}

	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}

	public Integer getObjectDokumenId() {
		return ObjectDokumenId;
	}

	public void setObjectDokumenId(Integer objectDokumenId) {
		ObjectDokumenId = objectDokumenId;
	}


	public String getVerbalKonsep() {
		return verbalKonsep;
	}

	public void setVerbalKonsep(String verbalKonsep) {
		this.verbalKonsep = verbalKonsep;
	}

	public String getLembarCatatan() {
		return lembarCatatan;
	}

	public void setLembarCatatan(String lembarCatatan) {
		this.lembarCatatan = lembarCatatan;
	}

	public Integer getJenisSuratId() {
		return jenisSuratId;
	}

	public void setJenisSuratId(Integer jenisSuratId) {
		this.jenisSuratId = jenisSuratId;
	}

	
	
}
