package com.cd.detection.entity;

import jakarta.persistence.*;
import java.time.ZonedDateTime;
import lombok.*;
import org.hibernate.annotations.Comment;

@Entity
@Getter
@Setter
@Table(name = "tb_animal")
@Comment("동물 정보")
public class AnimalEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "animal_id")
  @Comment("동물 ID")
  private Long animalId;

  /**
   * 동물원 엔티티 (FK)
   */
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "zoo_id", nullable = false)
  @Comment("동물원 ID (FK)")
  private ZooEntity zoo;

  @Column(name = "animal_name", nullable = false)
  @Comment("동물 이름")
  private String animalName;

  @Column(name = "species")
  @Comment("종")
  private String species;

  @Column(name = "age")
  @Comment("나이")
  private Integer age;

  @Column(name = "use_yn", nullable = false)
  @Comment("사용 여부")
  private Boolean useYn = true;

  @Column(name = "del_yn", nullable = false)
  @Comment("삭제 여부")
  private Boolean delYn = false;

  @Column(name = "created_dttm", nullable = false)
  @Comment("생성 일시")
  private ZonedDateTime createdDttm = ZonedDateTime.now();

  @Column(name = "updated_dttm", nullable = false)
  @Comment("수정 일시")
  private ZonedDateTime updatedDttm = ZonedDateTime.now();
}