case 4762 - direct email to a user: messages say "User", not "Vendor"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 17:32:20 -07:00
parent 413af08918
commit 7d440530b3
3 changed files with 5 additions and 3 deletions

View File

@@ -339,10 +339,11 @@ namespace AyaNova.Api.Controllers
bool isContact = o.UserType == UserType.Customer || o.UserType == UserType.HeadOffice;
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.User) && !(isContact && Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer)))
return StatusCode(403, new ApiNotAuthorizedResponse());
//case 4762: these said "Vendor"
if (string.IsNullOrWhiteSpace(o.EmailAddress))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_MISSING_PROPERTY, "EmailAddress", $"Vendor {o.Name} doesn't have an email address no where to send this"));
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_MISSING_PROPERTY, "EmailAddress", $"User {o.Name} doesn't have an email address no where to send this"));
if (o.Active == false)
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "Active", $"Vendor {o.Name} is not active, only active Vendors can be emailed directly"));
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "Active", $"User {o.Name} is not active, only active users can be emailed directly"));
notifyDirectSMTP.ToAddress = o.EmailAddress;
}
break;