feat(sync): synchronize customer adresses and orders from Hiboutik sales #1

Merged
quentin_duwa merged 3 commits from feat/customer-addresses-orders into main 2026-11-07 09:56:53 +00:00
Owner
No description provided.
quentin_duwa added 3 commits 2026-11-07 09:51:23 +00:00
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>
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>
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>
quentin_duwa merged commit 9dddf7562a into main 2026-11-07 09:56:53 +00:00
quentin_duwa deleted branch feat/customer-addresses-orders 2026-11-07 09:56:53 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: quentin_duwa/dinggadingga-backend#1
No description provided.