package message

import "github.com/tidbcloud/devops/models/base"

type EmailRecord struct {
	base.Base

	Name              string `gorm:"type:VARCHAR(1024)"`
	Reason            string `gorm:"type:VARCHAR(1024)"`
	Applicant         string `gorm:"type:VARCHAR(255);not null"` // email
	ToTarget          []byte `gorm:"type:JSON"`
	CCTarget          []byte `gorm:"type:JSON"`
	EmailTemplateID   string `gorm:"type:VARCHAR(255);not null"`
	EmailTemplateVars []byte `gorm:"type:JSON"`
	FromAddress       string `gorm:"type:VARCHAR(255);not null"`
	ToAddresses       string `gorm:"type:TEXT"`
	CCAddresses       string `gorm:"type:VARCHAR(4096)"`
	BCCAddresses      string `gorm:"type:VARCHAR(4096)"`
}

func (_ EmailRecord) TableName() string {
	return "message_email_records"
}
