feat(sync): synchronize customer orders from Hiboutik sales
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>
This commit is contained in:
@@ -22,6 +22,9 @@ import { ProductVersionDatabaseRepository } from './database/productVersion.data
|
||||
import { CustomerHiboutikRepository } from './hiboutik/customer.hiboutik.repository';
|
||||
import { CustomerDatabaseRepository } from './database/customer.database.repository';
|
||||
import { CustomerConverter } from './models/converter/customer.converter';
|
||||
import { OrderConverter } from './models/converter/order.converter';
|
||||
import { OrderDatabaseRepository } from './database/order.database.repository';
|
||||
import { SaleHiboutikRepository } from './hiboutik/sale.hiboutik.repository';
|
||||
import { CustomerAddressConverter } from './models/converter/customerAddress.converter';
|
||||
import { CustomerAddressDatabaseRepository } from './database/customerAddress.database.repository';
|
||||
import { BrandHiboutikService } from './services/hiboutik/brand.hiboutik.service';
|
||||
@@ -56,11 +59,14 @@ import { ProductHiboutikService } from './services/hiboutik/product.hiboutik.ser
|
||||
CustomerHiboutikService,
|
||||
HiboutikClient,
|
||||
HiboutikService,
|
||||
OrderConverter,
|
||||
OrderDatabaseRepository,
|
||||
ProductConverter,
|
||||
ProductDatabaseRepository,
|
||||
ProductHiboutikRepository,
|
||||
ProductHiboutikService,
|
||||
ProductVersionDatabaseRepository,
|
||||
SaleHiboutikRepository,
|
||||
StockHiboutikRepository,
|
||||
SupplierConverter,
|
||||
SupplierDatabaseRepository,
|
||||
|
||||
Reference in New Issue
Block a user