@things-factory/integration-sellercraft 5.0.0-alpha.9 → 5.0.0-zeta.1

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 (49) hide show
  1. package/dist-server/constants/order-status-mapping.js +24 -3
  2. package/dist-server/constants/order-status-mapping.js.map +1 -1
  3. package/dist-server/constants/platform.js +4 -1
  4. package/dist-server/constants/platform.js.map +1 -1
  5. package/dist-server/controllers/sellercraft/sellercraft.js +2 -2
  6. package/dist-server/controllers/sellercraft/sellercraft.js.map +1 -1
  7. package/dist-server/controllers/sellercraft-api/decorators.js +2 -0
  8. package/dist-server/controllers/sellercraft-api/decorators.js.map +1 -1
  9. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js +18 -21
  10. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.js.map +1 -1
  11. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js +5 -2
  12. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.js.map +1 -1
  13. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js +21 -14
  14. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.js.map +1 -1
  15. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js +23 -23
  16. package/dist-server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.js.map +1 -1
  17. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js +17 -6
  18. package/dist-server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.js.map +1 -1
  19. package/dist-server/routers/sellercraft-router.js +204 -134
  20. package/dist-server/routers/sellercraft-router.js.map +1 -1
  21. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js +327 -103
  22. package/dist-server/service/marketplace-channel/marketplace-channel-order-mutation.js.map +1 -1
  23. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js +173 -99
  24. package/dist-server/service/marketplace-channel/marketplace-channel-product-mutation.js.map +1 -1
  25. package/dist-server/service/marketplace-channel/marketplace-channel.js +5 -0
  26. package/dist-server/service/marketplace-channel/marketplace-channel.js.map +1 -1
  27. package/dist-server/service/sellercraft/sellercraft-mutation.js +3 -6
  28. package/dist-server/service/sellercraft/sellercraft-mutation.js.map +1 -1
  29. package/dist-server/service/sellercraft/sellercraft-query.js +1 -1
  30. package/dist-server/service/sellercraft/sellercraft-query.js.map +1 -1
  31. package/dist-server/utils/tokencraft-util.js +63 -0
  32. package/dist-server/utils/tokencraft-util.js.map +1 -0
  33. package/package.json +15 -15
  34. package/server/constants/order-status-mapping.ts +24 -2
  35. package/server/constants/platform.ts +4 -1
  36. package/server/controllers/sellercraft/sellercraft.ts +2 -2
  37. package/server/controllers/sellercraft-api/decorators.ts +3 -0
  38. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-categories.ts +19 -22
  39. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order-package.ts +6 -2
  40. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-order.ts +22 -15
  41. package/server/controllers/sellercraft-channel-integration/apis/ingest-channel-product.ts +32 -26
  42. package/server/controllers/sellercraft-channel-integration/sellercraft-channel-integration.ts +15 -6
  43. package/server/routers/sellercraft-router.ts +218 -164
  44. package/server/service/marketplace-channel/marketplace-channel-order-mutation.ts +392 -156
  45. package/server/service/marketplace-channel/marketplace-channel-product-mutation.ts +199 -145
  46. package/server/service/marketplace-channel/marketplace-channel.ts +4 -0
  47. package/server/service/sellercraft/sellercraft-mutation.ts +3 -3
  48. package/server/service/sellercraft/sellercraft-query.ts +1 -1
  49. package/server/utils/tokencraft-util.ts +60 -0
@@ -15,128 +15,352 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.MarketplaceChannelOrderMutation = void 0;
16
16
  const type_graphql_1 = require("type-graphql");
17
17
  const typeorm_1 = require("typeorm");
18
- const marketplace_channel_1 = require("./marketplace-channel");
19
18
  const env_1 = require("@things-factory/env");
20
19
  const integration_marketplace_1 = require("@things-factory/integration-marketplace");
20
+ const constants_1 = require("../../constants");
21
21
  const sellercraft_channel_integration_api_1 = require("../../controllers/sellercraft-channel-integration-api");
