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

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
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_mng")
public class MapSheetMngEntity {

  @Id
  @Column(name = "mng_yyyy", nullable = false)
  private Integer mngYyyy;

  @Size(max = 20)
  @ColumnDefault("'NOTYET'")
  @Column(name = "mng_state", length = 20)
  private String mngState = "NOTYET";

  @Size(max = 20)
  @ColumnDefault("'NOTYET'")
  @Column(name = "sync_state", length = 20)
  private String syncState = "NOTYET";

  @Column(name = "mng_state_dttm")
  private ZonedDateTime mngStateDttm = ZonedDateTime.now();

  @Column(name = "sync_state_dttm")
  private ZonedDateTime syncStateDttm = ZonedDateTime.now();

  @Column(name = "created_dttm")
  private ZonedDateTime createdDttm = ZonedDateTime.now();

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

  @Column(name = "updated_dttm")
  private ZonedDateTime updatedDttm = ZonedDateTime.now();

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

  @Size(max = 255)
  @ColumnDefault("'NULL::character varying'")
  @Column(name = "mng_path")
  private String mngPath;

  @Size(max = 20)
  @ColumnDefault("'NOTYET'")
  @Column(name = "sync_check_state", length = 20)
  private String syncCheckState = "NOTYET";

  @Column(name = "sync_strt_dttm")
  private ZonedDateTime syncStrtDttm;

  @Column(name = "sync_end_dttm")
  private ZonedDateTime syncEndDttm;

  @Column(name = "sync_check_strt_dttm")
  private ZonedDateTime syncCheckStrtDttm;

  @Column(name = "sync_check_end_dttm")
  private ZonedDateTime syncCheckEndDttm;
}
