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 AdminNotification = sequelize.define('AdminNotification', {
notification_id: {
@@ -49,6 +50,14 @@ const AdminNotification = sequelize.define('AdminNotification', {
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: {
@@ -94,4 +103,6 @@ const AdminNotification = sequelize.define('AdminNotification', {
],
});
AdminNotification.belongsTo(mdl_Assets, { as: "image", foreignKey: "image_asset_id" });
module.exports = AdminNotification;