package com.kamco.cd.kamcoback.Innopam.postgres.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.UUID;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

@Getter
@Setter
@Entity
@Table(name = "detect_mast_pnu")
public class DetectMastPnuEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "detect_mast_pnu_id_gen")
  @SequenceGenerator(
      name = "detect_mast_pnu_id_gen",
      sequenceName = "seq_detect_mast_pnu_id",
      allocationSize = 1)
  @Column(name = "dtct_mst_pnu_id", nullable = false)
  private Long id;

  @NotNull
  @ColumnDefault("gen_random_uuid()")
  @Column(name = "detect_mast_pnu_uuid", nullable = false)
  private UUID detectMastPnuUuid;

  @NotNull
  @Column(name = "dtct_mst_id", nullable = false)
  private Long dtctMstId;

  @Size(max = 4)
  @NotNull
  @Column(name = "pnu", nullable = false, length = 4)
  private String pnu;

  @Column(name = "polygon", length = Integer.MAX_VALUE)
  private String polygon;
}
