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; 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 //Name required BUT NOT REQUIRED TO BE UNIQUE
if (string.IsNullOrWhiteSpace(proposedObj.Name)) if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
//Any form customizations to validate? //Any form customizations to validate?
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.CustomerServiceRequest.ToString()); var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.CustomerServiceRequest.ToString());
if (FormCustomization != null) if (FormCustomization != null)
@@ -251,6 +265,9 @@ namespace AyaNova.Biz
private void ValidateCanDelete(CustomerServiceRequest inObj) private void ValidateCanDelete(CustomerServiceRequest inObj)
{ {
//whatever needs to be check to delete this object //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 //SPECIFIC EVENTS FOR THIS OBJECT
var o = (CustomerServiceRequest)proposedObj; var o = (CustomerServiceRequest)proposedObj;
//CSR ACCEPTED //CSR ACCEPTED
{ {
var subs = await ct.NotifySubscription.Where(z => z.EventType == NotifyEventType.CSRAccepted).ToListAsync(); 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!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15; private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 630; internal const long EXPECTED_COLUMN_COUNT = 645;
internal const long EXPECTED_INDEX_COUNT = 175; internal const long EXPECTED_INDEX_COUNT = 178;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!