feat: añadir controlador de facturas
This commit is contained in:
parent
7428eb3f8d
commit
9d871dccf9
|
|
@ -0,0 +1,30 @@
|
|||
using DoliMiddlewareApi.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DoliMiddlewareApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class InvoicesController : ControllerBase
|
||||
{
|
||||
private readonly DolibarrApiClient _dolibarrClient;
|
||||
|
||||
public InvoicesController(DolibarrApiClient dolibarrClient)
|
||||
{
|
||||
_dolibarrClient = dolibarrClient;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetInvoices()
|
||||
{
|
||||
var invoices = await _dolibarrClient.GetInvoicesAsync();
|
||||
return Ok(invoices);
|
||||
}
|
||||
|
||||
[HttpGet("{id:int}")]
|
||||
public async Task<IActionResult> GetInvoice(int id)
|
||||
{
|
||||
var invoice = await _dolibarrClient.GetInvoiceAsync(id);
|
||||
return Ok(invoice);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue