Table of Contents

Class TagsController

Namespace
KadicErp.WebApi.Controllers.BusinessPartners
Assembly
KadicErp.WebApi.dll
[ApiController]
[Route("api/business-partners/[controller]")]
[Authorize]
public class TagsController : ControllerBase
Inheritance
object
ControllerBase
TagsController

Constructors

TagsController(ISender, IStringLocalizer<BusinessPartnerMessages>)

public TagsController(ISender sender, IStringLocalizer<BusinessPartnerMessages> localizer)

Parameters

sender ISender
localizer IStringLocalizer<BusinessPartnerMessages>

Methods

Activate(Guid)

[HttpPatch("{id}/activate")]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_ACTIVATE")]
[ProducesResponseType(200)]
[ProducesResponseType(typeof(Error), 404)]
public Task<IActionResult> Activate(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

Create(CreateTagCommand)

[HttpPost]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_CREATE")]
[ProducesResponseType(typeof(Guid), 201)]
[ProducesResponseType(typeof(Error), 400)]
[ProducesResponseType(typeof(Error), 409)]
public Task<ActionResult<Guid>> Create(CreateTagCommand command)

Parameters

command CreateTagCommand

Returns

Task<ActionResult<Guid>>

Deactivate(Guid)

[HttpPatch("{id}/deactivate")]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_DEACTIVATE")]
[ProducesResponseType(200)]
[ProducesResponseType(typeof(Error), 404)]
public Task<IActionResult> Deactivate(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

GetAll(PaginatorRequestDto, bool?, CancellationToken)

[HttpGet]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_VIEW")]
[ProducesResponseType(typeof(PaginatorResponseDto<TagDto>), 200)]
[ProducesResponseType(typeof(Error), 400)]
public Task<IActionResult> GetAll(PaginatorRequestDto paginator, bool? isActive, CancellationToken cancellationToken = default)

Parameters

paginator PaginatorRequestDto
isActive bool?
cancellationToken CancellationToken

Returns

Task<IActionResult>

GetById(Guid)

[HttpGet("{id}")]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_VIEW")]
[ProducesResponseType(typeof(TagDto), 200)]
[ProducesResponseType(typeof(Error), 404)]
public Task<IActionResult> GetById(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

Update(Guid, UpdateTagCommand)

[HttpPut("{id}")]
[Authorize(Policy = "BUSINESS_PARTNERS_TAGS_UPDATE")]
[ProducesResponseType(200)]
[ProducesResponseType(typeof(Error), 400)]
[ProducesResponseType(typeof(Error), 409)]
[ProducesResponseType(typeof(Error), 404)]
public Task<IActionResult> Update(Guid id, UpdateTagCommand command)

Parameters

id Guid
command UpdateTagCommand

Returns

Task<IActionResult>