Class AttachmentCategoriesController
[ApiController]
[Route("api/business-partners/attachment-categories")]
[Authorize]
public class AttachmentCategoriesController : ControllerBase
- Inheritance
-
object
ControllerBase
AttachmentCategoriesController
Constructors
public AttachmentCategoriesController(ISender sender, IStringLocalizer<GeneralMessages> localizer)
Parameters
sender ISender
localizer IStringLocalizer<GeneralMessages>
Methods
Activate(Guid)
[HttpPatch("{id}/activate")]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_ACTIVATE")]
public Task<IActionResult> Activate(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
Create(CreateAttachmentCategoryCommand)
[HttpPost]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_CREATE")]
[ProducesResponseType(typeof(Result<Guid>), 201)]
[ProducesResponseType(typeof(Result), 400)]
[ProducesResponseType(typeof(Result), 409)]
public Task<IActionResult> Create(CreateAttachmentCategoryCommand command)
Parameters
command CreateAttachmentCategoryCommand
Returns
- Task<IActionResult>
Deactivate(Guid)
[HttpPatch("{id}/deactivate")]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_DEACTIVATE")]
public Task<IActionResult> Deactivate(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
GetAll(PaginatorRequestDto, bool?)
[HttpGet]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_VIEW")]
[ProducesResponseType(typeof(PaginatorResponseDto<AttachmentCategoryDto>), 200)]
public Task<IActionResult> GetAll(PaginatorRequestDto paginatorRequest, bool? isActive = null)
Parameters
paginatorRequest PaginatorRequestDto
isActive bool?
Returns
- Task<IActionResult>
GetById(Guid)
[HttpGet("{id}")]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_VIEW")]
[ProducesResponseType(typeof(AttachmentCategoryDto), 200)]
[ProducesResponseType(typeof(Error), 404)]
public Task<IActionResult> GetById(Guid id)
Parameters
id Guid
Returns
- Task<IActionResult>
Update(Guid, UpdateAttachmentCategoryCommand)
[HttpPut("{id}")]
[Authorize(Policy = "BUSINESS_PARTNERS_ATTACHMENT_CATEGORIES_UPDATE")]
[ProducesResponseType(typeof(Result), 200)]
[ProducesResponseType(typeof(Result), 400)]
[ProducesResponseType(typeof(Result), 404)]
[ProducesResponseType(typeof(Result), 409)]
public Task<IActionResult> Update(Guid id, UpdateAttachmentCategoryCommand command)
Parameters
id Guid
command UpdateAttachmentCategoryCommand
Returns
- Task<IActionResult>