/
leflop
/
queue_system_backend
Обзор
Документация
Войти
/
leflop
/
queue_system_backend
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
models/notification.js
55 строк
1 KB
leflop
Initial commit. Auth endpoints finished, some queue management endpoints also done.
03 авг 2025, 13:39
03 авг 2025, 13:39
afbd732
Код
Авторство
О чём код?
const { DataTypes } = require('sequelize'); module.exports = (sequelize) => { const Notification = sequelize.define("Notification", { id: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true, allowNull: false }, type: { type: DataTypes.ENUM('next_in_line', 'swap_request', 'swap_accepted', 'swap_rejected', 'someone_skipped', 'queue_update'), allowNull: false }, title: { type: DataTypes.STRING, allowNull: false, validate: { len: [1, 50] } }, message: { type: DataTypes.TEXT, allowNull: false, validate: { len: [1, 200] } }, is_read: { type: DataTypes.BOOLEAN, defaultValue: false, allowNull: false }, data: { type: DataTypes.JSONB, allowNull: true } }, { tableName: 'notifications', timestamps: true, indexes: [ { fields: ['user_id', 'is_read'] }, { fields: ['type'] }, { fields: ['createdAt'] } ] }); return Notification; }