package kr.co.zioinfo.web.model;

import jakarta.persistence.*;
import jakarta.validation.constraints.*;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;

@Entity @Table(name = "inquiry")
@Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class Inquiry {
    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotBlank @Column(nullable = false, length = 50)
    private String name;

    @NotBlank @Email @Column(nullable = false, length = 100)
    private String email;

    @Column(length = 30)
    private String phone;

    @NotBlank @Column(nullable = false, length = 200)
    private String subject;

    @NotBlank @Column(nullable = false, columnDefinition = "TEXT")
    private String content;

    @Column(length = 50)
    private String category;   // 제품문의 | 기술지원 | 사업제안 | 기타

    private boolean agreePrivacy = false;
    private String status = "PENDING";   // PENDING | ANSWERED

    @CreatedDate
    private LocalDateTime createdAt;
}
