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

import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
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_member_archived")
public class MemberArchivedEntity {

  @EmbeddedId private MemberArchivedEntityId id;

  @Size(max = 50)
  @Column(name = "employee_no", length = 50)
  private String employeeNo;

  @Size(max = 100)
  @NotNull
  @Column(name = "name", nullable = false, length = 100)
  private String name;

  @Size(max = 255)
  @NotNull
  @Column(name = "password", nullable = false)
  private String password;

  @Size(max = 100)
  @NotNull
  @Column(name = "email", nullable = false, length = 100)
  private String email;

  @Size(max = 20)
  @Column(name = "status", length = 20)
  private String status;

  @NotNull
  @Column(name = "created_dttm", nullable = false)
  private ZonedDateTime createdDttm;

  @NotNull
  @ColumnDefault("now()")
  @Column(name = "archived_dttm", nullable = false)
  private ZonedDateTime archivedDttm;
}
