@things-factory/integration-sellercraft 4.2.5 → 4.2.9

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.
Files changed (28) hide show
  1. package/dist-server/constants/order-status-mapping.js +16 -2
  2. package/dist-server/constants/order-status-mapping.js.map +1 -1
  3. package/dist-server/constants/platform.js +2 -1
  4. package/dist-server/constants/platform.js.map +1 -1
  5. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js +5 -2
  6. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js.map +1 -1
  7. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js +2 -2
  8. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js.map +1 -1
  9. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js +5 -4
  10. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js.map +1 -1
  11. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js +8 -4
  12. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js.map +1 -1
  13. package/dist-server/routers/sellercraft-router.js +135 -88
  14. package/dist-server/routers/sellercraft-router.js.map +1 -1
  15. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js +291 -245
  16. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js.map +1 -1
  17. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js +30 -16
  18. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js.map +1 -1
  19. package/package.json +3 -3
  20. package/server/constants/order-status-mapping.ts +16 -1
  21. package/server/constants/platform.ts +2 -1
  22. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.ts +6 -2
  23. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts +2 -2
  24. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.ts +13 -11
  25. package/server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts +8 -4
  26. package/server/routers/sellercraft-router.ts +130 -91
  27. package/server/service/marketplace-channel/marketplace-channel-order-mutation.ts +343 -283
  28. package/server/service/marketplace-channel/marketplace-channel-product-mutation.ts +30 -28
@@ -1,11 +1,12 @@
1
1
  import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'
2
2
  import { getRepository } from 'typeorm'
3
3
 
4
- import { MarketplaceChannel } from './marketplace-channel'
5
-
6
4
  import { config } from '@things-factory/env'
7
5
  import { StoreAPI } from '@things-factory/integration-marketplace'
6
+
7
+ import { SHIPPING_TYPE } from '../../constants'
8
8
  import { SellercraftChannelIntegrationAPI } from '../../controllers/sellercraft-channel-integration-api'
9
+ import { MarketplaceChannel } from './marketplace-channel'
9
10
 
10
11
  @Resolver()
