This commit is contained in:
2022-06-24 23:56:43 +00:00
parent 96f47de2e5
commit 34931a6ca7
7 changed files with 96 additions and 36 deletions

View File

@@ -317,6 +317,25 @@ namespace AyaNova.Api.Controllers
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o));
}
/// <summary>
/// Get list for accounting integrations
/// </summary>
/// <returns>NameIdActiveChargeCost list</returns>
[HttpGet("accounting-list")]
public async Task<IActionResult> GetAccountingList()
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
PartBiz biz = PartBiz.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.GetNameIdActiveChargeCostItemsAsync();
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o));
}
//------------