From 0ea991b8f3f24fd3f1cce51348ce5b6e2d98b0ab Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 7 Mar 2022 20:12:13 +0000 Subject: [PATCH] --- server/AyaNova/biz/QuoteBiz.cs | 22 +++++++++++----------- server/AyaNova/util/AySchema.cs | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/server/AyaNova/biz/QuoteBiz.cs b/server/AyaNova/biz/QuoteBiz.cs index 4f56f2ee..e2cee2ce 100644 --- a/server/AyaNova/biz/QuoteBiz.cs +++ b/server/AyaNova/biz/QuoteBiz.cs @@ -1277,37 +1277,37 @@ namespace AyaNova.Biz } }//quote status change event - { + { //PROXY CUSTOMER NOTIFICATION SUBSCRIPTION HANDLING //can this customer even be delivered to? var custInfo = await ct.Customer.AsNoTracking().Where(x => x.Id == QuoteInfo.CustomerId).Select(x => new { x.Active, x.Tags, x.EmailAddress }).FirstOrDefaultAsync(); if (custInfo != null && custInfo.Active && !string.IsNullOrWhiteSpace(custInfo.EmailAddress)) - { + { //Conditions: must match specific status id value and also tags below //delivery is immediate so no need to remove old ones of this kind //note order by id ascending so that only the oldest notification "wins" as per docs in case of overlap to same customer - var subs = await ct.CustomerNotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.QuoteStatusChange && z.IdValue == oProposed.QuoteStatusId).OrderBy(z=>z.Id).ToListAsync(); + var subs = await ct.CustomerNotifySubscription.AsNoTracking().Where(z => z.EventType == NotifyEventType.QuoteStatusChange && z.IdValue == oProposed.QuoteStatusId).OrderBy(z => z.Id).ToListAsync(); foreach (var sub in subs) { //Object tags must match and Customer tags must match if (NotifyEventHelper.ObjectHasAllSubscriptionTags(QuoteInfo.Tags, sub.Tags) && NotifyEventHelper.ObjectHasAllSubscriptionTags(custInfo.Tags, sub.CustomerTags)) { - - - - NotifyEvent n = new NotifyEvent() + + + + CustomerNotifyEvent n = new CustomerNotifyEvent() { EventType = NotifyEventType.QuoteStatusChange, - UserId = sub.UserId, + CustomerId = QuoteInfo.CustomerId, AyaType = AyaType.Quote, ObjectId = oProposed.QuoteId, - NotifySubscriptionId = sub.Id, + CustomerNotifySubscriptionId = sub.Id, Name = $"{QuoteInfo.Serial.ToString()} - {qos.Name}" }; - await ct.NotifyEvent.AddAsync(n); - log.LogDebug($"Adding NotifyEvent: [{n.ToString()}]"); + await ct.CustomerNotifyEvent.AddAsync(n); + log.LogDebug($"Adding CustomerNotifyEvent: [{n.ToString()}]"); await ct.SaveChangesAsync(); break;//we have a match no need to process any further subs for this event } diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 41b7bfd5..f076c58f 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -22,16 +22,16 @@ namespace AyaNova.Util //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! private const int DESIRED_SCHEMA_LEVEL = 1; - internal const long EXPECTED_COLUMN_COUNT = 1342; - internal const long EXPECTED_INDEX_COUNT = 154; - internal const long EXPECTED_CHECK_CONSTRAINTS = 533; - internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 199; + internal const long EXPECTED_COLUMN_COUNT = 1353; + internal const long EXPECTED_INDEX_COUNT = 155; + internal const long EXPECTED_CHECK_CONSTRAINTS = 542; + internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 201; internal const long EXPECTED_VIEWS = 11; internal const long EXPECTED_ROUTINES = 2; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! - ///////////////////////////////////////// C1341:I154:CC532:FC199:V11:R2) + ///////////////////////////////////////// (C1353:I155:CC542:FC201:V11:R2) /*