Class AccountsController
- Namespace
- KadicErp.WebApi.Controllers.Accounting
- Assembly
- KadicErp.WebApi.dll
[ApiController]
[Route("api/accounting/accounts")]
public class AccountsController : ControllerBase
- Inheritance
-
object
ControllerBase
AccountsController
Constructors
public AccountsController(IMediator mediator)
Parameters
mediator IMediator
Methods
Activate(Guid)
[HttpPatch("{id:guid}/activate")]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_ACTIVATE")]
public Task<IActionResult> Activate(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
Create(CreateAccountCommand)
[HttpPost]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_CREATE")]
public Task<IActionResult> Create(CreateAccountCommand command)
Parameters
command CreateAccountCommand
Returns
- Task<IActionResult>
Deactivate(Guid)
[HttpPatch("{id:guid}/deactivate")]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_DEACTIVATE")]
public Task<IActionResult> Deactivate(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
GetAll(Guid, bool)
[HttpGet]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_VIEW")]
public Task<IActionResult> GetAll(Guid branchId, bool activeOnly = false)
Parameters
branchId Guid
activeOnly bool
Returns
- Task<IActionResult>
GetById(Guid)
[HttpGet("{id:guid}")]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_VIEW")]
public Task<IActionResult> GetById(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
GetTree(Guid)
[HttpGet("tree")]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_VIEW")]
public Task<IActionResult> GetTree(Guid branchId)
Parameters
branchId Guid
Returns
- Task<IActionResult>
Update(Guid, UpdateAccountCommand)
[HttpPut("{id:guid}")]
[Authorize(Policy = "ACCOUNTING_ACCOUNTS_UPDATE")]
public Task<IActionResult> Update(Guid id, UpdateAccountCommand command)
Parameters
id Guid
command UpdateAccountCommand
Returns
- Task<IActionResult>