22
+ const marketplace_channel_1 = require("./marketplace-channel");
23
+ const tokencraft_util_1 = require("../../utils/tokencraft-util");
22
24
  let MarketplaceChannelOrderMutation = class MarketplaceChannelOrderMutation {
23
- async syncAllMarketplaceChannelOrders(fromDate, toDate, context) {
25
+ async syncAllMarketplaceChannelOrders(context, fromCreatedDate, toCreatedDate, fromUpdatedDate, toUpdatedDate) {
26
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
24
27
  const sellercraftChannelIntegrationConfig = env_1.config.get('sellercraftChannelIntegrationConfig', {});
25
- const { tokenCraftApiKey: apiKey, getShopsTokenCraftUrl } = sellercraftChannelIntegrationConfig;
26
- const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find();
28
+ const channels = await (0, typeorm_1.getRepository)(marketplace_channel_1.MarketplaceChannel).find({ where: { isActive: true } });
27
29
  for (var i = 0; i < channels.length; i++) {
28
- var channelsFullPath = getShopsTokenCraftUrl + '?channel_id=' + channels[i].channelId;
29
- const channelResponse = await fetch(channelsFullPath, {
30
- method: 'get',
31
- headers: {
32
- 'Content-Type': 'application/json',
33
- 'x-api-key': apiKey
34
- }
35
- });
36
- if (!channelResponse.ok) {
37
- throw new Error(channelResponse);
38
- }
39
- var shopsResponse = await channelResponse.json();
40
- var shops = shopsResponse.shops;
41
- for (var j = 0; j < shops.length; j++) {
42
- var store = {
43
- accessKey: shops[j].credential.consumer_key,
44
- accessSecret: shops[j].credential.consumer_secret,
45
- storeURL: shops[j].credential.store_url,
46
- platform: channels[i].name
47
- };
48
- // let countryCode = shops[j].country_code
49
- // let channelCode = shops[j].org_prefix
50
- let organisationId = shops[j].credential.account_id;
51
- let channelShopId = shops[j].credential.channel_shop_id;
52
- const orderReq = {
53
- fromDate: fromDate,
54
- toDate: toDate
55
- };
56
- const orderResult = await integration_marketplace_1.StoreAPI.getStoreOrders(store, orderReq);
57
- var sellercraftStore = Object.assign(Object.assign({}, store), { platform: 'sellercraftChannelIntegration' });
58
- let mappedOrderResult = orderResult.results.map(order => {
59
- let { firstName: custFirstName, lastName: custLastName, orderCreatedAt: createdAt, orderUpdatedAt: updatedAt, orderNo: id, status } = order;
60
- let { first_name: billFirstName, last_name: billLastName, address_1: billAddress1, address_2: billAddress2, address_3: billAddress3, address_4: billAddress4, address_5: billAddress5, city: billCity, postcode: billPostalCode, country: billCountry, phone: billPhone1, phone_2: billPhone2 } = order.billing;
61
- let { first_name: shipFirstName, last_name: shipLastName, address_1: shipAddress1, address_2: shipAddress2, address_3: shipAddress3, address_4: shipAddress4, address_5: shipAddress5, city: shipCity, postcode: shipPostalCode, country: shipCountry, phone: shipPhone1, phone_2: shipPhone2 } = order.shipping;
62
- let orderItems = order.orderItems.map(item => {
63
- let { name: id, variationId: variationId, slaExpiresAt, total, totalTax, subtotal, subtotalTax } = item;
64
- return {
65
- id,
66
- variationId,
67
- currency: order.orderShipping.collectionCurrency,
68
- createdAt: order.orderCreatedAt,
69
- updatedAt: order.orderUpdatedAt,
70
- charges: [
71
- {
72
- name: 'PRICE_NORMAL_SELLING',
73
- grossAmount: total,
74
- nettAmount: subtotal
75
- },
76
- {
77
- name: 'TAXES',
78
- grossAmount: totalTax,
79
- nettAmount: subtotalTax
80
- }
81
- ],
82
- slaExpiresAt
30
+ try {
31
+ const channel = channels[i];
32
+ let shops = await (0, tokencraft_util_1.getShops)(channel.channelId);
33
+ for (var j = 0; j < shops.length; j++) {
34
+ try {
35
+ var store = {
36
+ accessKey: ((_b = (_a = shops[j]) === null || _a === void 0 ? void 0 : _a.credential) === null || _b === void 0 ? void 0 : _b.consumer_key) || '',
37
+ accessSecret: ((_d = (_c = shops[j]) === null || _c === void 0 ? void 0 : _c.credential) === null || _d === void 0 ? void 0 : _d.consumer_secret) || '',
38
+ storeURL: ((_f = (_e = shops[j]) === null || _e === void 0 ? void 0 : _e.credential) === null || _f === void 0 ? void 0 : _f.store_url) || '',
39
+ platform: channel.name,
40
+ accessToken: (_h = (_g = shops[j]) === null || _g === void 0 ? void 0 : _g.credential) === null || _h === void 0 ? void 0 : _h.access_token,
41
+ channelShopId: (_j = shops[j]) === null || _j === void 0 ? void 0 : _j.channel_shop_id,
42
+ storeId: ((_l = (_k = shops[j]) === null || _k === void 0 ? void 0 : _k.credential) === null || _l === void 0 ? void 0 : _l.store_url) || ''
83
43
  };
84
- });
85
- return {
86
- custFirstName,
87
- custLastName,
88
- createdAt,
89
- updatedAt,
90
- id,
91
- billFirstName,
92
- billLastName,
93
- billAddress1,
94
- billAddress2,
95
- billAddress3,
96
- billAddress4,
97
- billAddress5,
98
- billCity,
99
- billPostalCode,
100
- billCountry,
101
- billPhone1,
102
- billPhone2,
103
- shipFirstName,
104
- shipLastName,
105
- shipAddress1,
106
- shipAddress2,
107
- shipAddress3,
108
- shipAddress4,
109
- shipAddress5,
110
- shipCity,
111
- shipPostalCode,
112
- shipCountry,
113
- shipPhone1,
114
- shipPhone2,
115
- orderItems,
116
- channelShopId,
117
- organisationId,
118
- status
119
- };
120
- });
121
- if (mappedOrderResult.length > 0) {
122
- const ingestOrder = await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, { orders: mappedOrderResult });
44
+ // let countryCode = shops[j].country_code
45
+ // let channelCode = shops[j].org_prefix
46
+ let organisationId = shops[j].account_id;
47
+ let channelShopId = shops[j].channel_shop_id;
48
+ let orderResult = [];
49
+ let page = store.platform == 'magento' ? 1 : 0;
50
+ let hasMorePage = true;
51
+ let lastOrderId;
52
+ let cursor;
53
+ var limit = 50;
54
+ while (hasMorePage) {
55
+ const { results: marketplaceOrders, more, nextCursor } = await integration_marketplace_1.StoreAPI.getStoreOrders(store, {
56
+ fromCreatedDate,
57
+ toCreatedDate,
58
+ fromUpdatedDate,
59
+ toUpdatedDate,
60
+ pagination: { page, limit },
61
+ lastOrderId,
62
+ nextCursor: cursor
63
+ });
64
+ orderResult.push(...marketplaceOrders);
65
+ if (more)
66
+ page++;
67
+ hasMorePage = more;
68
+ cursor = nextCursor;
69
+ }
70
+ var sellercraftStore = Object.assign(Object.assign({}, store), { platform: 'sellercraftChannelIntegration' });
71
+ let mappedOrderResult = orderResult.map(order => {
72
+ let id = store.platform == 'magento' || store.platform == 'shopify' ? order.name : order.orderNo;
73
+ let { firstName: custFirstName, lastName: custLastName, orderCreatedAt: createdAt, orderUpdatedAt: updatedAt, status, sellercraftStatus, isSOF } = order;
74
+ let { first_name: billFirstName, last_name: billLastName, address_1: billAddress1, address_2: billAddress2, address_3: billAddress3, address_4: billAddress4, address_5: billAddress5, city: billCity, postcode: billPostalCode, country: billCountry, phone: billPhone1, phone_2: billPhone2 } = order === null || order === void 0 ? void 0 : order.billing;
75
+ let { first_name: shipFirstName, last_name: shipLastName, address_1: shipAddress1, address_2: shipAddress2, address_3: shipAddress3, address_4: shipAddress4, address_5: shipAddress5, city: shipCity, postcode: shipPostalCode, country: shipCountry, phone: shipPhone1, phone_2: shipPhone2 } = order.shipping;
76
+ let orderPackage = (order === null || order === void 0 ? void 0 : order.orderPackage) || {};
77
+ let orderItems = order.orderItems.map(item => {
78
+ let { name: id, variationId: variationId, slaExpiresAt, total, totalTax, subtotal, subtotalTax, qty } = item;
79
+ return {
80
+ id,
81
+ variationId,
82
+ currency: order.orderShipping.collectionCurrency,
83
+ createdAt: order.orderCreatedAt,
84
+ updatedAt: order.orderUpdatedAt,
85
+ charges: [
86
+ {
87
+ name: 'CHARGES_MARKETING',
88
+ grossAmount: 0,
89
+ nettAmount: 0
90
+ },
91
+ {
92
+ name: 'CLAIMS_DAMAGE',
93
+ grossAmount: 0,
94
+ nettAmount: 0
95
+ },
96
+ {
97
+ name: 'CLAIMS_LOST',
98
+ grossAmount: 0,
99
+ nettAmount: 0
100
+ },
101
+ {
102
+ name: 'COMMISSION_PLATFORM',
103
+ grossAmount: 0,
104
+ nettAmount: 0
105
+ },
106
+ {
107
+ name: 'DEPOSIT_PRESALE',
108
+ grossAmount: 0,
109
+ nettAmount: 0
110
+ },
111
+ {
112
+ name: 'FEE_MISCELLANEOUS',
113
+ grossAmount: 0,
114
+ nettAmount: 0
115
+ },
116
+ {
117
+ name: 'FEE_TRANSACTION',
118
+ grossAmount: 0,
119
+ nettAmount: 0
120
+ },
121
+ {
122
+ name: 'PRICE_NORMAL_SELLING',
123
+ grossAmount: total,
124
+ nettAmount: subtotal
125
+ },
126
+ {
127
+ name: 'PRICE_RECOMMENDED_RETAIL',
128
+ grossAmount: 0,
129
+ nettAmount: 0
130
+ },
131
+ {
132
+ name: 'PROMOTIONS_CUSTOMER_RECEIVED',
133
+ grossAmount: 0,
134
+ nettAmount: 0
135
+ },
136
+ {
137
+ name: 'PROMOTIONS_REBATE_PLATFORM',
138
+ grossAmount: 0,
139
+ nettAmount: 0
140
+ },
141
+ {
142
+ name: 'PROMOTIONS_REBATE_SELLER',
143
+ grossAmount: 0,
144
+ nettAmount: 0
145
+ },
146
+ {
147
+ name: 'REVERSAL_CHARGES_MARKETING',
148
+ grossAmount: 0,
149
+ nettAmount: 0
150
+ },
151
+ {
152
+ name: 'REVERSAL_COMMISSION',
153
+ grossAmount: 0,
154
+ nettAmount: 0
155
+ },
156
+ {
157
+ name: 'REVERSAL_FEE_MISCELLANEOUS',
158
+ grossAmount: 0,
159
+ nettAmount: 0
160
+ },
161
+ {
162
+ name: 'REVERSAL_PROMOTIONS_CUSTOMER_RECEIVED',
163
+ grossAmount: 0,
164
+ nettAmount: 0
165
+ },
166
+ {
167
+ name: 'REVERSAL_SELLER_RETURN_REFUND_AMOUNT',
168
+ grossAmount: 0,
169
+ nettAmount: 0
170
+ },
171
+ {
172
+ name: 'REVERSAL_SHIPPING_CUSTOMER_PAID',
173
+ grossAmount: 0,
174
+ nettAmount: 0
175
+ },
176
+ {
177
+ name: 'REVERSAL_SHIPPING_REBATE_PLATFORM',
178
+ grossAmount: 0,
179
+ nettAmount: 0
180
+ },
181
+ {
182
+ name: 'REVERSAL_SHIPPING_SELLER_PAID',
183
+ grossAmount: 0,
184
+ nettAmount: 0
185
+ },
186
+ {
187
+ name: 'SHIPPING_COST_TOTAL',
188
+ grossAmount: 0,
189
+ nettAmount: 0
190
+ },
191
+ {
192
+ name: 'SHIPPING_CUSTOMER_PAID',
193
+ grossAmount: 0,
194
+ nettAmount: 0
195
+ },
196
+ {
197
+ name: 'SHIPPING_REBATE_PLATFORM',
198
+ grossAmount: 0,
199
+ nettAmount: 0
200
+ },
201
+ {
202
+ name: 'SHIPPING_SELLER_PAID',
203
+ grossAmount: 0,
204
+ nettAmount: 0
205
+ },
206
+ {
207
+ name: 'TAXES',
208
+ grossAmount: totalTax,
209
+ nettAmount: subtotalTax
210
+ },
211
+ {
212
+ name: 'VOUCHERS_CUSTOMER_RECEIVED',
213
+ grossAmount: 0,
214
+ nettAmount: 0
215
+ },
216
+ {
217
+ name: 'VOUCHERS_REBATE_PLATFORM',
218
+ grossAmount: 0,
219
+ nettAmount: 0
220
+ },
221
+ {
222
+ name: 'VOUCHERS_REBATE_SELLER',
223
+ grossAmount: 0,
224
+ nettAmount: 0
225
+ }
226
+ ],
227
+ slaExpiresAt,
228
+ qty
229
+ };
230
+ });
231
+ let mappedOrderItems = [];
232
+ orderItems.map(oi => {
233
+ for (let i = 0; i < oi.qty; i++) {
234
+ mappedOrderItems.push(Object.assign(Object.assign({}, oi), { id: `${oi.id}-${i + 1}` }));
235
+ }
236
+ });
237
+ return {
238
+ custFirstName,
239
+ custLastName,
240
+ createdAt,
241
+ updatedAt,
242
+ id,
243
+ billFirstName,
244
+ billLastName,
245
+ billAddress1: billAddress1.toString() || shipAddress1.toString(),
246
+ billAddress2: billAddress2 || shipAddress2,
247
+ billAddress3: billAddress3 || shipAddress3,
248
+ billAddress4: billAddress4 || shipAddress4,
249
+ billAddress5: billAddress5 || shipAddress5,
250
+ billCity: billCity || shipCity,
251
+ billPostalCode: billPostalCode || shipPostalCode,
252
+ billCountry: billCountry || shipCountry,
253
+ billPhone1: billPhone1 || shipPhone1,
254
+ billPhone2: billPhone2 || shipPhone2,
255
+ shipFirstName,
256
+ shipLastName,
257
+ shipAddress1: shipAddress1.toString(),
258
+ shipAddress2,
259
+ shipAddress3,
260
+ shipAddress4,
261
+ shipAddress5,
262
+ shipCity,
263
+ shipPostalCode,
264
+ shipCountry,
265
+ shipPhone1,
266
+ shipPhone2,
267
+ mappedOrderItems,
268
+ channelShopId,
269
+ organisationId,
270
+ status: sellercraftStatus || status,
271
+ isSOF: isSOF ? isSOF : false,
272
+ orderPackage,
273
+ charges: getOrderCharges(mappedOrderItems)
274
+ };
275
+ });
276
+ if (mappedOrderResult.length > 0) {
277
+ while (mappedOrderResult.length > 0) {
278
+ let spliceResult = mappedOrderResult.splice(0, mappedOrderResult.length >= 20 ? 20 : mappedOrderResult.length);
279
+ try {
280
+ await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelOrder(sellercraftStore, {
281
+ orders: spliceResult
282
+ });
283
+ }
284
+ catch (e) { }
285
+ await Promise.all(spliceResult.map(async (result) => {
286
+ var _a;
287
+ if (!(result === null || result === void 0 ? void 0 : result.isSOF) && ((_a = result === null || result === void 0 ? void 0 : result.orderPackage) === null || _a === void 0 ? void 0 : _a.packageId)) {
288
+ let orderPackage = result.orderPackage;
289
+ let newOrderPackage = {
290
+ channelShopId,
291
+ nativeOrderId: result.id,
292
+ nativePackageId: orderPackage.packageId,
293
+ shippingTrackingCode: orderPackage.trackingNumber,
294
+ shippingTypeValue: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.shippingType)
295
+ ? orderPackage.shippingType
296
+ : constants_1.SHIPPING_TYPE.DROP_SHIPPING,
297
+ warehouseCode: constants_1.SHIPPING_TYPE.DROP_SHIPPING,
298
+ shipper: {
299
+ name: orderPackage.shippingProvider,
300
+ isCodSupported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
301
+ },
302
+ documents: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.orderDocument) || [],
303
+ shipperLastMile: {
304
+ name: orderPackage.shippingProvider,
305
+ isCodSupported: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.isCodSupport) ? orderPackage.isCodSupport : false
306
+ },
307
+ orderItemIds: (orderPackage === null || orderPackage === void 0 ? void 0 : orderPackage.orderListIdList)
308
+ ? orderPackage.orderListIdList
309
+ : result.mappedOrderItems.map(orderItem => orderItem.id)
310
+ };
311
+ try {
312
+ await sellercraft_channel_integration_api_1.SellercraftChannelIntegrationAPI.ingestChannelOrderPackage(sellercraftStore, newOrderPackage);
313
+ }
314
+ catch (e) { }
315
+ }
316
+ }));
317
+ }
318
+ }
319
+ }
320
+ catch (e) { }
123
321
  }
124
322
  }
125
- return true;
323
+ catch (e) { }
126
324
  }
325
+ return true;
127
326
  }
128
327
  };
