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 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_model_metrics_test")
public class ModelMetricsTestEntity {

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

  @Size(max = 50)
  @Column(name = "model", length = 50)
  private String model1;

  @Column(name = "tp")
  private Long tp;

  @Column(name = "fp")
  private Long fp;

  @Column(name = "fn")
  private Long fn;

  @Column(name = "precisions")
  private Float precisions;

  @Column(name = "recall")
  private Float recall;

  @Column(name = "f1_score")
  private Float f1Score;

  @Column(name = "accuracy")
  private Float accuracy;

  @Column(name = "iou")
  private Float iou;

  @Column(name = "detection_count")
  private Long detectionCount;

  @Column(name = "gt_count")
  private Long gtCount;

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

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