This commit is contained in:
@@ -117,7 +117,7 @@ namespace AyaNova.Biz
|
|||||||
log.LogTrace($"HandlePotentialNotificationEvent processing: [AyaType:{ayaType}, AyaEvent:{ayaEvent}]");
|
log.LogTrace($"HandlePotentialNotificationEvent processing: [AyaType:{ayaType}, AyaEvent:{ayaEvent}]");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// var HasTags = inTags != null && inTags.Count > 0;
|
|
||||||
|
|
||||||
using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext)
|
using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
@@ -125,8 +125,33 @@ namespace AyaNova.Biz
|
|||||||
switch (ayaEvent)
|
switch (ayaEvent)
|
||||||
{
|
{
|
||||||
case AyaEvent.Created:
|
case AyaEvent.Created:
|
||||||
|
switch (ayaType)
|
||||||
|
{
|
||||||
|
//AyaTypes with their own special notification related events
|
||||||
|
|
||||||
|
|
||||||
|
case AyaType.WorkOrder:
|
||||||
|
break;
|
||||||
|
case AyaType.Quote:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
//ObjectCreated subscriptions
|
||||||
|
{
|
||||||
|
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.ObjectCreated && z.AyaType == ayaType).ToListAsync();
|
||||||
|
foreach (var sub in subs)
|
||||||
|
{
|
||||||
|
NotifyEvent n = new NotifyEvent() { EventType = NotifyEventType.ObjectCreated, UserId = sub.UserId, AyaType=ayaType,ObjectId=newObject.id, SubscriptionId = sub.Id };
|
||||||
|
await ct.NotifyEvent.AddAsync(n);
|
||||||
|
}
|
||||||
|
if (subs.Count > 0)
|
||||||
|
await ct.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case AyaEvent.Modified:
|
case AyaEvent.Modified:
|
||||||
|
break;
|
||||||
case AyaEvent.Deleted:
|
case AyaEvent.Deleted:
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user