@pinelab/vendure-plugin-qls-fulfillment 1.0.0-beta.17 → 1.0.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,7 +87,13 @@ let QlsOrderService = class QlsOrderService {
|
|
|
87
87
|
}
|
|
88
88
|
try {
|
|
89
89
|
// Check if all products are available in QLS
|
|
90
|
-
const qlsProducts = order.lines.
|
|
90
|
+
const qlsProducts = order.lines.filter((line) => {
|
|
91
|
+
if (this.options.excludeVariantFromSync?.(ctx, line.productVariant)) {
|
|
92
|
+
core_2.Logger.info(`Product variant '${line.productVariant.sku}' not sent to QLS in order '${order.code}' because it is excluded from sync.`, constants_1.loggerCtx);
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}).map((line) => {
|
|
91
97
|
if (!line.productVariant.customFields.qlsProductId) {
|
|
92
98
|
throw new Error(`Product variant '${line.productVariant.sku}' does not have a QLS product ID set. Unable to push order '${order.code}' to QLS.`);
|
|
93
99
|
}
|
|
@@ -166,10 +166,11 @@ let QlsProductService = class QlsProductService {
|
|
|
166
166
|
if (!client) {
|
|
167
167
|
throw new Error(`QLS not enabled for channel ${ctx.channel.token}`);
|
|
168
168
|
}
|
|
169
|
-
core_1.Logger.warn(`
|
|
169
|
+
core_1.Logger.warn(`Removing all products from QLS for channel ${ctx.channel.token}...`, constants_1.loggerCtx);
|
|
170
170
|
const allProducts = await client.getAllFulfillmentProducts();
|
|
171
171
|
for (const product of allProducts) {
|
|
172
172
|
await client.deleteFulfillmentProduct(product.id);
|
|
173
|
+
core_1.Logger.info(`Removed product '${product.sku}' (${product.id}) from QLS`, constants_1.loggerCtx);
|
|
173
174
|
await waitToPreventRateLimit();
|
|
174
175
|
}
|
|
175
176
|
core_1.Logger.warn(`Removed ${allProducts.length} products from QLS for channel ${ctx.channel.token}`, constants_1.loggerCtx);
|