Table of Contents

Class GuarantorsController

Namespace
KadicErp.WebApi.Controllers.RentACar
Assembly
KadicErp.WebApi.dll
[Route("api/rentcar/[controller]")]
[ApiController]
[RequireModule("RENT_A_CAR")]
public class GuarantorsController : ControllerBase
Inheritance
object
ControllerBase
GuarantorsController

Constructors

GuarantorsController(IMediator)

public GuarantorsController(IMediator mediator)

Parameters

mediator IMediator

Methods

Activate(Guid)

[HttpPatch("{id}/activate")]
[Authorize(Policy = "RENTACAR_GUARANTORS_ACTIVATE")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
public Task<IActionResult> Activate(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

Create(CreateGuarantorCommand)

[HttpPost]
[Authorize(Policy = "RENTACAR_GUARANTORS_CREATE")]
[ProducesResponseType(typeof(Guid), 201)]
[ProducesResponseType(400)]
public Task<IActionResult> Create(CreateGuarantorCommand command)

Parameters

command CreateGuarantorCommand

Returns

Task<IActionResult>

Deactivate(Guid)

[HttpPatch("{id}/deactivate")]
[Authorize(Policy = "RENTACAR_GUARANTORS_DEACTIVATE")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
public Task<IActionResult> Deactivate(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

GetAll(GetAllGuarantorsQuery)

[HttpGet]
[Authorize(Policy = "RENTACAR_GUARANTORS_VIEW")]
[ProducesResponseType(typeof(PaginatorResponseDto<GuarantorDto>), 200)]
[ProducesResponseType(400)]
public Task<IActionResult> GetAll(GetAllGuarantorsQuery query)

Parameters

query GetAllGuarantorsQuery

Returns

Task<IActionResult>

GetByDriverPersonPartnerId(Guid)

[HttpGet("by-driver/{driverPersonPartnerId}")]
[Authorize(Policy = "RENTACAR_GUARANTORS_VIEW")]
[ProducesResponseType(200)]
public Task<IActionResult> GetByDriverPersonPartnerId(Guid driverPersonPartnerId)

Parameters

driverPersonPartnerId Guid

Returns

Task<IActionResult>

GetById(Guid)

[HttpGet("{id:guid}")]
[Authorize(Policy = "RENTACAR_GUARANTORS_VIEW")]
[ProducesResponseType(typeof(GuarantorDto), 200)]
[ProducesResponseType(400)]
public Task<IActionResult> GetById(Guid id)

Parameters

id Guid

Returns

Task<IActionResult>

Update(Guid, UpdateGuarantorCommand)

[HttpPut("{id}")]
[Authorize(Policy = "RENTACAR_GUARANTORS_UPDATE")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
public Task<IActionResult> Update(Guid id, UpdateGuarantorCommand command)

Parameters

id Guid
command UpdateGuarantorCommand

Returns

Task<IActionResult>