129
328
  __decorate([
130
329
  (0, type_graphql_1.Mutation)(returns => Boolean),
131
- __param(0, (0, type_graphql_1.Arg)('fromDate')),
132
- __param(1, (0, type_graphql_1.Arg)('toDate')),
133
- __param(2, (0, type_graphql_1.Ctx)()),
330
+ __param(0, (0, type_graphql_1.Ctx)()),
331
+ __param(1, (0, type_graphql_1.Arg)('fromCreatedDate', { nullable: true })),
332
+ __param(2, (0, type_graphql_1.Arg)('toCreatedDate', { nullable: true })),
333
+ __param(3, (0, type_graphql_1.Arg)('fromUpdatedDate', { nullable: true })),
334
+ __param(4, (0, type_graphql_1.Arg)('toUpdatedDate', { nullable: true })),
134
335
  __metadata("design:type", Function),
135
- __metadata("design:paramtypes", [String, String, Object]),
336
+ __metadata("design:paramtypes", [Object, String, String, String, String]),
136
337
  __metadata("design:returntype", Promise)
137
338
  ], MarketplaceChannelOrderMutation.prototype, "syncAllMarketplaceChannelOrders", null);
138
339
  MarketplaceChannelOrderMutation = __decorate([
139
340
  (0, type_graphql_1.Resolver)()
140
341
  ], MarketplaceChannelOrderMutation);
