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

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import java.time.ZonedDateTime;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

@Getter
@Setter
@Entity
@Table(name = "tb_model_dataset")
public class ModelDatasetEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "id", nullable = false)
  private Long id;

  @NotNull
  @ManyToOne(fetch = FetchType.LAZY, optional = false)
  @JoinColumn(name = "model_id", nullable = false)
  private ModelMasterEntity model;

  @Column(name = "building_cnt")
  private Long buildingCnt;

  @Column(name = "container_cnt")
  private Long containerCnt;

  @Column(name = "waste_cnt")
  private Long wasteCnt;

  @Column(name = "land_cover_cnt")
  private Long landCoverCnt;

  @Column(name = "solar_cnt")
  private Long solarCnt;

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

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