11
12
  export class MarketplaceChannelOrderMutation {
@@ -21,307 +22,366 @@ export class MarketplaceChannelOrderMutation {
21
22
  const channels: MarketplaceChannel[] = await getRepository(MarketplaceChannel).find()
22
23
 
23
24
  for (var i = 0; i < channels.length; i++) {
24
- var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channels[i].channelId
25
- const channelResponse: any = await fetch(channelsFullPath, {
26
- method: 'get',
27
- headers: {
28
- 'Content-Type': 'application/json',
29
- 'x-api-key': apiKey
25
+ try {
26
+ const channel: MarketplaceChannel = channels[i]
27
+ var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channel.channelId
28
+ const channelResponse: any = await fetch(channelsFullPath, {
29
+ method: 'get',
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ 'x-api-key': apiKey
33
+ }
34
+ })
35
+
36
+ if (!channelResponse.ok) {
37
+ throw new Error(channelResponse)
30
38
  }
31
- })
39
+ var shopsResponse = await channelResponse.json()
40
+ var shops = shopsResponse.shops
32
41
 
33
- if (!channelResponse.ok) {
34
- throw new Error(channelResponse)
35
- }
36
- var shopsResponse = await channelResponse.json()
37
- var shops = shopsResponse.shops
42
+ for (var j = 0; j < shops.length; j++) {
43
+ try {
44
+ var store = {
45
+ accessKey: shops[j]?.credential?.consumer_key || '',
46
+ accessSecret: shops[j]?.credential?.consumer_secret || '',
47
+ storeURL: shops[j]?.credential?.store_url || '',
48
+ platform: channel.name,
49
+ accessToken: shops[j]?.credential?.access_token, // Magento+, Tiktok
50
+ channelShopId: shops[j]?.channel_shop_id
51
+ }
38
52
 
39
- for (var j = 0; j < shops.length; j++) {
40
- var store = {
41
- accessKey: shops[j].credential.consumer_key,
42
- accessSecret: shops[j].credential.consumer_secret,
43
- storeURL: shops[j].credential.store_url,
44
- platform: channels[i].name,
45
- accessToken: shops[j].credential.access_token // Magento+
46
- }
53
+ // let countryCode = shops[j].country_code
54
+ // let channelCode = shops[j].org_prefix
55
+ let organisationId = shops[j].account_id
56
+ let channelShopId = shops[j].channel_shop_id
47
57
 
48
- // let countryCode = shops[j].country_code
49
- // let channelCode = shops[j].org_prefix
50
- let organisationId = shops[j].account_id
51
- let channelShopId = shops[j].channel_shop_id
58
+ let orderResult = []
59
+ let page: number = 1
60
+ let hasMorePage: boolean = true
61
+ let lastOrderId: string
62
+ let cursor: string
63
+ var limit: number = 50
52
64
 
53
- let orderResult = []
54
- let page: number = 1
55
- let hasMorePage: boolean = true
56
- let lastOrderId: string
57
- var limit: number = 100
65
+ while (hasMorePage) {
66
+ const {
67
+ results: marketplaceOrders,
68
+ more,
69
+ nextCursor
70
+ } = await StoreAPI.getStoreOrders(store, {
71
+ fromDate,
72
+ toDate,
73
+ pagination: { page, limit },
74
+ lastOrderId,
75
+ nextCursor: cursor
76
+ })
58
77
 
59
- while (hasMorePage) {
60
- const { results: marketplaceOrders, more } = await StoreAPI.getStoreOrders(store, {
61
- fromDate,
62
- toDate,
63
- pagination: { page, limit },
64
- lastOrderId
65
- })
78
+ orderResult.push(...marketplaceOrders)
66
79
 
67
- orderResult.push(...marketplaceOrders)
68
-
69
- if (more) page++
70
- hasMorePage = more
71
- }
80
+ if (more) page++
81
+ hasMorePage = more
82
+ cursor = nextCursor
83
+ }
84
+
85
+ var sellercraftStore = { ...store, platform: 'sellercraftChannelIntegration' }
72
86
 
73
- var sellercraftStore = { ...store, platform: 'sellercraftChannelIntegration' }
87
+ let mappedOrderResult = orderResult.map(order => {
88
+ let id = store.platform == 'magento' ? order.name : order.orderNo
89
+ let {
90
+ firstName: custFirstName,
91
+ lastName: custLastName,
92
+ orderCreatedAt: createdAt,
93
+ orderUpdatedAt: updatedAt,
94
+ status,
95
+ isSOF
96
+ } = order
74
97
 
75
- let mappedOrderResult = orderResult.map(order => {
76
- let {
77
- firstName: custFirstName,
78
- lastName: custLastName,
79
- orderCreatedAt: createdAt,
80
- orderUpdatedAt: updatedAt,
81
- orderNo: id,
82
- status
83
- } = order
98
+ let {
99
+ first_name: billFirstName,
100
+ last_name: billLastName,
101
+ address_1: billAddress1,
102
+ address_2: billAddress2,
103
+ address_3: billAddress3,
104
+ address_4: billAddress4,
105
+ address_5: billAddress5,
106
+ city: billCity,
107
+ postcode: billPostalCode,
108
+ country: billCountry,
109
+ phone: billPhone1,
110
+ phone_2: billPhone2
111
+ } = order?.billing
84
112
 
85
- let {
86
- first_name: billFirstName,
87
- last_name: billLastName,
88
- address_1: billAddress1,
89
- address_2: billAddress2,
90
- address_3: billAddress3,
91
- address_4: billAddress4,
92
- address_5: billAddress5,
93
- city: billCity,
94
- postcode: billPostalCode,
95
- country: billCountry,
96
- phone: billPhone1,
97
- phone_2: billPhone2
98
- } = order?.billing
113
+ let {
114
+ first_name: shipFirstName,
115
+ last_name: shipLastName,
116
+ address_1: shipAddress1,
117
+ address_2: shipAddress2,
118
+ address_3: shipAddress3,
119
+ address_4: shipAddress4,
120
+ address_5: shipAddress5,
121
+ city: shipCity,
122
+ postcode: shipPostalCode,
123
+ country: shipCountry,
124
+ phone: shipPhone1,
125
+ phone_2: shipPhone2
126
+ } = order.shipping
99
127
 
100
- let {
101
- first_name: shipFirstName,
102
- last_name: shipLastName,
103
- address_1: shipAddress1,
104
- address_2: shipAddress2,
105
- address_3: shipAddress3,
106
- address_4: shipAddress4,
107
- address_5: shipAddress5,
108
- city: shipCity,
109
- postcode: shipPostalCode,
110
- country: shipCountry,
111
- phone: shipPhone1,
112
- phone_2: shipPhone2
113
- } = order.shipping
128
+ let orderPackage = order?.orderPackage || {}
114
129
 
115
- let orderItems = order.orderItems.map(item => {
116
- let { name: id, variationId: variationId, slaExpiresAt, total, totalTax, subtotal, subtotalTax, qty } = item
130
+ let orderItems = order.orderItems.map(item => {
131
+ let {
132
+ name: id,
133
+ variationId: variationId,
134
+ slaExpiresAt,
135
+ total,
136
+ totalTax,
137
+ subtotal,
138
+ subtotalTax,
139
+ qty
140
+ } = item
117
141
 
118
- return {
119
- id,
120
- variationId,
121
- currency: order.orderShipping.collectionCurrency,
122
- createdAt: order.orderCreatedAt,
123
- updatedAt: order.orderUpdatedAt,
124
- charges: [
125
- {
126
- name: 'CHARGES_MARKETING',
127
- grossAmount: 0,
128
- nettAmount: 0
129
- },
130
- {
131
- name: 'CLAIMS_DAMAGE',
132
- grossAmount: 0,
133
- nettAmount: 0
134
- },
135
- {
136
- name: 'CLAIMS_LOST',
137
- grossAmount: 0,
138
- nettAmount: 0
139
- },
140
- {
141
- name: 'COMMISSION_PLATFORM',
142
- grossAmount: 0,
143
- nettAmount: 0
144
- },
145
- {
146
- name: 'DEPOSIT_PRESALE',
147
- grossAmount: 0,
148
- nettAmount: 0
149
- },
150
- {
151
- name: 'FEE_MISCELLANEOUS',
152
- grossAmount: 0,
153
- nettAmount: 0
154
- },
155
- {
156
- name: 'FEE_TRANSACTION',
157
- grossAmount: 0,
158
- nettAmount: 0
159
- },
160
- {
161
- name: 'PRICE_NORMAL_SELLING',
162
- grossAmount: total,
163
- nettAmount: subtotal
164
- },
165
- {
166
- name: 'PRICE_RECOMMENDED_RETAIL',
167
- grossAmount: 0,
168
- nettAmount: 0
169
- },
170
- {
171
- name: 'PROMOTIONS_CUSTOMER_RECEIVED',
172
- grossAmount: 0,
173
- nettAmount: 0
174
- },
175
- {
176
- name: 'PROMOTIONS_REBATE_PLATFORM',
177
- grossAmount: 0,
178
- nettAmount: 0
179
- },
180
- {
181
- name: 'PROMOTIONS_REBATE_SELLER',
182
- grossAmount: 0,
183
- nettAmount: 0
184
- },
185
- {
186
- name: 'REVERSAL_CHARGES_MARKETING',
187
- grossAmount: 0,
188
- nettAmount: 0
189
- },
190
- {
191
- name: 'REVERSAL_COMMISSION',
192
- grossAmount: 0,
193
- nettAmount: 0
194
- },
195
- {
196
- name: 'REVERSAL_FEE_MISCELLANEOUS',
197
- grossAmount: 0,
198
- nettAmount: 0
199
- },
200
- {
201
- name: 'REVERSAL_PROMOTIONS_CUSTOMER_RECEIVED',
202
- grossAmount: 0,
203
- nettAmount: 0
204
- },
205
- {
206
- name: 'REVERSAL_SELLER_RETURN_REFUND_AMOUNT',
207
- grossAmount: 0,
208
- nettAmount: 0
209
- },
210
- {
211
- name: 'REVERSAL_SHIPPING_CUSTOMER_PAID',
212
- grossAmount: 0,
213
- nettAmount: 0
214
- },
215
- {
216
- name: 'REVERSAL_SHIPPING_REBATE_PLATFORM',
217
- grossAmount: 0,
218
- nettAmount: 0
219
- },
220
- {
221
- name: 'REVERSAL_SHIPPING_SELLER_PAID',
222
- grossAmount: 0,
223
- nettAmount: 0
224
- },
225
- {
226
- name: 'SHIPPING_COST_TOTAL',
227
- grossAmount: 0,
228
- nettAmount: 0
229
- },
230
- {
231
- name: 'SHIPPING_CUSTOMER_PAID',
232
- grossAmount: 0,
233
- nettAmount: 0
234
- },
235
- {
236
- name: 'SHIPPING_REBATE_PLATFORM',
237
- grossAmount: 0,
238
- nettAmount: 0
239
- },
240
- {
241
- name: 'SHIPPING_SELLER_PAID',
242
- grossAmount: 0,
243
- nettAmount: 0
244
- },
245
- {
246
- name: 'TAXES',
247
- grossAmount: totalTax,
248
- nettAmount: subtotalTax
249
- },
250
- {
251
- name: 'VOUCHERS_CUSTOMER_RECEIVED',
252
- grossAmount: 0,
253
- nettAmount: 0
254
- },
255
- {
256
- name: 'VOUCHERS_REBATE_PLATFORM',
257
- grossAmount: 0,
258
- nettAmount: 0
259
- },
260
- {
261
- name: 'VOUCHERS_REBATE_SELLER',
262
- grossAmount: 0,
263
- nettAmount: 0
142
+ return {
143
+ id,
144
+ variationId,
145
+ currency: order.orderShipping.collectionCurrency,
146
+ createdAt: order.orderCreatedAt,
147
+ updatedAt: order.orderUpdatedAt,
148
+ charges: [
149
+ {
150
+ name: 'CHARGES_MARKETING',
151
+ grossAmount: 0,
152
+ nettAmount: 0
153
+ },
154
+ {
155
+ name: 'CLAIMS_DAMAGE',
156
+ grossAmount: 0,
157
+ nettAmount: 0
158
+ },
159
+ {
160
+ name: 'CLAIMS_LOST',
161
+ grossAmount: 0,
162
+ nettAmount: 0
163
+ },
164
+ {
165
+ name: 'COMMISSION_PLATFORM',
166
+ grossAmount: 0,
167
+ nettAmount: 0
168
+ },
169
+ {
170
+ name: 'DEPOSIT_PRESALE',
171
+ grossAmount: 0,
172
+ nettAmount: 0
173
+ },
174
+ {
175
+ name: 'FEE_MISCELLANEOUS',
176
+ grossAmount: 0,
177
+ nettAmount: 0
178
+ },
179
+ {
180
+ name: 'FEE_TRANSACTION',
181
+ grossAmount: 0,
182
+ nettAmount: 0
183
+ },
184
+ {
185
+ name: 'PRICE_NORMAL_SELLING',
186
+ grossAmount: total,
187
+ nettAmount: subtotal
188
+ },
189
+ {
190
+ name: 'PRICE_RECOMMENDED_RETAIL',
191
+ grossAmount: 0,
192
+ nettAmount: 0
193
+ },
194
+ {
195
+ name: 'PROMOTIONS_CUSTOMER_RECEIVED',
196
+ grossAmount: 0,
197
+ nettAmount: 0
198
+ },
199
+ {
200
+ name: 'PROMOTIONS_REBATE_PLATFORM',
201
+ grossAmount: 0,
202
+ nettAmount: 0
203
+ },
204
+ {
205
+ name: 'PROMOTIONS_REBATE_SELLER',
206
+ grossAmount: 0,
207
+ nettAmount: 0
208
+ },
209
+ {
210
+ name: 'REVERSAL_CHARGES_MARKETING',
211
+ grossAmount: 0,
212
+ nettAmount: 0
213
+ },
214
+ {
215
+ name: 'REVERSAL_COMMISSION',
216
+ grossAmount: 0,
217
+ nettAmount: 0
218
+ },
219
+ {
220
+ name: 'REVERSAL_FEE_MISCELLANEOUS',
221
+ grossAmount: 0,
222
+ nettAmount: 0
223
+ },
224
+ {
225
+ name: 'REVERSAL_PROMOTIONS_CUSTOMER_RECEIVED',
226
+ grossAmount: 0,
227
+ nettAmount: 0
228
+ },
229
+ {
230
+ name: 'REVERSAL_SELLER_RETURN_REFUND_AMOUNT',
231
+ grossAmount: 0,
232
+ nettAmount: 0
233
+ },
234
+ {
235
+ name: 'REVERSAL_SHIPPING_CUSTOMER_PAID',
236
+ grossAmount: 0,
237
+ nettAmount: 0
238
+ },
239
+ {
240
+ name: 'REVERSAL_SHIPPING_REBATE_PLATFORM',
241
+ grossAmount: 0,
242
+ nettAmount: 0
243
+ },
244
+ {
245
+ name: 'REVERSAL_SHIPPING_SELLER_PAID',
246
+ grossAmount: 0,
247
+ nettAmount: 0
248
+ },
249
+ {
250
+ name: 'SHIPPING_COST_TOTAL',
251
+ grossAmount: 0,
252
+ nettAmount: 0
253
+ },
254
+ {
255
+ name: 'SHIPPING_CUSTOMER_PAID',
256
+ grossAmount: 0,
257
+ nettAmount: 0
258
+ },
259
+ {
260
+ name: 'SHIPPING_REBATE_PLATFORM',
261
+ grossAmount: 0,
262
+ nettAmount: 0
263
+ },
264
+ {
265
+ name: 'SHIPPING_SELLER_PAID',
266
+ grossAmount: 0,
267
+ nettAmount: 0
268
+ },
269
+ {
270
+ name: 'TAXES',
271
+ grossAmount: totalTax,
272
+ nettAmount: subtotalTax
273
+ },
274
+ {
275
+ name: 'VOUCHERS_CUSTOMER_RECEIVED',
276
+ grossAmount: 0,
277
+ nettAmount: 0
278
+ },
279
+ {
280
+ name: 'VOUCHERS_REBATE_PLATFORM',
281
+ grossAmount: 0,
282
+ nettAmount: 0
283
+ },
284
+ {
285
+ name: 'VOUCHERS_REBATE_SELLER',
286
+ grossAmount: 0,
287
+ nettAmount: 0
288
+ }
289
+ ],
290
+ slaExpiresAt,
291
+ qty
264
292
  }
265
- ],
266
- slaExpiresAt,
267
- qty
268
- }
269
- })
293
+ })
270
294
 
271
- let mappedOrderItems = []
272
- orderItems.map(oi => {
273
- for (let i = 0; i < oi.qty; i++) {
274
- mappedOrderItems.push({
275
- ...oi,
276
- id: `${oi.id}-${i + 1}`
295
+ let mappedOrderItems = []
296
+ orderItems.map(oi => {
297
+ for (let i = 0; i < oi.qty; i++) {
298
+ mappedOrderItems.push({
299
+ ...oi,
300
+ id: `${oi.id}-${i + 1}`
301
+ })
302
+ }
277
303
  })
278
- }
279
- })
280
304
 
281
- return {
282
- custFirstName,
283
- custLastName,
284
- createdAt,
285
- updatedAt,
286
- id,
287
- billFirstName,
288
- billLastName,
289
- billAddress1: billAddress1.toString() || shipAddress1.toString(),
290
- billAddress2: billAddress2 || shipAddress2,
291
- billAddress3: billAddress3 || shipAddress3,
292
- billAddress4: billAddress4 || shipAddress4,
293
- billAddress5: billAddress5 || shipAddress5,
294
- billCity: billCity || shipCity,
295
- billPostalCode: billPostalCode || shipPostalCode,
296
- billCountry: billCountry || shipCountry,
297
- billPhone1: billPhone1 || shipPhone1,
298
- billPhone2: billPhone2 || shipPhone2,
299
- shipFirstName,
300
- shipLastName,
301
- shipAddress1: shipAddress1.toString(),
302
- shipAddress2,
303
- shipAddress3,
304
- shipAddress4,
305
- shipAddress5,
306
- shipCity,
307
- shipPostalCode,
308
- shipCountry,
309
- shipPhone1,
310
- shipPhone2,
311
- mappedOrderItems,
312
- channelShopId,
313
- organisationId,
314
- status,
315
- charges: getOrderCharges(mappedOrderItems)
316
- }
317
- })
305
+ return {
306
+ custFirstName,
307
+ custLastName,
308
+ createdAt,
309
+ updatedAt,
310
+ id,
311
+ billFirstName,
312
+ billLastName,
313
+ billAddress1: billAddress1.toString() || shipAddress1.toString(),
314
+ billAddress2: billAddress2 || shipAddress2,
315
+ billAddress3: billAddress3 || shipAddress3,
316
+ billAddress4: billAddress4 || shipAddress4,
317
+ billAddress5: billAddress5 || shipAddress5,
318
+ billCity: billCity || shipCity,
319
+ billPostalCode: billPostalCode || shipPostalCode,
320
+ billCountry: billCountry || shipCountry,
321
+ billPhone1: billPhone1 || shipPhone1,
322
+ billPhone2: billPhone2 || shipPhone2,
323
+ shipFirstName,
324
+ shipLastName,
325
+ shipAddress1: shipAddress1.toString(),
326
+ shipAddress2,
327
+ shipAddress3,
328
+ shipAddress4,
329
+ shipAddress5,
330
+ shipCity,
331
+ shipPostalCode,
332
+ shipCountry,
333
+ shipPhone1,
334
+ shipPhone2,
335
+ mappedOrderItems,
336
+ channelShopId,
337
+ organisationId,
338
+ status,
339
+ isSOF: isSOF ? isSOF : false,
340
+ orderPackage,
341
+ charges: getOrderCharges(mappedOrderItems)
342
+ }
343
+ })
344
+
345
+ if (mappedOrderResult.length > 0) {
346
+ await SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, { orders: mappedOrderResult })
318
347
 
319
- if (mappedOrderResult.length > 0) {
320
- await SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, { orders: mappedOrderResult })
348
+ await Promise.all(
349
+ mappedOrderResult.map(async result => {
350
+ if (!result?.isSOF && result?.orderPackage?.packageId) {
351
+ let orderPackage: any = result.orderPackage
352
+ let newOrderPackage: any = {
353
+ channelShopId,
354
+ nativeOrderId: result.id,
355
+ nativePackageId: orderPackage.packageId,
356
+ shippingTrackingCode: orderPackage.trackingNumber,
357
+ shippingTypeValue: orderPackage?.shippingType
358
+ ? orderPackage.shippingType
359
+ : SHIPPING_TYPE.DROP_SHIPPING,
360
+ warehouseCode: SHIPPING_TYPE.DROP_SHIPPING,
361
+ shipper: {
362
+ name: orderPackage.shippingProvider,
363
+ isCodSupported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
364
+ },
365
+ documents: orderPackage?.orderDocument || [],
366
+ shipperLastMile: {
367
+ name: orderPackage.shippingProvider,
368
+ isCodSupported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
369
+ },
370
+ orderItemIds: orderPackage?.orderListIdList
371
+ ? orderPackage.orderListIdList
372
+ : result.mappedOrderItems.map(orderItem => orderItem.id)
373
+ }
374
+
375
+ await SellercraftChannelIntegrationAPI.ingestChannelOrderPackage(sellercraftStore, newOrderPackage)
376
+ }
377
+ })
378
+ )
379
+ }
380
+ } catch (e) {}
321
381
  }
322
- }
323
382
 
324
- return true
383
+ return true
384
+ } catch (e) {}
325
385
  }
326
386
  }
327
387
  }