added and fix some of things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-03 12:03:02 +08:00
parent 6765c1faba
commit d246c09cdd
31 changed files with 724 additions and 510 deletions
@@ -10,6 +10,7 @@
***********************************************************************************************************************************************************************/
const { DataTypes } = require('sequelize');
const sequelize = require('../../config/db.config');
const mdl_Assets = require('../assets/assets.mdl');
const UserNotification = sequelize.define('UserNotification', {
notification_id: {
@@ -55,6 +56,14 @@ const UserNotification = sequelize.define('UserNotification', {
defaultValue: 'indigo',
},
// Denormalized copy of the source NotificationBroadcast's per-alert
// layout image (see notification_broadcast.mdl.js) — null when the
// alert has none.
image_asset_id: {
type: DataTypes.BIGINT,
allowNull: true,
},
// Denormalized copy of the source NotificationBroadcast's visibility
// window (see notificationVisibility.util.js) — null means unbounded.
start_date: {
@@ -101,4 +110,6 @@ const UserNotification = sequelize.define('UserNotification', {
],
});
UserNotification.belongsTo(mdl_Assets, { as: "image", foreignKey: "image_asset_id" });
module.exports = UserNotification;