141
342
  exports.MarketplaceChannelOrderMutation = MarketplaceChannelOrderMutation;
343
+ function getOrderCharges(mappedOrderItems) {
344
+ let chargesList = [];
345
+ for (let i = 0; i < mappedOrderItems.length; i++) {
346
+ for (let j = 0; j < mappedOrderItems[i].charges.length; j++) {
347
+ let charge = mappedOrderItems[i].charges[j];
348
+ let foundCharge = chargesList.find(cl => cl.name == charge.name);
349
+ if (foundCharge) {
350
+ foundCharge.grossAmount = parseFloat(foundCharge.grossAmount) + parseFloat(charge.grossAmount);
351
+ foundCharge.nettAmount = parseFloat(foundCharge.nettAmount) + parseFloat(charge.nettAmount);
352
+ chargesList = chargesList.filter(cl => cl.name != charge.name);
353
+ }
354
+ else {
355
+ foundCharge = {
356
+ name: charge.name,
357
+ grossAmount: charge.grossAmount,
358
+ nettAmount: charge.nettAmount
359
+ };
360
+ }
361
+ chargesList.push(foundCharge);
362
+ }
363
+ }
364
+ return chargesList;
365
+ }
142
366
  //# sourceMappingURL=marketplace-channel-order-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-channel-order-mutation.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel-order-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAAuC;AAEvC,+DAA0D;AAE1D,6CAA4C;AAC5C,qFAAkE;AAClE,+GAAwG;AAGxG,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAE1C,KAAK,CAAC,+BAA+B,CAClB,QAAgB,EAClB,MAAc,EACtB,OAAY;QAEnB,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;QACjG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,mCAAmC,CAAA;QAE/F,MAAM,QAAQ,GAAyB,MAAM,IAAA,uBAAa,EAAC,wCAAkB,CAAC,CAAC,IAAI,EAAE,CA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C;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IAE1B,WAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;IACf,WAAA,IAAA,kBAAG,EAAC,QAAQ,CAAC,CAAA;IACb,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;sFAqKP;AA1KU,+BAA+B;IAD3C,IAAA,uBAAQ,GAAE;GACE,+BAA+B,CA2K3C;AA3KY,0EAA+B"}
1
+ {"version":3,"file":"marketplace-channel-order-mutation.js","sourceRoot":"","sources":["../../../server/service/marketplace-channel/marketplace-channel-order-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAAuC;AAEvC,6CAA4C;AAC5C,qFAAkE;AAElE,+CAA+C;AAC/C,+GAAwG;AACxG,+DAA0D;AAC1D,iEAAsD;AAGtD,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAE1C,KAAK,CAAC,+BAA+B,CAC5B,OAAY,EACyB,eAAwB,EAC1B,aAAsB,EACpB,eAAwB,EAC1B,aAAsB;;QAEhE,MAAM,mCAAmC,GAAG,YAAM,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,CAAC,CAAA;QAEjG,MAAM,QAAQ,GAAyB,MAAM,IAAA,uBAAa,EAAC,wCAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAElH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI;gBACF,MAAM,OAAO,GAAuB,QAAQ,CAAC,CAAC,CAAC,CAAA;gBAC/C,IAAI,KAAK,GAAQ,MAAM,IAAA,0BAAQ,EAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC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