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 lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

@Getter
@Setter
@Entity
@Table(name = "tb_map_sheet_anal_data")
public class MapSheetAnalDataEntity {

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

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

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

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

  @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;

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

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

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

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

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

  @Column(name = "target_yyyy")
  private Integer targetYyyy;

  @Column(name = "data_json")
  private String dataJson;

  @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;

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

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

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

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

  @Column(name = "anal_uid")
  private Long analUid;

  @Column(name = "map_sheet_num")
  private Long mapSheetNum;

  @Column(name = "detecting_cnt")
  private Long detectingCnt;

  @ColumnDefault("0")
  @Column(name = "pnu")
  private Long pnu;

  @Size(max = 20)
  @Column(name = "down_state", length = 20)
  private String downState;

  @Column(name = "down_state_dttm")
  private ZonedDateTime downStateDttm;

  @Size(max = 20)
  @Column(name = "fit_state", length = 20)
  private String fitState;

  @Column(name = "fit_state_dttm")
  private ZonedDateTime fitStateDttm;

  @Column(name = "labeler_uid")
  private Long labelerUid;

  @Size(max = 20)
  @ColumnDefault("NULL")
  @Column(name = "label_state", length = 20)
  private String labelState;

  @Column(name = "label_state_dttm")
  private ZonedDateTime labelStateDttm;

  @Column(name = "tester_uid")
  private Long testerUid;

  @Size(max = 20)
  @Column(name = "test_state", length = 20)
  private String testState;

  @Column(name = "test_state_dttm")
  private ZonedDateTime testStateDttm;

  @Column(name = "fit_state_cmmnt", length = Integer.MAX_VALUE)
  private String fitStateCmmnt;

  @Column(name = "ref_map_sheet_num")
  private Long refMapSheetNum;
}
