Commit Graph

5 Commits

Author SHA1 Message Date
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 a1fd7c6418 Arreglar bug de validación de estado y limpiar código de cache
- Añadir método ConvertStatusToDolibarr en InvoiceMapper para mapear todos los estados correctamente (draft, unpaid, paid, cancelled)
- Mover lógica de mapeo de estado desde InvoiceService a InvoiceMapper para seguir principios de SRP
- Arreglar bug donde el estado 'paid' y 'cancelled' se mapeaban incorrectamente a '0' (draft)
- Añadir validación de estado con mensaje de error claro para valores inválidos
- Limpiar código de DolibarrTokenCacheService eliminando bloque anidado innecesario
2026-01-03 20:46:13 +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 a80d41feab feat: Primera parte de la implementacion de autentificacion, para obtener la DOLIAPIKEY del cliente la cual cachearemos asociada a un Id que devolveremos en el JWT de nuestro servidor. 2026-01-03 18:12:40 +01:00