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_metrics_validation")
public class ModelMetricsValidationEntity {

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

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

  @Column(name = "epoch")
  private Integer epoch;

  @Column(name = "a_acc")
  private Float aAcc;

  @Column(name = "m_fscore")
  private Float mFscore;

  @Column(name = "m_precision")
  private Float mPrecision;

  @Column(name = "m_recall")
  private Float mRecall;

  @Column(name = "m_iou")
  private Float mIou;

  @Column(name = "m_acc")
  private Float mAcc;

  @Column(name = "changed_fscore")
  private Float changedFscore;

  @Column(name = "changed_precision")
  private Float changedPrecision;

  @Column(name = "changed_recall")
  private Float changedRecall;

  @Column(name = "unchanged_fscore")
  private Float unchangedFscore;

  @Column(name = "unchanged_precision")
  private Float unchangedPrecision;

  @Column(name = "unchanged_recall")
  private Float unchangedRecall;

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

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