package com.kamco.cd.kamcoback.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.Size;
import java.time.ZonedDateTime;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;

@Getter
@Setter
@Entity
@Table(name = "tb_map_sheet_learn_data")
public class MapSheetLearnDataEntity {

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

  @Column(name = "anal_end_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE")
  private ZonedDateTime analEndDttm;

  @Size(max = 255)
  @Column(name = "anal_map_sheet")
  private String analMapSheet;

  @Column(name = "anal_sec")
  private Long analSec;

  @Size(max = 20)
  @Column(name = "anal_state", length = 20)
  private String analState;

  @Column(name = "anal_strt_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE")
  private ZonedDateTime analStrtDttm;

  @Column(name = "compare_yyyy")
  private Integer compareYyyy;

  @ColumnDefault("now()")
  @Column(name = "created_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE DEFAULT now()")
  private ZonedDateTime createdDttm;

  @Column(name = "created_uid")
  private Long createdUid;

  @Size(max = 128)
  @Column(name = "data_crs_type", length = 128)
  private String dataCrsType;

  @Size(max = 255)
  @Column(name = "data_crs_type_name")
  private String dataCrsTypeName;

  @Column(name = "data_json")
  @JdbcTypeCode(SqlTypes.JSON)
  private Map<String, Object> dataJson;

  @Size(max = 128)
  @Column(name = "data_name", length = 128)
  private String dataName;

  @Size(max = 255)
  @Column(name = "data_path")
  private String dataPath;

  @Size(max = 20)
  @Column(name = "data_state", length = 20)
  private String dataState;

  @ColumnDefault("now()")
  @Column(name = "data_state_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE DEFAULT now()")
  private ZonedDateTime dataStateDttm;

  @Size(max = 255)
  @Column(name = "data_title")
  private String dataTitle;

  @Size(max = 128)
  @Column(name = "data_type", length = 128)
  private String dataType;

  @Column(name = "data_yyyy")
  private Integer dataYyyy;

  @Size(max = 20)
  @Column(name = "gukuin_used", length = 20)
  private String gukuinUsed;

  @Column(name = "gukuin_used_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE")
  private ZonedDateTime gukuinUsedDttm;

  @ColumnDefault("now()")
  @Column(name = "updated_dttm", columnDefinition = "TIMESTAMP WITH TIME ZONE DEFAULT now()")
  private ZonedDateTime updatedDttm;

  @Column(name = "updated_uid")
  private Long updatedUid;
}
