package com.kospo.talk.model;

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 lombok.*;
import org.hibernate.annotations.ColumnDefault;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "auto_reply")
public class AutoReply {
    @EmbeddedId
    private AutoReplyId id;

    @Size(max = 200)
    @Column(name = "content", length = 200)
    private String content;

    @Size(max = 10)
    @Column(name = "ins_sabun", length = 10)
    private String insSabun;

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

    @ColumnDefault("CURRENT_TIMESTAMP")
    @Column(name = "ins_date")
    private LocalDateTime insDate;

/*
TODO [리버스 엔지니어링] 필드를 생성하여 'work_id' 열에 매핑
사용 가능한 액션: 현재 상태대로 주석 해제 | 열 매핑 제거
    @MapsId
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "work_id", nullable = false)
    private Work work;
*/
}