Commit Graph

5 Commits

Author SHA1 Message Date
Алекс d1f793b1e3 feat: rol de terceros, webhook mejorado y fix pagos
Terceros:
- ClientResponse: campo fournisseur añadido
- CreateClientDto: campo Role (client/supplier/both)
- ClientDto / ClientDetailDto: campo Role devuelto en respuesta
- ClientMapper: ResolveRole() calcula rol desde client+fournisseur de Dolibarr
- ClientService: CreateClientAsync mapea Role a client/fournisseur en Dolibarr

Webhook:
- WebhookSettings: persistencia en archivo data/webhook_url.txt (volumen Docker)
- WebhookNotificationService: fire-and-forget, Adaptive Card 1.2, timeout 8s
- SettingsController: usa UpdateUrl(), endpoint test añadido
- Program.cs: HttpClient Webhook con timeout de 8s
- InvoiceService: notificación también al registrar pago (AddInvoicePaymentAsync)
  + datepaye enviado como Unix timestamp (fix 400 de Dolibarr)
- SupplierInvoiceService: notificación webhook en cambios de estado,
  pago vía payments endpoint con Unix timestamp

compose.yaml: volumen bff_data para persistir webhook_url.txt entre rebuilds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 16:35:17 +02:00
javiermengual 9d88e475a9 puerto 5000 ocupado cambio a 5001 2026-05-15 20:19:29 +02:00
JavMB 8fb5d801cf fix CORS 2026-05-15 19:52:04 +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 f74aaac664 chore: añadir configuración de Docker 2025-12-29 16:37:45 +01:00