This commit is contained in:
2022-07-04 00:12:42 +00:00
parent 5f5f5bb2e4
commit fb358e4533
7 changed files with 75 additions and 18 deletions

View File

@@ -168,6 +168,26 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(await ct.Vendor.AsNoTracking().Where(x => x.Id == id).Select(x => x.AlertNotes).FirstOrDefaultAsync()));
}
/// <summary>
/// Get list for accounting integrations
/// </summary>
/// <returns>NameIdActive list</returns>
[HttpGet("accounting-list")]
public async Task<IActionResult> GetAccountingList()
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
VendorBiz biz = VendorBiz.GetBiz(ct, HttpContext);
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var o = await biz.GetNameIdActiveItemsAsync();
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o));
}
//------------