fcsc_ipi_backend/app/models/notificationTemplate.model.js
2025-11-21 16:11:51 +05:30

52 lines
1.2 KiB
JavaScript

module.exports = (sequelize, DataTypes) => {
const NotificationTemplate = sequelize.define(
"notification_templates",
{
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
title: {
type: DataTypes.STRING,
allowNull: false,
},
template_code: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
subject: {
type: DataTypes.STRING,
allowNull: true,
},
body_html: {
type: DataTypes.TEXT,
allowNull: false,
},
placeholders: {
type: DataTypes.JSON,
allowNull: true,
},
is_active: {
type: DataTypes.BOOLEAN,
defaultValue: true,
},
created_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
},
updated_at: {
type: DataTypes.DATE,
allowNull: true,
}
},
{
tableName: "notification_templates",
timestamps: false,
}
);
return NotificationTemplate;
};