Commit Graph

17 Commits

Author SHA1 Message Date
Алекс 7c6ed689f6 Merge branch 'main' of https://github.com/JavMB/dolibarr-bff 2026-05-15 21:52:37 +02:00
Алекс f2030977ff feat: módulo banco completo (GET/POST/PUT cuentas y movimientos), campos TotalHt/TotalTax en facturas 2026-05-15 21:50:16 +02:00
JavMB 341b0b3841 cors funcionaras o no 2026-05-15 19:59:31 +02:00
JavMB 8fb5d801cf fix CORS 2026-05-15 19:52:04 +02:00
JavMB 12b1755e86 merge: resolve conflicts with remote — keep local CORS config, merge webhook notifications
- Resolved merge conflicts in Program.cs (kept configurable CORS from local)
- Resolved merge conflicts in DocumentController.cs (kept full controller
  with list/download endpoints from local)
- Integrated remote webhook notification system:
  * INotificationService interface + WebhookNotificationService
  * InvoiceService now sends Teams/Slack webhook on status changes
  * appsettings.json: added Notifications:WebhookUrl config
  * Program.cs: registered INotificationService + Webhook HttpClient
2026-05-15 19:02:32 +02:00
JavMB fe6bd57796 feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
  OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
  environments (not just Development), registered all new services
  (ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
  when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
  with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
  added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 18:58:43 +02:00
javiermengual ef42797b31 feat: add webhook notifications for invoice status changes
Implements INotificationService with Teams/Slack-compatible WebhookNotificationService.
Fires on ValidateInvoice and ChangeInvoiceStatus. Silently skipped if WebhookUrl not configured.
2026-05-14 22:59:31 +02:00
JM 98312846fa Modifico el endpoint de descargas de pdf , convirtiendo el base64 a binario 2026-04-16 09:41:46 +02:00
javiermengual e729388981 feat : Añado endpoint Get para Clients de dolibar. 2026-01-30 16:34:23 +01:00
javiermengual 8c781308e7 fix: update CORS configuration to include additional origin 2026-01-16 19:07:40 +01:00
javiermengual 72b15eeff6 feat: add CORS configuration and implement unit tests for InvoiceMapper and InvoiceService 2026-01-16 15:43:28 +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 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
javiermengual 572547b356 build : cambio de OpenApi nativo a Swashbuckle para tener un mejor schema openapi. 2025-12-30 13:45:58 +01:00
javiermengual 17ebf5c2fe feat: con ayuda de ia , me enseña sobre como manejar errores y me ayuda con una implementacion detallada siguiendo el estandar RFC 7807 2025-12-30 13:20:08 +01:00
javiermengual 05a964bbaa feat: configurar API base con Program.cs y settings 2025-12-29 16:37:45 +01:00