This commit is contained in:
2021-01-07 00:40:32 +00:00
parent 293fb99b02
commit 3f0ace04a3
2 changed files with 20 additions and 3 deletions

View File

@@ -227,12 +227,26 @@ namespace AyaNova.Biz
bool isNew = currentObj == null;
if (!isNew)
{
//if it was already accepted then it must stay accepted
if (currentObj.Status == CustomerServiceRequestStatus.Accepted && proposedObj.Status != CustomerServiceRequestStatus.Accepted)
{
AddError(ApiErrorCode.INVALID_OPERATION, "generalerror", "Already accepted, can't be changed");//User should never see this but an api user might as it's a form locked thing
}
}
//Name required BUT NOT REQUIRED TO BE UNIQUE
if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
//Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.CustomerServiceRequest.ToString());
if (FormCustomization != null)
@@ -251,6 +265,9 @@ namespace AyaNova.Biz
private void ValidateCanDelete(CustomerServiceRequest inObj)
{
//whatever needs to be check to delete this object
//can't delete if it's accepted
}
@@ -425,7 +442,7 @@ namespace AyaNova.Biz
//SPECIFIC EVENTS FOR THIS OBJECT
var o = (CustomerServiceRequest)proposedObj;
//CSR ACCEPTED
{
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.CSRAccepted).ToListAsync();

View File

@@ -22,8 +22,8 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 630;
internal const long EXPECTED_INDEX_COUNT = 175;
internal const long EXPECTED_COLUMN_COUNT = 645;
internal const long EXPECTED_INDEX_COUNT = 178;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!