This commit is contained in:
2021-02-16 16:11:24 +00:00
parent 18d711d869
commit 8ba9b393ba
2 changed files with 30 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ namespace AyaNova.Biz
NotifyHealthCheck = 19,//* NO OBJECT, direct subscription to receive recurring daily notify system "ping" sent out between 8am and 10am once every 24 hours minimum every day server local time
BackupStatus = 20,//* NO OBJECT, direct subscription to receive results of last backup operation
CustomerServiceImminent = 21,//* Workorder / WorkorderItemScheduledUser object, notice that scheduled service is due, can set advance notice, CUSTOMER gets delivery
PartRequested = 22,//* Workorder object / workorderitempartrequest created tag filterable
PartRequested = 22,//?? HOL UP, isn't this covered by objectCreated?* Workorder object / workorderitempartrequest created tag filterable
WorkorderTotalExceedsThreshold = 23,//* "the Andy" Workorder updated / created, based on balance total so conditional on DecValue
WorkorderStatusAge = 24,//* Workorder object Created / Updated, conditional on exact status selected IdValue, Tags conditional, advance notice can be set
UnitWarrantyExpiry = 25,//* Unit object created, advance notice can be used, tag conditional
@@ -47,6 +47,7 @@ namespace AyaNova.Biz
//POTENTIAL OTHER NOTIFICATIONS:
//WorkorderItemLoan unit is overdue from estimate
//NEW ITEMS REQUIRE translation KEYS
}

View File

@@ -403,12 +403,39 @@ namespace AyaNova.Biz
bool isNew = currentObj == null;
//STANDARD EVENTS FOR ALL OBJECTS
await NotifyEventHelper.ProcessStandardObjectEvents(ayaEvent, proposedObj, ct);
//SPECIFIC EVENTS FOR THIS OBJECT
//CREATED / MODIFIED
if (ayaEvent == AyaEvent.Created || ayaEvent == AyaEvent.Modified)
{
//PartRequestReceived event?
{
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.PartRequestReceived).ToListAsync();
if (subs.Count > 0)
{
var p = (PurchaseOrder)proposedObj;
var c = (PurchaseOrder)currentObj;
//Look for new receipts of requested parts
foreach (var proposedpoitem in p.Items.Where(z => z.WorkorderItemPartRequestId != null && z.QuantityReceived != 0))
{
//Get the matching item from db collection
var currentpoitem = c.Items.FirstOrDefault(z => z.Id == proposedpoitem.Id);
//if it doesn't exist or received less than the proposed item then we have actionable notification
if (currentpoitem == null || currentpoitem.QuantityReceived < proposedpoitem.QuantityReceived)
{
}
}
}
}
}
}//end of process notifications