Table of Contents

Class RelationshipTypesController

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

Constructors

RelationshipTypesController(ISender, IStringLocalizer<BusinessPartnerMessages>)

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

Parameters

sender ISender
localizer IStringLocalizer<BusinessPartnerMessages>

Methods

Activate(Guid)

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

Parameters

id Guid

Returns

Task<IActionResult>

Create(CreateRelationshipTypeCommand)

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

Parameters

command CreateRelationshipTypeCommand

Returns

Task<ActionResult<Guid>>

Deactivate(Guid)

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

Parameters

id Guid

Returns

Task<IActionResult>

GetAll(PaginatorRequestDto, bool?)

[HttpGet]
[Authorize(Policy = "BUSINESS_PARTNERS_RELATIONSHIP_TYPES_VIEW")]
[ProducesResponseType(typeof(PaginatorResponseDto<RelationshipTypeDto>), 200)]
[ProducesResponseType(typeof(Error), 400)]
public Task<IActionResult> GetAll(PaginatorRequestDto paginator, bool? isActive)

Parameters

paginator PaginatorRequestDto
isActive bool?

Returns

Task<IActionResult>

GetById(Guid)

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

Parameters

id Guid

Returns

Task<IActionResult>

Update(Guid, UpdateRelationshipTypeCommand)

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

Parameters

id Guid
command UpdateRelationshipTypeCommand

Returns

Task<IActionResult>