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.Table;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "PengembalianKendaraanDinas_T")
public class PengembalianKendaraanDinas extends BaseTransaction {

	private static final long serialVersionUID = 1324950034363575925L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectStrukOrderFk")
	private StrukOrder strukOrder;

	@Column(name = "ObjectStrukOrderFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String strukOrderId;

	@NotNull(message = "KM Awal tidak boleh kosong")
	@Column(name = "KMAwal", nullable = false)
	@Caption(value = "KM Awal")
	private Integer kmAwal;

	@NotNull(message = "KM Terakhir tidak boleh kosong")
	@Column(name = "KmTerakhir", nullable = false)
	@Caption(value = "KM Terakhir")
	private Integer kmTerakhir;

	@ManyToOne
	@JoinColumn(name = "ObjectKondisiKendaraanFk")
	@Caption(value = "Kondisi Kendaraan")
	private KondisiKendaraan kondisiKendaraan;

	@Column(name = "ObjectKondisiKendaraanFk", insertable = false, updatable = false, nullable = false)
	private Integer kondisiKendaraanId;

	@Column(name = "Keterangan", nullable = false, length = 100)
	@Caption(value = "Keterangan")
	private String keterangan;

	public Integer getKmAwal() {
		return kmAwal;
	}

	public void setKmAwal(Integer kmAwal) {
		this.kmAwal = kmAwal;
	}

	public Integer getKmTerakhir() {
		return kmTerakhir;
	}

	public void setKmTerakhir(Integer kmTerakhir) {
		this.kmTerakhir = kmTerakhir;
	}

	public KondisiKendaraan getKondisiKendaraan() {
		return kondisiKendaraan;
	}

	public void setKondisiKendaraan(KondisiKendaraan kondisiKendaraan) {
		this.kondisiKendaraan = kondisiKendaraan;
	}

	public Integer getKondisiKendaraanId() {
		return kondisiKendaraanId;
	}

	public void setKondisiKendaraanId(Integer kondisiKendaraanId) {
		this.kondisiKendaraanId = kondisiKendaraanId;
	}

	public String getKeterangan() {
		return keterangan;
	}

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

	public StrukOrder getStrukOrder() {
		return strukOrder;
	}

	public void setStrukOrder(StrukOrder strukOrder) {
		this.strukOrder = strukOrder;
	}

}
