This commit is contained in:
@@ -273,10 +273,10 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,10 +305,10 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,15 +337,52 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//VALIDATE CONTRACT RATE / PART ITEMS
|
||||
if (proposedObj.ServiceRateItems.Count ==0)
|
||||
{
|
||||
if(proposedObj.ContractServiceRatesOnly){
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, $"ContractRatesOnly");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
List<string> allTags = new List<string>();
|
||||
|
||||
for (int i = 0; i < proposedObj.ContractPartOverrideItems.Count; i++)
|
||||
{
|
||||
var item = proposedObj.ContractPartOverrideItems[i];
|
||||
if (item.Tags.Count < 1)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Tags");
|
||||
else
|
||||
{
|
||||
//add to list, check for dupes
|
||||
foreach (string s in item.Tags)
|
||||
{
|
||||
if (allTags.Contains(s))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, $"ContractPartOverrideItems[{i}].Tags");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
allTags.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.Override == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].Override");
|
||||
if (item.OverrideType == ContractOverrideType.NotSet)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, $"ContractPartOverrideItems[{i}].OverrideType");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user