|
|
|
@@ -2369,7 +2369,7 @@ 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 ExpenseHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await ExpensePopulateVizFields(newObject);
|
|
|
|
await ExpensePopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -2451,8 +2451,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -2732,13 +2732,13 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemLabor.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemLabor.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 LaborSearchIndexAsync(newObject, true);
|
|
|
|
await LaborSearchIndexAsync(newObject, true);
|
|
|
|
|
|
|
|
|
|
|
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await LaborPopulateVizFields(newObject);
|
|
|
|
await LaborPopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -2797,7 +2797,7 @@ 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 LaborHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await LaborPopulateVizFields(putObject);
|
|
|
|
await LaborPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -2821,8 +2821,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -3048,7 +3048,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3139,7 +3139,7 @@ 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 LoanHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await LoanPopulateVizFields(newObject);
|
|
|
|
await LoanPopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -3195,7 +3195,7 @@ 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 LoanHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await LoanPopulateVizFields(putObject);
|
|
|
|
await LoanPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -3219,8 +3219,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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 LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
@@ -3452,7 +3452,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3546,12 +3546,12 @@ namespace AyaNova.Biz
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
|
|
|
|
// newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemOutsideService.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemOutsideService.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 OutsideServiceSearchIndexAsync(newObject, true);
|
|
|
|
await OutsideServiceSearchIndexAsync(newObject, true);
|
|
|
|
|
|
|
|
|
|
|
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await OutsideServicePopulateVizFields(newObject);
|
|
|
|
await OutsideServicePopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -3605,7 +3605,7 @@ 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 OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await OutsideServicePopulateVizFields(putObject);
|
|
|
|
await OutsideServicePopulateVizFields(putObject);
|
|
|
|
@@ -3630,8 +3630,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -3778,7 +3778,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4017,8 +4017,8 @@ namespace AyaNova.Biz
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await PartBizActionsAsync(AyaEvent.Created, newObject, null, null);
|
|
|
|
await PartBizActionsAsync(AyaEvent.Created, newObject, null, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemPart.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemPart.AddAsync(newObject);
|
|
|
|
await ct.SaveChangesAsync();
|
|
|
|
await ct.SaveChangesAsync();
|
|
|
|
await PartInventoryAdjustmentAsync(AyaEvent.Created, newObject, null, transaction);
|
|
|
|
await PartInventoryAdjustmentAsync(AyaEvent.Created, newObject, null, transaction);
|
|
|
|
@@ -4030,7 +4030,7 @@ 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);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -4070,8 +4070,8 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await PartValidateAsync(putObject, dbObject);
|
|
|
|
await PartValidateAsync(putObject, dbObject);
|
|
|
|
if (HasErrors) return null;
|
|
|
|
if (HasErrors) return null;
|
|
|
|
@@ -4097,7 +4097,7 @@ 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 PartHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await transaction.CommitAsync();
|
|
|
|
await transaction.CommitAsync();
|
|
|
|
await PartPopulateVizFields(putObject);
|
|
|
|
await PartPopulateVizFields(putObject);
|
|
|
|
@@ -4130,8 +4130,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -4542,7 +4542,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4629,13 +4629,13 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemPartRequest.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemPartRequest.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 PartRequestSearchIndexAsync(newObject, true);
|
|
|
|
//await PartRequestSearchIndexAsync(newObject, true);
|
|
|
|
|
|
|
|
|
|
|
|
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await PartRequestPopulateVizFields(newObject);
|
|
|
|
await PartRequestPopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -4671,8 +4671,8 @@ namespace AyaNova.Biz
|
|
|
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
|
|
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await PartRequestValidateAsync(putObject, dbObject);
|
|
|
|
await PartRequestValidateAsync(putObject, dbObject);
|
|
|
|
if (HasErrors) return null;
|
|
|
|
if (HasErrors) return null;
|
|
|
|
ct.Replace(dbObject, putObject);
|
|
|
|
ct.Replace(dbObject, putObject);
|
|
|
|
@@ -4689,8 +4689,8 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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 PartRequestHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await PartRequestPopulateVizFields(putObject);
|
|
|
|
await PartRequestPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -4714,8 +4714,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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 PartRequestHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
@@ -4819,7 +4819,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4905,13 +4905,13 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemScheduledUser.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemScheduledUser.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 ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await ScheduledUserPopulateVizFields(newObject);
|
|
|
|
await ScheduledUserPopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -4948,8 +4948,8 @@ namespace AyaNova.Biz
|
|
|
|
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);
|
|
|
|
@@ -4966,8 +4966,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 ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await ScheduledUserPopulateVizFields(putObject);
|
|
|
|
await ScheduledUserPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -4991,8 +4991,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -5076,6 +5076,7 @@ namespace AyaNova.Biz
|
|
|
|
|
|
|
|
|
|
|
|
//Scheduling conflict?
|
|
|
|
//Scheduling conflict?
|
|
|
|
if (!AyaNova.Util.ServerGlobalBizSettings.Cache.AllowScheduleConflicts
|
|
|
|
if (!AyaNova.Util.ServerGlobalBizSettings.Cache.AllowScheduleConflicts
|
|
|
|
|
|
|
|
&& proposedObj.IsPMGenerated == false
|
|
|
|
&& proposedObj.UserId != null
|
|
|
|
&& proposedObj.UserId != null
|
|
|
|
&& proposedObj.StartDate != null
|
|
|
|
&& proposedObj.StartDate != null
|
|
|
|
&& proposedObj.StopDate != null
|
|
|
|
&& proposedObj.StopDate != null
|
|
|
|
@@ -5106,7 +5107,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5306,13 +5307,13 @@ namespace AyaNova.Biz
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ct.WorkOrderItemTask.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemTask.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 TaskHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
|
|
|
await TaskPopulateVizFields(newObject);
|
|
|
|
await TaskPopulateVizFields(newObject);
|
|
|
|
return newObject;
|
|
|
|
return newObject;
|
|
|
|
@@ -5346,8 +5347,8 @@ namespace AyaNova.Biz
|
|
|
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
|
|
|
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
|
|
|
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);
|
|
|
|
@@ -5365,7 +5366,7 @@ 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 TaskHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await TaskPopulateVizFields(putObject);
|
|
|
|
await TaskPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -5389,8 +5390,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);//Fix??
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.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);
|
|
|
|
@@ -5513,7 +5514,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5657,7 +5658,7 @@ 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 TravelHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
|
|
|
await TravelPopulateVizFields(putObject);
|
|
|
|
await TravelPopulateVizFields(putObject);
|
|
|
|
return putObject;
|
|
|
|
return putObject;
|
|
|
|
@@ -5681,8 +5682,8 @@ namespace AyaNova.Biz
|
|
|
|
//Log event
|
|
|
|
//Log event
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);
|
|
|
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "woitem:" + dbObject.WorkOrderItemId.ToString(), ct);
|
|
|
|
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 TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
await TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
|
|
|
@@ -5893,7 +5894,7 @@ 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5976,8 +5977,8 @@ namespace AyaNova.Biz
|
|
|
|
//
|
|
|
|
//
|
|
|
|
internal async Task<WorkOrderItemUnit> UnitCreateAsync(WorkOrderItemUnit newObject)
|
|
|
|
internal async Task<WorkOrderItemUnit> UnitCreateAsync(WorkOrderItemUnit newObject)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await UnitValidateAsync(newObject, null);
|
|
|
|
await UnitValidateAsync(newObject, null);
|
|
|
|
@@ -5985,7 +5986,7 @@ namespace AyaNova.Biz
|
|
|
|
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.WorkOrderItemUnit.AddAsync(newObject);
|
|
|
|
await ct.WorkOrderItemUnit.AddAsync(newObject);
|
|
|
|
@@ -6193,7 +6194,7 @@ namespace AyaNova.Biz
|
|
|
|
// if (ServerBootConfig.SEEDING) return;
|
|
|
|
// if (ServerBootConfig.SEEDING) return;
|
|
|
|
|
|
|
|
|
|
|
|
// - A work order *MUST* have only one Unit with a Contract, if there is already a unit with a contract on this workorder then a new one cannot be added and it will reject with a validation error
|
|
|
|
// - A work order *MUST* have only one Unit with a Contract, if there is already a unit with a contract on this workorder then a new one cannot be added and it will reject with a validation error
|
|
|
|
|
|
|
|
|
|
|
|
//run validation and biz rules
|
|
|
|
//run validation and biz rules
|
|
|
|
bool isNew = currentObj == null;
|
|
|
|
bool isNew = currentObj == null;
|
|
|
|
|
|
|
|
|
|
|
|
|