package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.helper.Caption;
import lombok.*;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 07/02/2024
 */
@Entity
@Table(name = "jumlah_diskon_dokter_m")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class JumlahDiskonDokter implements Serializable {

	private static final long serialVersionUID = 7600189956745393785L;

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "sg_jumlah_diskon_dokter_m")
	@SequenceGenerator(name = "sg_jumlah_diskon_dokter_m", sequenceName = "jumlah_diskon_dokter_m_seq", allocationSize = 1)
	@Column(name = "id")
	protected Long id;

	private Boolean statusEnabled;

	private Short kdProfile;

	@Column(nullable = false, unique = true, columnDefinition = "numeric(6,2)")
	@NotBlank(message = "Persen diskon tidak boleh kosong")
	@Caption("Persen Diskon")
	private BigDecimal persenDiskon;

}
