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

import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheet;
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 lombok.Getter;
import lombok.Setter;
import org.locationtech.jts.geom.Geometry;

@Getter
@Setter
@Table(name = "tb_map_inkx_5k")
@Entity
public class MapInkx5kEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_map_inkx_5k_fid_seq_gen")
  @SequenceGenerator(
      name = "tb_map_inkx_5k_fid_seq_gen",
      sequenceName = "tb_map_inkx_5k_fid_seq",
      allocationSize = 1)
  private Integer fid;

  @Column(name = "mapidcd_no")
  private String mapidcdNo;

  @Column(name = "mapid_nm")
  private String mapidNm;

  @Column(name = "geom")
  private Geometry geom;

  @Column(name = "fid_k50")
  private Long fidK50;

  public InferenceResultDto.MapSheet toEntity() {
    return new MapSheet(mapidcdNo, mapidNm);
  }
}
