chore: relocate backend into apps/api ahead of monorepo merge

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-24 12:20:40 +08:00
co-authored by Claude Sonnet 5
parent af44598df6
commit eaa6d2276a
388 changed files with 0 additions and 13998 deletions
@@ -0,0 +1,25 @@
/***********************************************************************************************************************************************************************
* File Name : notificationVisibility.util.js
* Type : Utility
* Description : Shared visibility-window filter for AdminNotification/
* UserNotification rows carrying a denormalized start_date/
* end_date (copied from NotificationBroadcast at send time —
* see notificationBroadcasts.controller.js#sendBroadcast).
* Non-announcement notifications have both columns null, so
* this filter is a no-op for them.
*
* Author: Kenneth Obsequio (@lash0000)
* Date Created: Jul. 11, 2026
***********************************************************************************************************************************************************************/
const { Op } = require('sequelize');
function notInFutureOrExpired(now = new Date()) {
return {
[Op.and]: [
{ [Op.or]: [{ start_date: null }, { start_date: { [Op.lte]: now } }] },
{ [Op.or]: [{ end_date: null }, { end_date: { [Op.gte]: now } }] },
],
};
}
module.exports = { notInFutureOrExpired };