This commit is contained in:
@@ -322,7 +322,7 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||||
await PMSearchIndexAsync(putObject, false);
|
await PMSearchIndexAsync(putObject, false);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||||
await PMPopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
await PMPopulateVizFields(putObject, true, false);
|
||||||
await PMHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
await PMHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
@@ -576,15 +576,8 @@ namespace AyaNova.Biz
|
|||||||
.SingleOrDefaultAsync();
|
.SingleOrDefaultAsync();
|
||||||
w.ChildItemId = itemid;
|
w.ChildItemId = itemid;
|
||||||
return w;
|
return w;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//SEARCH
|
//SEARCH
|
||||||
//
|
//
|
||||||
@@ -612,7 +605,6 @@ namespace AyaNova.Biz
|
|||||||
searchParams.AddText(obj.Notes).AddText(obj.Serial).AddText(obj.Wiki).AddText(obj.Tags).AddCustomFields(obj.CustomFields);
|
searchParams.AddText(obj.Notes).AddText(obj.Serial).AddText(obj.Wiki).AddText(obj.Tags).AddCustomFields(obj.CustomFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//VALIDATION
|
//VALIDATION
|
||||||
//
|
//
|
||||||
@@ -635,7 +627,6 @@ namespace AyaNova.Biz
|
|||||||
return;//this is a completely disqualifying error
|
return;//this is a completely disqualifying error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Did they exclude *all* days of the week (int value 127)
|
//Did they exclude *all* days of the week (int value 127)
|
||||||
if ((int)proposedObj.ExcludeDaysOfWeek == 127)
|
if ((int)proposedObj.ExcludeDaysOfWeek == 127)
|
||||||
{
|
{
|
||||||
@@ -672,8 +663,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private async Task PMValidateCanDelete(PM dbObject)
|
private async Task PMValidateCanDelete(PM dbObject)
|
||||||
{
|
{
|
||||||
//Check restricted role preventing create
|
//Check restricted role preventing create
|
||||||
@@ -688,9 +677,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// GET PARTIAL WORKORDER FOR REPORTING
|
// GET PARTIAL WORKORDER FOR REPORTING
|
||||||
// (returns quote consisting only of the path from child or grandchild up to header populated
|
// (returns quote consisting only of the path from child or grandchild up to header populated
|
||||||
@@ -706,19 +692,13 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//get header only
|
//get header only
|
||||||
var ret = await ct.PM.AsNoTracking().SingleOrDefaultAsync(x => x.Id == wid.ParentId);
|
var ret = await ct.PM.AsNoTracking().SingleOrDefaultAsync(x => x.Id == wid.ParentId);
|
||||||
|
|
||||||
//not found don't bomb, just return null
|
//not found don't bomb, just return null
|
||||||
if (ret == null) return ret;
|
if (ret == null) return ret;
|
||||||
|
|
||||||
//explicit load subitems as required...
|
//explicit load subitems as required...
|
||||||
|
|
||||||
|
|
||||||
PMItem quoteitem = null;
|
PMItem quoteitem = null;
|
||||||
|
|
||||||
//it's requesting a fully populated woitem so do that here
|
//it's requesting a fully populated woitem so do that here
|
||||||
if (includeWoItemDescendants)
|
if (includeWoItemDescendants)
|
||||||
{
|
{
|
||||||
|
|
||||||
quoteitem = await ct.PMItem.AsSplitQuery()
|
quoteitem = await ct.PMItem.AsSplitQuery()
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(wi => wi.Expenses)
|
.Include(wi => wi.Expenses)
|
||||||
@@ -1119,8 +1099,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.PMItem, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.PMItem, AyaEvent.Created), ct);
|
||||||
await ItemSearchIndexAsync(newObject, true);
|
await ItemSearchIndexAsync(newObject, true);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
||||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await ItemPopulateVizFields(newObject, false);
|
await ItemPopulateVizFields(newObject, false);
|
||||||
|
await ItemHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1190,9 +1170,6 @@ namespace AyaNova.Biz
|
|||||||
await ItemValidateAsync(putObject, dbObject);
|
await ItemValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
@@ -1208,8 +1185,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, AyaType.PMItem, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, AyaType.PMItem, AyaEvent.Modified), ct);
|
||||||
await ItemSearchIndexAsync(putObject, false);
|
await ItemSearchIndexAsync(putObject, false);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await ItemPopulateVizFields(putObject, false);
|
await ItemPopulateVizFields(putObject, false);
|
||||||
|
await ItemHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1474,9 +1451,8 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await ExpenseSearchIndexAsync(newObject, true);
|
await ExpenseSearchIndexAsync(newObject, true);
|
||||||
|
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await ExpensePopulateVizFields(newObject);
|
await ExpensePopulateVizFields(newObject);
|
||||||
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1533,8 +1509,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await ExpenseSearchIndexAsync(putObject, false);
|
await ExpenseSearchIndexAsync(putObject, false);
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await ExpensePopulateVizFields(putObject);
|
await ExpensePopulateVizFields(putObject);
|
||||||
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1557,7 +1533,6 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -1669,7 +1644,6 @@ namespace AyaNova.Biz
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (proposedObj.PMItemId == 0)
|
if (proposedObj.PMItemId == 0)
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "PMItemId");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "PMItemId");
|
||||||
@@ -1771,7 +1745,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// NOTIFICATION PROCESSING
|
// NOTIFICATION PROCESSING
|
||||||
//
|
//
|
||||||
@@ -1829,8 +1802,8 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await LaborSearchIndexAsync(newObject, true);
|
await LaborSearchIndexAsync(newObject, true);
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await LaborPopulateVizFields(newObject);
|
await LaborPopulateVizFields(newObject);
|
||||||
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1869,7 +1842,6 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await LaborValidateAsync(putObject, dbObject);
|
await LaborValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
@@ -1887,9 +1859,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await LaborSearchIndexAsync(putObject, false);
|
await LaborSearchIndexAsync(putObject, false);
|
||||||
|
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await LaborPopulateVizFields(putObject);
|
await LaborPopulateVizFields(putObject);
|
||||||
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1912,7 +1883,6 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -2057,13 +2027,11 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
o.LineTotalViz = o.NetViz + o.TaxAViz + o.TaxBViz;
|
o.LineTotalViz = o.NetViz + o.TaxAViz + o.TaxBViz;
|
||||||
|
|
||||||
|
|
||||||
//RESTRICTIONS ON COST VISIBILITY?
|
//RESTRICTIONS ON COST VISIBILITY?
|
||||||
if (!UserCanViewLaborOrTravelRateCosts)
|
if (!UserCanViewLaborOrTravelRateCosts)
|
||||||
{
|
{
|
||||||
o.CostViz = 0;
|
o.CostViz = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2125,11 +2093,9 @@ namespace AyaNova.Biz
|
|||||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||||
|
|
||||||
//validate custom fields
|
//validate custom fields
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void LaborValidateCanDelete(PMItemLabor obj)
|
private void LaborValidateCanDelete(PMItemLabor obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
@@ -2219,9 +2185,8 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await LoanSearchIndexAsync(newObject, true);
|
await LoanSearchIndexAsync(newObject, true);
|
||||||
|
|
||||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await LoanPopulateVizFields(newObject);
|
await LoanPopulateVizFields(newObject);
|
||||||
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2275,9 +2240,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await LoanSearchIndexAsync(putObject, false);
|
await LoanSearchIndexAsync(putObject, false);
|
||||||
|
|
||||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await LoanPopulateVizFields(putObject);
|
await LoanPopulateVizFields(putObject);
|
||||||
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2620,9 +2584,8 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await OutsideServiceSearchIndexAsync(newObject, true);
|
await OutsideServiceSearchIndexAsync(newObject, true);
|
||||||
|
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await OutsideServicePopulateVizFields(newObject);
|
await OutsideServicePopulateVizFields(newObject);
|
||||||
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2657,10 +2620,6 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await OutsideServiceValidateAsync(putObject, dbObject);
|
await OutsideServiceValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
@@ -2678,10 +2637,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await OutsideServiceSearchIndexAsync(putObject, false);
|
await OutsideServiceSearchIndexAsync(putObject, false);
|
||||||
|
|
||||||
|
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await OutsideServicePopulateVizFields(putObject);
|
await OutsideServicePopulateVizFields(putObject);
|
||||||
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2704,7 +2661,6 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -2950,8 +2906,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await PartSearchIndexAsync(newObject, true);
|
await PartSearchIndexAsync(newObject, true);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
|
|
||||||
await PartPopulateVizFields(newObject);
|
await PartPopulateVizFields(newObject);
|
||||||
|
await PartHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2989,10 +2945,6 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await PartValidateAsync(putObject, dbObject);
|
await PartValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
await PartBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null);
|
await PartBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null);
|
||||||
@@ -3016,10 +2968,9 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await PartSearchIndexAsync(putObject, false);
|
await PartSearchIndexAsync(putObject, false);
|
||||||
|
|
||||||
await PartHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartPopulateVizFields(putObject);
|
await PartPopulateVizFields(putObject);
|
||||||
|
await PartHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3030,7 +2981,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var dbObject = await PartGetAsync(id, false);
|
var dbObject = await PartGetAsync(id, false);
|
||||||
@@ -3048,8 +2998,6 @@ namespace AyaNova.Biz
|
|||||||
//Log event
|
//Log event
|
||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -3280,7 +3228,6 @@ namespace AyaNova.Biz
|
|||||||
return;//this is a completely disqualifying error
|
return;//this is a completely disqualifying error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!await BizObjectExistsInDatabase.ExistsAsync(AyaType.Part, proposedObj.PartId, ct))
|
if (!await BizObjectExistsInDatabase.ExistsAsync(AyaType.Part, proposedObj.PartId, ct))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.NOT_FOUND, "PartId");
|
AddError(ApiErrorCode.NOT_FOUND, "PartId");
|
||||||
@@ -3304,7 +3251,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void PartValidateCanDelete(PMItemPart obj)
|
private void PartValidateCanDelete(PMItemPart obj)
|
||||||
{
|
{
|
||||||
if (UserIsRestrictedType)
|
if (UserIsRestrictedType)
|
||||||
@@ -3388,15 +3334,11 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await ct.PMItemScheduledUser.AddAsync(newObject);
|
await ct.PMItemScheduledUser.AddAsync(newObject);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
|
|
||||||
|
|
||||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await ScheduledUserPopulateVizFields(newObject);
|
await ScheduledUserPopulateVizFields(newObject);
|
||||||
|
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3430,9 +3372,6 @@ namespace AyaNova.Biz
|
|||||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await ScheduledUserValidateAsync(putObject, dbObject);
|
await ScheduledUserValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
@@ -3449,10 +3388,8 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
|
|
||||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await ScheduledUserPopulateVizFields(putObject);
|
await ScheduledUserPopulateVizFields(putObject);
|
||||||
|
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3474,8 +3411,6 @@ namespace AyaNova.Biz
|
|||||||
//Log event
|
//Log event
|
||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -3545,29 +3480,6 @@ namespace AyaNova.Biz
|
|||||||
if (proposedObj.StartDate > proposedObj.StopDate)
|
if (proposedObj.StartDate > proposedObj.StopDate)
|
||||||
AddError(ApiErrorCode.VALIDATION_STARTDATE_AFTER_ENDDATE, "StartDate");
|
AddError(ApiErrorCode.VALIDATION_STARTDATE_AFTER_ENDDATE, "StartDate");
|
||||||
|
|
||||||
|
|
||||||
//For now decision is to not check for sched conflicts on pm as it's not a work order yet anyway
|
|
||||||
// //Scheduling conflict?
|
|
||||||
// if (!AyaNova.Util.ServerGlobalBizSettings.Cache.AllowScheduleConflicts
|
|
||||||
// && proposedObj.UserId != null
|
|
||||||
// && proposedObj.StartDate != null
|
|
||||||
// && proposedObj.StopDate != null
|
|
||||||
// && (isNew
|
|
||||||
// || (proposedObj.StartDate != currentObj.StartDate)
|
|
||||||
// || (proposedObj.StopDate != currentObj.StopDate)
|
|
||||||
// || (proposedObj.UserId != currentObj.UserId)
|
|
||||||
// ))
|
|
||||||
// {
|
|
||||||
// if (await ct.PMItemScheduledUser.AnyAsync(x => x.Id != proposedObj.Id
|
|
||||||
// && x.UserId == proposedObj.UserId
|
|
||||||
// && x.StartDate <= proposedObj.StopDate
|
|
||||||
// && proposedObj.StartDate <= x.StopDate))
|
|
||||||
// {
|
|
||||||
// AddError(ApiErrorCode.VALIDATION_FAILED, "StartDate", await Translate("ScheduleConflict"));
|
|
||||||
// AddError(ApiErrorCode.VALIDATION_FAILED, "StopDate", await Translate("ScheduleConflict"));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.PMItemScheduledUser.ToString());
|
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.PMItemScheduledUser.ToString());
|
||||||
if (FormCustomization != null)
|
if (FormCustomization != null)
|
||||||
@@ -3578,11 +3490,9 @@ namespace AyaNova.Biz
|
|||||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||||
|
|
||||||
//validate custom fields
|
//validate custom fields
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ScheduledUserValidateCanDelete(PMItemScheduledUser obj)
|
private void ScheduledUserValidateCanDelete(PMItemScheduledUser obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
@@ -3662,15 +3572,12 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await ct.PMItemTask.AddAsync(newObject);
|
await ct.PMItemTask.AddAsync(newObject);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await TaskSearchIndexAsync(newObject, true);
|
await TaskSearchIndexAsync(newObject, true);
|
||||||
|
|
||||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await TaskPopulateVizFields(newObject);
|
await TaskPopulateVizFields(newObject);
|
||||||
|
await TaskHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3703,7 +3610,6 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await TaskValidateAsync(putObject, dbObject);
|
await TaskValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
@@ -3721,9 +3627,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await TaskSearchIndexAsync(dbObject, false);
|
await TaskSearchIndexAsync(dbObject, false);
|
||||||
|
|
||||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await TaskPopulateVizFields(putObject);
|
await TaskPopulateVizFields(putObject);
|
||||||
|
await TaskHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3746,7 +3651,6 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||||
|
|
||||||
|
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
@@ -3857,12 +3761,9 @@ namespace AyaNova.Biz
|
|||||||
//validate users choices for required non custom fields
|
//validate users choices for required non custom fields
|
||||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||||
|
|
||||||
//validate custom fields
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TaskValidateCanDelete(PMItemTask obj)
|
private void TaskValidateCanDelete(PMItemTask obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
@@ -3946,8 +3847,8 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await TravelSearchIndexAsync(newObject, true);
|
await TravelSearchIndexAsync(newObject, true);
|
||||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await TravelPopulateVizFields(newObject);
|
await TravelPopulateVizFields(newObject);
|
||||||
|
await TravelHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4002,9 +3903,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await TravelSearchIndexAsync(putObject, false);
|
await TravelSearchIndexAsync(putObject, false);
|
||||||
|
|
||||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await TravelPopulateVizFields(putObject);
|
await TravelPopulateVizFields(putObject);
|
||||||
|
await TravelHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4224,13 +4124,9 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//validate users choices for required non custom fields
|
//validate users choices for required non custom fields
|
||||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||||
|
|
||||||
//validate custom fields
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TravelValidateCanDelete(PMItemTravel obj)
|
private void TravelValidateCanDelete(PMItemTravel obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
@@ -4255,8 +4151,6 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// NOTIFICATION PROCESSING
|
// NOTIFICATION PROCESSING
|
||||||
//
|
//
|
||||||
@@ -4309,16 +4203,11 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<PMItemUnit> UnitCreateAsync(PMItemUnit newObject)
|
internal async Task<PMItemUnit> UnitCreateAsync(PMItemUnit newObject)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await UnitValidateAsync(newObject, null);
|
await UnitValidateAsync(newObject, null);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
|
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
|
||||||
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||||
await ct.PMItemUnit.AddAsync(newObject);
|
await ct.PMItemUnit.AddAsync(newObject);
|
||||||
@@ -4326,9 +4215,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||||
await UnitSearchIndexAsync(newObject, true);
|
await UnitSearchIndexAsync(newObject, true);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
||||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
||||||
await UnitPopulateVizFields(newObject, false);
|
await UnitPopulateVizFields(newObject, false);
|
||||||
|
await UnitHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4368,7 +4256,6 @@ namespace AyaNova.Biz
|
|||||||
await UnitValidateAsync(putObject, dbObject);
|
await UnitValidateAsync(putObject, dbObject);
|
||||||
if (HasErrors) return null;
|
if (HasErrors) return null;
|
||||||
|
|
||||||
|
|
||||||
ct.Replace(dbObject, putObject);
|
ct.Replace(dbObject, putObject);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -4385,10 +4272,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||||
await UnitSearchIndexAsync(putObject, false);
|
await UnitSearchIndexAsync(putObject, false);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
||||||
await UnitPopulateVizFields(putObject, false);
|
await UnitPopulateVizFields(putObject, false);
|
||||||
|
await UnitHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
|
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||||
await QuoteSearchIndexAsync(putObject, false);
|
await QuoteSearchIndexAsync(putObject, false);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||||
await QuotePopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
await QuotePopulateVizFields(putObject, true, false);
|
||||||
await QuoteHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
await QuoteHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,11 +349,8 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||||
await WorkOrderSearchIndexAsync(putObject, false);
|
await WorkOrderSearchIndexAsync(putObject, false);
|
||||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||||
await WorkOrderPopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
await WorkOrderPopulateVizFields(putObject, true, false);
|
||||||
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return putObject;
|
return putObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user