This commit is contained in:
@@ -127,18 +127,52 @@ namespace AyaNova.Biz
|
||||
switch (ayaEvent)
|
||||
{
|
||||
case AyaEvent.Created:
|
||||
//------------------------------
|
||||
//Specific created related subscriptions for AyaType
|
||||
switch (newObject.AyaType)
|
||||
{
|
||||
//AyaTypes with their own special notification related events
|
||||
|
||||
|
||||
case AyaType.WorkOrder:
|
||||
{
|
||||
//WorkorderStatusChange
|
||||
//ScheduledOnWorkorder
|
||||
//ScheduledOnWorkorderImminent
|
||||
//tentative WorkorderCloseByPassed
|
||||
//OutsideServiceOverdue
|
||||
//OutsideServiceReceived
|
||||
//PartRequestReceived
|
||||
//CustomerServiceImminent
|
||||
//PartRequested
|
||||
//WorkorderTotalExceedsThreshold
|
||||
//WorkorderStatusAge
|
||||
}
|
||||
break;
|
||||
case AyaType.Quote:
|
||||
//QuoteStatusChange
|
||||
//QuoteStatusAge
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
//ObjectAge
|
||||
{
|
||||
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.ObjectAge && z.AyaType == newObject.AyaType).ToListAsync();
|
||||
foreach (var sub in subs)
|
||||
{
|
||||
if (TagsMatch(newObject.Tags, sub.Tags))
|
||||
{
|
||||
NotifyEvent n = new NotifyEvent() {
|
||||
EventType = NotifyEventType.ObjectAge, UserId = sub.UserId, AyaType = newObject.AyaType, ObjectId = newObject.Id,
|
||||
SubscriptionId = sub.Id, EventDate=DateTime.UtcNow
|
||||
};
|
||||
await ct.NotifyEvent.AddAsync(n);
|
||||
log.LogTrace($"Adding NotifyEvent: [{n.ToString()}]");
|
||||
SaveContext = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------
|
||||
//General ObjectCreated subscriptions
|
||||
{
|
||||
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.ObjectCreated && z.AyaType == newObject.AyaType).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user