package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseActive;
import com.jasamedika.medifirst2000.entities.constant.TipePaket;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static javax.persistence.EnumType.STRING;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 13/11/2024
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "produkpaket_m")
public class ProdukPaket extends BaseActive implements Serializable {

	@Id
	@GeneratedValue(strategy = SEQUENCE)
	@Column(name = "id")
	private Integer id;

	@OneToOne
	@MapsId
	@JoinColumn(name = "id")
	@NotNull(message = "Produk tidak boleh kosong")
	@Caption(value = "Produk")
	private Produk produk;

	@Column(length = 30)
	@Enumerated(STRING)
	@Caption("Tipe paket")
	private TipePaket tipePaket;

}
