package com.jasamedika.medifirst2000.entities;

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

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "Akun_M")
public class Akun extends BaseMaster {

	@NotNull(message = "Akun tidak boleh kosong")
	@Caption(value = "Akun")
	@Column(name = "Akun", nullable = false, length = 200)
	private String namaAkun;

	@NotNull(message = "Kode Akun tidak boleh kosong")
	@Caption(value = "Kode Akun")
	@Column(name = "KodeAkun", length = 50)
	private String kodeAkun;

	@NotNull(message = "Keterangan tidak boleh kosong")
	@Caption(value = "Keterangan")
	@Column(name = "Keterangan", length = 200)
	private String ketAkun;

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "public.akun_m_id_seq")
	@SequenceGenerator(name = "public.akun_m_id_seq", sequenceName = "public.akun_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

}