Commit Graph

10 Commits

Author SHA1 Message Date
Алекс e0ab16f82d ajustes sobre verifactu y el banco 2026-05-24 23:57:22 +02:00
JavMB fbbbce3574 feat: add Contacts & Setup controllers, extend Clients/Invoices/Document controllers
- ContactsController: full CRUD (list, get, get by email, create, update, delete)
- SetupController: dictionary endpoints (payment-types, countries, civilities,
  contact-types, payment-terms, company)
- ClientsController: added GET/{id}, POST, PUT/{id}, DELETE/{id}
- InvoicesController: added PUT/{id}/lines/{lineId}, GET /templates
- DocumentController: added GET /list and GET /download endpoints
- ClientService: added GetClientAsync, CreateClientAsync, UpdateClientAsync,
  DeleteClientAsync
- InvoiceService: added UpdateInvoiceLineAsync, GetInvoiceTemplatesAsync
- DocumentService: added GetDocumentsAsync, DownloadDocumentAsync (using
  new GetAsyncRaw on IDolibarrApiClient)
- ContactService: new service with CRUD operations
- SetupService: new service for Dolibarr dictionary data
- IDolibarrApiClient: added GetAsyncRaw method for raw string responses
- DolibarrApiClient: implemented GetAsyncRaw
- JwtTokenProvider: extended token expiry from 30 min to 8 hours
- AuthApplicationService: extended Dolibarr token cache from 30 min to 8 hours
2026-05-15 18:58:35 +02:00
javiermengual 45913112be feat: Añadido endpoints para Delete Invoice y sus Lines , tambien corregido orden de Dto de GetById 2026-02-05 14:33:03 +01:00
javiermengual 9e888ee985 fix: formateo y eliminar estado invalido cancelled 2026-02-03 17:19:53 +01:00
javiermengual 9a06cc945e fix: arreglo bug porque dolibar devuelve un objeto anidado 2026-01-03 20:31:53 +01:00
javiermengual 283a9e7f5f Implementar autenticación JWT con caché de tokens de Dolibarr por sesión
- Añadir autenticación estándar JWT Bearer con ASP.NET Core
- Crear DolibarrTokenCacheService para la lógica de caché de tokens
- Refactorizar DolibarrApiClient para usar TokenCacheService con SRP limpio
- Actualizar Program.cs con registros de servicios y comentarios apropiados
- Añadir AuthController para el endpoint de login
- Actualizar InvoiceService para usar DolibarrApiClient
2026-01-03 19:55:04 +01:00
javiermengual f28461ae0c refactor: extraer interfaz IDolibarrApiClient para facilitar testing
- Crear IDolibarrApiClient con métodos de la API de Dolibarr
- Implementar interfaz en DolibarrApiClient
- Modificar InvoiceService para depender de IDolibarrApiClient en lugar de la clase concreta
- Actualizar Program.cs para registrar IDolibarrApiClient en el contenedor DI

Esto sigue el Principio de Inversión de Dependencias (DIP) de SOLID,
permitiendo mockear el cliente API en tests unitarios sin conectividad externa.
2026-01-03 14:57:23 +01:00
javiermengual a06ac2bdd9 feat: Implementar endpoint PUT para actualizar facturas draft, limitado a campos permitidos por Dolibarr (ref, notas, estado, fecha expiración) y unificar campo 'number' para consistencia 2026-01-02 20:20:58 +01:00
javiermengual 1fd331ac17 feat: Implemento completamente el POST de facturas , usando un objeto anonimo para la request, y devuelvo el id creado. 2026-01-02 19:01:04 +01:00
javiermengual ab80901280 refactor: sacar los metodos de cada DTO a su propio servicio porque si no se me hara un god object , y lo mantendre simple sin mucha abstraccion. 2025-12-31 15:15:00 +01:00