case 4504

This commit is contained in:
2023-04-14 19:54:51 +00:00
parent 11c7637d4e
commit 85ccbdae58
6 changed files with 178 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ namespace Sockeye.Biz
//
internal async Task<Subscription> CreateAsync(Subscription newObject)
{
await ValidateAsync(newObject, null);
if (HasErrors)
return null;
@@ -201,10 +201,21 @@ namespace Sockeye.Biz
private async Task ValidateAsync(Subscription proposedObj, Subscription currentObj)
{
await Task.CompletedTask;
// bool isNew = currentObj == null;
bool isNew = currentObj == null;
//Name required
if (string.IsNullOrWhiteSpace(proposedObj.Subsite))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "SubSite");
//MISC / NOTSET product group are not valid for keys
if (proposedObj.PGroup == ProductGroup.Misc || proposedObj.PGroup == ProductGroup.NotSet)
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "pGroup");
return;
}
await Task.CompletedTask;
}