case 4173

This commit is contained in:
2023-05-09 22:23:54 +00:00
parent 079a6a6999
commit 82fa744de5
8 changed files with 93 additions and 18 deletions

View File

@@ -281,6 +281,18 @@ namespace AyaNova.Api.Controllers
if (batchDirectSMTPParams.SelectedRequest == null)
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "batchDirectSMTPParams.DataListSelectedRequest is required"));
switch (batchDirectSMTPParams.SelectedRequest.AType)
{
case AyaType.Customer:
case AyaType.HeadOffice:
case AyaType.Vendor:
case AyaType.User:
break;
default:
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "AType", "Specified Type not supported"));
}
if (!Authorized.HasModifyRole(HttpContext.Items, batchDirectSMTPParams.SelectedRequest.AType))
return StatusCode(403, new ApiNotAuthorizedResponse());
@@ -295,10 +307,12 @@ namespace AyaNova.Api.Controllers
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
var JobName = $"LT:BatchDirectSMTP - LT:{batchDirectSMTPParams.SelectedRequest.AType} ({batchDirectSMTPParams.SelectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
var JobName = $"LT:BatchDirectSMTP - LT:{batchDirectSMTPParams.SelectedRequest.AType} ({batchDirectSMTPParams.SelectedRequest.SelectedRowIds.LongLength}), LT:User {UserNameFromContext.Name(HttpContext.Items)}, LT:MemoSubject '{batchDirectSMTPParams.Subject}'";
JObject o = JObject.FromObject(new
{
idList = batchDirectSMTPParams.SelectedRequest.SelectedRowIds
idList = batchDirectSMTPParams.SelectedRequest.SelectedRowIds,
subject = batchDirectSMTPParams.Subject,
message = batchDirectSMTPParams.TextBody
});
OpsJob j = new OpsJob();