package com.jasamedika.medifirst2000.vo;

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

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

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

public class DraftPeraturanVO extends BaseMasterVO{

	@ManyToOne
	@JoinColumn(name = "ObjectUserFk")
	@NotNull(message="User tidak boleh kosong")
	@Caption(value="User")
	private PegawaiVO user;
	
	@Column(name = "ObjectUserFk", insertable=false,updatable=false,nullable=false)
	private Integer userId;

	@Column(name="noPeraturan")
	@Caption(value="No Peraturan")
	private String noPeraturan;
	
	@Column(name="namaPeraturan", nullable =true)
	@Caption(value="Nama Peraturan")
	private String namaPeraturan;
	
	@Column(name="tglPeraturan")
	@Caption(value="Tanggal Peraturan")
	private Date tglPeraturan;
	
	@Column(name="draftPeraturan")
	@Caption(value="Draft Peraturan")
	private String draftPeraturan;
	
	@Column(name="tglPengesahan")
	@Caption(value="Tanggal Pengesahan")
	private Date tglPengesahan;
	
	@ManyToOne
	@JoinColumn(name = "ObjectPenanggungJawabFk")
	@NotNull(message="Penanggung Jawab tidak boleh kosong")
	@Caption(value="Penanggung Jawab")
	private PegawaiVO penanggungJawab;
	
	@Column(name = "ObjectPenanggungJawabFk", insertable=false,updatable=false,nullable=false)
	private Integer penanggungJawabId;
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "draftPeraturan")
	@Caption(value = "detailDraftSet")
	private Set<DetailDraftPeraturanVO> detailDraftSet;

	public PegawaiVO getUser() {
		return user;
	}

	public void setUser(PegawaiVO user) {
		this.user = user;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getNoPeraturan() {
		return noPeraturan;
	}

	public void setNoPeraturan(String noPeraturan) {
		this.noPeraturan = noPeraturan;
	}

	public String getNamaPeraturan() {
		return namaPeraturan;
	}

	public void setNamaPeraturan(String namaPeraturan) {
		this.namaPeraturan = namaPeraturan;
	}

	public Date getTglPeraturan() {
		return tglPeraturan;
	}

	public void setTglPeraturan(Date tglPeraturan) {
		this.tglPeraturan = tglPeraturan;
	}

	public String getDraftPeraturan() {
		return draftPeraturan;
	}

	public void setDraftPeraturan(String draftPeraturan) {
		this.draftPeraturan = draftPeraturan;
	}

	public Date getTglPengesahan() {
		return tglPengesahan;
	}

	public void setTglPengesahan(Date tglPengesahan) {
		this.tglPengesahan = tglPengesahan;
	}

	public PegawaiVO getPenanggungJawab() {
		return penanggungJawab;
	}

	public void setPenanggungJawab(PegawaiVO penanggungJawab) {
		this.penanggungJawab = penanggungJawab;
	}

	public Integer getPenanggungJawabId() {
		return penanggungJawabId;
	}

	public void setPenanggungJawabId(Integer penanggungJawabId) {
		this.penanggungJawabId = penanggungJawabId;
	}

	public Set<DetailDraftPeraturanVO> getDetailDraftSet() {
		return detailDraftSet;
	}

	public void setDetailDraftSet(Set<DetailDraftPeraturanVO> detailDraftSet) {
		this.detailDraftSet = detailDraftSet;
	}
	
	
}
