For each customer sale not yet stored as completed, fetch the full sale
(GET /sales/:id) and upsert it as a STORE order keyed on hiboutikSaleId.
Lines are replaced on each upsert and linked to the matching product
version when it still exists. Quotations are skipped, orders are never
deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses with a company are completed through
GET /customers_addresses/:id (tax number, company number, legal status),
which the customer payload does not embed. Addresses without company get
these fields set to null; a failed call keeps the stored values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirror the addresses embedded in GET /customer/🆔 per customer, delete
the ones missing from Hiboutik, then upsert each of them (failures logged
and skipped). CustomerAddress gains its own recipient (firstName,
lastName, company, phone) plus state and other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Models mirror Hiboutik entities (categories tree, brands, suppliers, products and their versions, customers) plus addresses and orders for the upcoming sync. Every synced model is matched with Hiboutik through a unique hiboutikId. The generated client is ignored by git and env files other than .env.example are ignored.