Commit Graph

54 Commits

Author SHA1 Message Date
luklpz 121dc329f8 fix: catch RestClientException in all sync services
Per-item catch blocks only handled DolibarrApiException|PrestashopApiException,
letting network-level errors (RestClientException wrapping SSL, timeout, etc.)
propagate uncaught → HTTP 500. Also add outer catch for infrastructure failures
(e.g. getProducts() itself failing) so SyncLog always records the error in
errorDetails and the service returns a valid SyncResult instead of throwing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:28:49 +02:00
luklpz cfce84eb4d fix: send XML body on PS WebService write operations
PS WebService requires XML request body even when output_format=JSON.
Build XML manually in PrestashopClient for createProduct, updateProduct
and updateStockAvailable. Add link_rewrite slug generation and XML
character escaping. Response parsing (JSON) unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:14:16 +02:00
luklpz 588c1db5c3 fix: bypass SSL verification for loading.net self-signed cert
RestClient on Railway rejected the untrusted certificate on
prestashop.loading.net, causing SSLHandshakeException on every
HTTP call. Add SslConfig with a trust-all SimpleClientHttpRequestFactory
and inject it into both DolibarrClientConfig and PrestashopClientConfig.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:07:47 +02:00
luklpz 45b805a81a feat: add sync-service Spring Boot middleware
Dolibarr-PrestaShop integration service (Fases 0-5):
- HTTP clients for Dolibarr REST API and PrestaShop Webservice
- JPA entities + Flyway migrations (product_mapping, order_mapping, sync_log)
- Three sync flows: product push, stock push, order pull
- Configurable @Scheduled jobs (disabled in dev, enabled in prod)
- REST API with Basic Auth and Swagger UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 14:09:46 +02:00