This commit is contained in:
2021-05-13 19:09:53 +00:00
parent 3f2fd43030
commit 4b4426e1ec

View File

@@ -81,6 +81,18 @@ namespace AyaNova.Biz
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.Created), ct);
await WorkOrderSearchIndexAsync(newObject, true);
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
//Was this a full workorder posted all at once?
//(seeder or api user, not something AyaNova front end would do)
if (newObject.Items.Count > 0)//our front end will post the header alone on new so this indicates a fully populated wo was saved
{
if (newObject.ContractId != null)
mContractInEffect = await ct.Contract.AsNoTracking().FirstOrDefaultAsync(z => z.Id == newObject.ContractId);
mFetchedContractAlready = true;
await ProcessChangeOfContractAsync(newObject.Id);
}
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
return newObject;
}