package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

import static javax.persistence.TemporalType.TIMESTAMP;

@Getter
@Setter
@Entity
@Table(name = "userloggingactivity_t")
public class LoggingUser extends BaseTransaction {

	@Caption(value = "Tanggal")
	@Column(name = "tanggal", nullable = false)
	@Temporal(TIMESTAMP)
	private Date tanggal;

	@ManyToOne
	@NotNull(message = "User tidak boleh kosong")
	@JoinColumn(name = "objectloginuserfk")
	@Caption(value = "User")
	private LoginUser loginUser;

	@Column(name = "objectloginuserfk", insertable = false, updatable = false)
	private Integer loginUserId;

	@Column(name = "jenislog", nullable = false)
	@Caption(value = "Jenis Log")
	private String jenisLog;

	@Column(name = "objectreferensifk", nullable = false)
	@Caption(value = "Id Referensi")
	private String referensiId;

	@Column(name = "referensi", nullable = false)
	@Caption(value = "Referensi")
	private String referensi;

	@Column(name = "keterangan")
	@Caption(value = "Keterangan")
	private String keterangan;

}
