Incremental sync via t.tms filter breaks when products were created before
the service started running: their tms is older than lastSyncStart so they
are never returned. Since the sync is idempotent (ProductMapping handles
create-vs-update), always fetching all products is safe and simpler.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PS WebService POST response uses a different JSON structure for multilingual
fields than GET responses, causing Jackson deserialization failures. Instead
of parsing the POST body, discard it with toBodilessEntity() and fetch the
created product via getProductByReference() which uses the stable GET format.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PS WebService POST response wraps multilingual fields as {"language":[...]}
while GET returns a flat array. Jackson fails parsing List<LangValue> from
the POST response. Fix: parse the full response as JsonNode and extract
only the id; reconstruct the DTO from the input fields.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ByteArrayHttpMessageConverter reliably handles application/xml content
type via its */* support, avoiding potential StringHttpMessageConverter
selection issues. Also add HttpMessageConversionException to per-item
catches and widen outer infrastructure catch to RuntimeException, so
any response-parsing failure is recorded in SyncLog.errorDetails
instead of propagating as HTTP 500.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
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>
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>
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>