@things-factory/marketplace-base 4.3.11 → 4.3.16
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/marketplace-base",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.16",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/integration-fulfillment": "^4.3.
|
|
28
|
-
"@things-factory/integration-marketplace": "^4.3.
|
|
29
|
-
"@things-factory/product-base": "^4.3.
|
|
30
|
-
"@things-factory/shell": "^4.3.
|
|
27
|
+
"@things-factory/integration-fulfillment": "^4.3.15",
|
|
28
|
+
"@things-factory/integration-marketplace": "^4.3.15",
|
|
29
|
+
"@things-factory/product-base": "^4.3.14",
|
|
30
|
+
"@things-factory/shell": "^4.3.14"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "62892327e53288b479a13a53043067c678cd9bfc"
|
|
33
33
|
}
|
|
@@ -91,15 +91,9 @@ export const splitOrdersByBatch = {
|
|
|
91
91
|
let marketplaceOrderShippingItem: MarketplaceOrderShippingItem = newMarketplaceOrderShippingItems[a]
|
|
92
92
|
const product: Product = marketplaceOrderShippingItem.product
|
|
93
93
|
const marketplaceOrderItem: MarketplaceOrderItem = marketplaceOrderShippingItem.marketplaceOrderItem
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.
|
|
97
|
-
where: { domain: marketplaceOrder.domain, sku: product.sku },
|
|
98
|
-
relations: ['marketplaceProduct', 'marketplaceProduct.marketplaceStore']
|
|
99
|
-
})
|
|
100
|
-
const marketplaceProductVariation: MarketplaceProductVariation = marketplaceProductVariations.filter(
|
|
101
|
-
mpv => mpv.marketplaceProduct.marketplaceStore.id == marketplaceOrder.marketplaceStore.id
|
|
102
|
-
)[0]
|
|
94
|
+
|
|
95
|
+
const marketplaceProductVariation: MarketplaceProductVariation =
|
|
96
|
+
marketplaceOrderItem.marketplaceProductVariation
|
|
103
97
|
|
|
104
98
|
if (!marketplaceProductVariation?.primaryUnitValue)
|
|
105
99
|
throw new Error(marketplaceProductVariation.variationSku + ' weight is empty')
|
|
@@ -381,20 +381,26 @@ export const syncMarketplaceOrder = {
|
|
|
381
381
|
let foundVariations = []
|
|
382
382
|
for (var j = 0; j < order.orderItems.length; j++) {
|
|
383
383
|
var item = order.orderItems[j]
|
|
384
|
-
let foundVariationsQuery = await tx.getRepository(MarketplaceProductVariation).find({
|
|
385
|
-
where: { domain: marketplaceStore.domain, variationId: item.variationId },
|
|
386
|
-
relations: ['domain', 'marketplaceProduct', 'marketplaceProduct.marketplaceStore']
|
|
387
|
-
})
|
|
388
384
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
385
|
+
const qb: SelectQueryBuilder<MarketplaceProductVariation> = await tx
|
|
386
|
+
.getRepository(MarketplaceProductVariation)
|
|
387
|
+
.createQueryBuilder('mpv')
|
|
388
|
+
.leftJoin('mpv.marketplaceProduct', 'mp')
|
|
389
|
+
.leftJoin('mp.marketplaceStore', 'ms')
|
|
390
|
+
.where('mpv.domain_id = :domainId')
|
|
391
|
+
.andWhere('mpv.variation_id = :variationId')
|
|
392
|
+
.andWhere('ms.id = :marketplaceStoreId')
|
|
393
|
+
.setParameters({
|
|
394
|
+
domainId: marketplaceStore.domain,
|
|
395
|
+
variationId: item.variationId,
|
|
396
|
+
marketplaceStoreId: marketplaceStore.id
|
|
397
|
+
})
|
|
398
|
+
|
|
399
|
+
let foundVariation: MarketplaceProductVariation = await qb.getOne()
|
|
392
400
|
|
|
393
401
|
if (foundVariation) {
|
|
394
402
|
foundVariations.push(foundVariation)
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (!foundVariation) {
|
|
403
|
+
} else {
|
|
398
404
|
let newVariation: any = {
|
|
399
405
|
variationId: item.variationId,
|
|
400
406
|
name: item.variationName,
|