Class TagsController
[ApiController]
[Route("api/business-partners/[controller]")]
[Authorize]
public class TagsController : ControllerBase
- Inheritance
-
object
ControllerBase
TagsController
Constructors
public TagsController(ISender sender, IStringLocalizer<BusinessPartnerMessages> localizer)
Parameters
sender ISender
localizer IStringLocalizer<BusinessPartnerMessages>
Methods
[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>
[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>>
[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>
[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>
[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>
[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>