mailbox/backend/models/SentLog.js

49 lines
1,016 B
JavaScript
Raw Permalink Normal View History

2025-12-16 08:18:15 +09:00
/**
* 발송 로그 모델
* 메일 발송 이력을 기록 (보낸편지함에서 삭제해도 통계 유지)
*/
const { DataTypes } = require("sequelize");
const sequelize = require("../config/database");
const SentLog = sequelize.define(
"SentLog",
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
from: {
type: DataTypes.STRING,
allowNull: false,
comment: "발신자 이메일",
},
to: {
type: DataTypes.STRING,
allowNull: false,
comment: "수신자 이메일",
},
subject: {
type: DataTypes.STRING,
allowNull: true,
comment: "메일 제목",
},
success: {
type: DataTypes.BOOLEAN,
defaultValue: true,
comment: "발송 성공 여부",
},
sentAt: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
comment: "발송 시간",
},
},
{
tableName: "sent_logs",
timestamps: false,
}
);
module.exports = SentLog;