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

@@ -96,7 +96,7 @@ namespace AyaNova.Api.Controllers
CustomerBiz biz = CustomerBiz.GetBiz(ct, HttpContext);
if (!Authorized.HasModifyRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
var o = await biz.PutAsync(updatedObject);
var o = await biz.PutAsync(updatedObject);
if (o == null)
{
if (biz.Errors.Exists(z => z.Code == ApiErrorCode.CONCURRENCY_CONFLICT))
@@ -177,6 +177,27 @@ namespace AyaNova.Api.Controllers
}));
}
/// <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));
CustomerBiz biz = CustomerBiz.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));
}
// /// <summary>
// /// Get service (physical) address for this customer
// /// </summary>