This commit is contained in:
@@ -3,12 +3,23 @@ using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using AyaNova.Models;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using AyaNova.Util;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Notification processor
|
||||
/// turn notifyEvent records into notifications for in app and deliver smtp
|
||||
///
|
||||
/// </summary>
|
||||
internal static class CoreJobNotify
|
||||
@@ -84,6 +95,24 @@ namespace AyaNova.Biz
|
||||
//todo: create message here if not already set?
|
||||
//todo: generate and attach report here?
|
||||
|
||||
//All items have an event date, for non time delayed events it's just the moment it was created
|
||||
//which will predate this moment now if it's pre-existing
|
||||
var items = await ct.NotifyEvent.Include(z => z.NotifySubscription).ToListAsync();
|
||||
|
||||
//iterate and deliver
|
||||
foreach(var item in items){
|
||||
//Time delayed ones:
|
||||
//when to deliver formula: NotifyEvent "EventDate"+NotifySubscription.AgeValue timespan - NotifySubscription AdvanceNotice timespan > utcNow
|
||||
if(item.)
|
||||
|
||||
//Immediate delivery items
|
||||
//
|
||||
if(item.EventDate)
|
||||
}
|
||||
|
||||
//turn notifyEvent records into notifications for in app and deliver smtp
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user