package com.ffii.fpsms.modules.common.mail.entity

import com.ffii.core.entity.BaseEntity
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.time.LocalDateTime

@Entity
@Table(name = "mail_send_log")
open class MailSendLog : BaseEntity<Long>() {

    @NotNull
    @ManyToOne
    @JoinColumn(name = "tempId", nullable = false)
    open var temp: MailSendLog? = null

    @Size(max = 255)
    @NotNull
    @Column(name = "tempDesc", nullable = false)
    open var tempDesc: String? = null

    @Size(max = 255)
    @Column(name = "senderMail")
    open var senderMail: String? = null

    @Column(name = "subject")
    open var subject: String? = null

    @Lob
    @Column(name = "content")
    open var content: String? = null

    @Column(name = "sendDate")
    open var sendDate: LocalDateTime? = null

    @Lob
    @Column(name = "errorMessage")
    open var errorMessage: String? = null
}