diff --git a/server/AyaNova/biz/CustomerNotifySubscriptionBiz.cs b/server/AyaNova/biz/CustomerNotifySubscriptionBiz.cs index 55087f37..7a6e6fe6 100644 --- a/server/AyaNova/biz/CustomerNotifySubscriptionBiz.cs +++ b/server/AyaNova/biz/CustomerNotifySubscriptionBiz.cs @@ -38,7 +38,7 @@ namespace AyaNova.Biz // internal async Task CreateAsync(CustomerNotifySubscription newObject) { - await ValidateAsync(newObject); + ValidateAsync(newObject); if (HasErrors) return null; else @@ -87,7 +87,7 @@ namespace AyaNova.Biz } putObject.CustomerTags = TagBiz.NormalizeTags(putObject.CustomerTags); putObject.Tags = TagBiz.NormalizeTags(putObject.Tags); - await ValidateAsync(putObject); + ValidateAsync(putObject); if (HasErrors) return null; ct.Replace(dbObject, putObject); if (HasErrors) return null; @@ -159,9 +159,21 @@ namespace AyaNova.Biz //////////////////////////////////////////////////////////////////////////////////////////////// //VALIDATION // - private async Task ValidateAsync(CustomerNotifySubscription proposedObj) + private void ValidateAsync(CustomerNotifySubscription proposedObj) { - await Task.CompletedTask; + if (string.IsNullOrWhiteSpace(proposedObj.CurrencyName)) + AddError(ApiErrorCode.VALIDATION_REQUIRED, "CurrencyName"); + + if (string.IsNullOrWhiteSpace(proposedObj.LanguageOverride)) + AddError(ApiErrorCode.VALIDATION_REQUIRED, "LanguageOverride"); + + if (string.IsNullOrWhiteSpace(proposedObj.TimeZoneOverride)) + AddError(ApiErrorCode.VALIDATION_REQUIRED, "TimeZoneOverride"); + + if (proposedObj.TranslationId == 0) + AddError(ApiErrorCode.VALIDATION_REQUIRED, "TranslationId"); + + }