@pmcretail/mapper-library 0.0.46 → 0.0.48
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/bundles/pmcretail-mapper-library.umd.js +174 -168
- package/bundles/pmcretail-mapper-library.umd.js.map +1 -1
- package/esm2015/lib/WebReturnMagento2RestV1.class.js +268 -0
- package/esm2015/lib/mapper-library.model.js +2 -1
- package/esm2015/public-api.js +2 -2
- package/fesm2015/pmcretail-mapper-library.js +156 -149
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/lib/{WebReturnMagentoV2Rest.class.d.ts → WebReturnMagento2RestV1.class.d.ts} +5 -3
- package/lib/WebReturnMagento2RestV1.class.d.ts.map +1 -0
- package/lib/mapper-library.model.d.ts +9 -2
- package/lib/mapper-library.model.d.ts.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/public-api.d.ts.map +1 -1
- package/esm2015/lib/WebReturnMagentoV2Rest.class.js +0 -262
- package/lib/WebReturnMagentoV2Rest.class.d.ts.map +0 -1
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
(function (PROVIDERS) {
|
|
94
94
|
PROVIDERS["SALESFORCE"] = "Salesforce";
|
|
95
95
|
PROVIDERS["MAGENTO"] = "Magento";
|
|
96
|
+
PROVIDERS["MAGENTO2"] = "Magento2";
|
|
96
97
|
})(PROVIDERS || (PROVIDERS = {}));
|
|
97
98
|
var PROMOTION_LEVEL;
|
|
98
99
|
(function (PROMOTION_LEVEL) {
|
|
@@ -4146,10 +4147,10 @@
|
|
|
4146
4147
|
return WebReturnSalesforceMapperBuilderClass;
|
|
4147
4148
|
}());
|
|
4148
4149
|
|
|
4149
|
-
var
|
|
4150
|
-
function
|
|
4150
|
+
var WebReturnMagento2RestV1MapperBuilderClass = /** @class */ (function () {
|
|
4151
|
+
function WebReturnMagento2RestV1MapperBuilderClass(orderDetails, currencyPipe) {
|
|
4151
4152
|
this.currencyPipe = currencyPipe;
|
|
4152
|
-
this.className = "
|
|
4153
|
+
this.className = "WebReturnMagento2RestV1MapperBuilderClass";
|
|
4153
4154
|
this.webReturnObject = {
|
|
4154
4155
|
id: '',
|
|
4155
4156
|
orgCode: "",
|
|
@@ -4176,16 +4177,16 @@
|
|
|
4176
4177
|
postCode: '',
|
|
4177
4178
|
noCustomerSelected: false
|
|
4178
4179
|
},
|
|
4179
|
-
currentTransactionDetails: {}
|
|
4180
|
+
currentTransactionDetails: {},
|
|
4181
|
+
externalTransactionDetails: []
|
|
4180
4182
|
};
|
|
4181
4183
|
if (orderDetails) {
|
|
4182
4184
|
this.orderDetails = orderDetails;
|
|
4183
4185
|
}
|
|
4184
4186
|
this.numberUtilService = new NumberUtilService(currencyPipe);
|
|
4185
4187
|
}
|
|
4186
|
-
|
|
4187
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "
|
|
4188
|
-
// this.webReturnObject['type'] = TRANSACTION_TYPE.WEB_RETURNS; // TODO
|
|
4188
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.webReturnCommonMapper = function () {
|
|
4189
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "Mapping started...");
|
|
4189
4190
|
this.webReturnObject['datetime'] = this.getUTCDateTime(this.orderDetails.updated_at);
|
|
4190
4191
|
this.webReturnObject.baseCurrency = this.orderDetails.order_currency_code;
|
|
4191
4192
|
this.webReturnObject.subsidiaryId = '1';
|
|
@@ -4195,218 +4196,223 @@
|
|
|
4195
4196
|
this.webReturnObject.updatedAt = this.getUTCDateTime(this.orderDetails.updated_at);
|
|
4196
4197
|
this.webReturnObject.transCompletedAt = this.getUTCDateTime(this.orderDetails.updated_at);
|
|
4197
4198
|
this.webReturnObject['externalTransactionId'] = this.orderDetails.increment_id;
|
|
4198
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "
|
|
4199
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "Mapping ended...");
|
|
4199
4200
|
return this;
|
|
4200
4201
|
};
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
this.orderDetails.items.forEach(function (product) {
|
|
4217
|
-
if (product && product.base_price) {
|
|
4218
|
-
var productObj = {
|
|
4219
|
-
description: product.name ? product.name : '',
|
|
4220
|
-
SKU: product.sku ? product.sku : '',
|
|
4221
|
-
quantity: product.qty_ordered ? product.qty_ordered : 0,
|
|
4222
|
-
refundedQuantity: product.qty_refunded ? product.qty_refunded : 0,
|
|
4223
|
-
price: product.base_price ? product.base_price : 0,
|
|
4224
|
-
itemLineId: (index_1 + 1).toString(),
|
|
4225
|
-
externalItemLineId: product.item_id ? product.item_id : (index_1 + 1).toString(),
|
|
4226
|
-
// deliveryMethod: this.getDeliveryMethod().toString(),
|
|
4227
|
-
totalLinePrice: (product.qty_ordered && product.base_price) ? (product.qty_ordered * product.base_price) : 0
|
|
4228
|
-
};
|
|
4229
|
-
_this.webReturnObject.basket['products'].push(productObj);
|
|
4230
|
-
index_1++;
|
|
4231
|
-
}
|
|
4202
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.product = function () {
|
|
4203
|
+
var _a;
|
|
4204
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "product", "Mapping started...");
|
|
4205
|
+
this.webReturnObject.basket['products'] = ((_a = this.orderDetails.items) === null || _a === void 0 ? void 0 : _a.filter(function (product) { return product === null || product === void 0 ? void 0 : product.base_price; }).map(function (product, index) {
|
|
4206
|
+
var _a, _b;
|
|
4207
|
+
return ({
|
|
4208
|
+
description: product.name || '',
|
|
4209
|
+
SKU: product.sku || '',
|
|
4210
|
+
quantity: product.qty_ordered || 0,
|
|
4211
|
+
refundedQuantity: product.qty_refunded || 0,
|
|
4212
|
+
price: product.base_price || 0,
|
|
4213
|
+
itemLineId: (index + 1).toString(),
|
|
4214
|
+
externalItemLineId: product.item_id || (index + 1).toString(),
|
|
4215
|
+
totalLinePrice: ((_a = product.qty_ordered) !== null && _a !== void 0 ? _a : 0) * ((_b = product.base_price) !== null && _b !== void 0 ? _b : 0),
|
|
4216
|
+
refundedTotal: product.amount_refunded || 0
|
|
4232
4217
|
});
|
|
4233
|
-
}
|
|
4234
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "product", "
|
|
4218
|
+
})) || [];
|
|
4219
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "product", "Mapping ended...");
|
|
4235
4220
|
return this;
|
|
4236
4221
|
};
|
|
4237
|
-
|
|
4222
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.linePromotion = function () {
|
|
4238
4223
|
var _this = this;
|
|
4239
|
-
|
|
4240
|
-
this.
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
linePromotionObj.name = _this.orderDetails.coupon_code ? _this.orderDetails.coupon_code : '';
|
|
4257
|
-
;
|
|
4258
|
-
linePromotionObj.promotionInfo = '';
|
|
4259
|
-
linePromotionObj.promotionLinePrice = product.row_total ? product.row_total : 0;
|
|
4260
|
-
_this.webReturnObject.basket.linePromotion.push(linePromotionObj);
|
|
4261
|
-
index_2++;
|
|
4262
|
-
}
|
|
4263
|
-
});
|
|
4264
|
-
}
|
|
4265
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "linePromotion", "linePromotion mapping ended...");
|
|
4224
|
+
var _a;
|
|
4225
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "linePromotion", "Mapping started...");
|
|
4226
|
+
this.webReturnObject.basket['linePromotion'] = ((_a = this.orderDetails.items) === null || _a === void 0 ? void 0 : _a.filter(function (product) { return (product === null || product === void 0 ? void 0 : product.base_price) && product.discount_amount; }).map(function (product, index) { return ({
|
|
4227
|
+
trigger: [{
|
|
4228
|
+
itemLineId: (index + 1).toString(),
|
|
4229
|
+
quantity: product.qty_ordered || 0
|
|
4230
|
+
}],
|
|
4231
|
+
itemLineId: index + 1,
|
|
4232
|
+
promotionId: '',
|
|
4233
|
+
displayText: _this.orderDetails.coupon_code || '',
|
|
4234
|
+
promotionType: '',
|
|
4235
|
+
promotionAmount: product.discount_amount || 0,
|
|
4236
|
+
name: _this.orderDetails.coupon_code || '',
|
|
4237
|
+
promotionInfo: '',
|
|
4238
|
+
promotionLinePrice: product.row_total || 0
|
|
4239
|
+
}); })) || [];
|
|
4240
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "linePromotion", "Mapping ended...");
|
|
4266
4241
|
return this;
|
|
4267
4242
|
};
|
|
4268
|
-
|
|
4269
|
-
var
|
|
4270
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "customer", "
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4243
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.customer = function () {
|
|
4244
|
+
var _a, _b, _c, _d;
|
|
4245
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "customer", "Mapping started...");
|
|
4246
|
+
var _e = this, orderDetails = _e.orderDetails, webReturnObject = _e.webReturnObject;
|
|
4247
|
+
webReturnObject.customer = {
|
|
4248
|
+
id: orderDetails.customer_id || '',
|
|
4249
|
+
email: orderDetails.customer_email || '',
|
|
4250
|
+
firstName: orderDetails.customer_firstname || '',
|
|
4251
|
+
lastName: orderDetails.customer_lastname || '',
|
|
4252
|
+
shippingAddress: [],
|
|
4253
|
+
billingAddress: []
|
|
4254
|
+
};
|
|
4255
|
+
var shippingAssignments = ((_a = orderDetails.extension_attributes) === null || _a === void 0 ? void 0 : _a.shipping_assignments) || [];
|
|
4256
|
+
webReturnObject.customer.shippingAddress = shippingAssignments
|
|
4257
|
+
.filter(function (shipment) { var _a; return (_a = shipment === null || shipment === void 0 ? void 0 : shipment.shipping) === null || _a === void 0 ? void 0 : _a.address; })
|
|
4258
|
+
.map(function (shipment) {
|
|
4259
|
+
var _a, _b, _c;
|
|
4260
|
+
var address = shipment.shipping.address;
|
|
4261
|
+
return {
|
|
4262
|
+
id: address.customer_address_id || '',
|
|
4263
|
+
countryCode: address.country_id || '',
|
|
4264
|
+
address1: ((_a = address.street) === null || _a === void 0 ? void 0 : _a[0]) || '',
|
|
4265
|
+
address2: ((_b = address.street) === null || _b === void 0 ? void 0 : _b[1]) || '',
|
|
4266
|
+
address3: ((_c = address.street) === null || _c === void 0 ? void 0 : _c[2]) || '',
|
|
4267
|
+
city: address.city || '',
|
|
4268
|
+
country: '',
|
|
4269
|
+
postCode: address.postcode || ''
|
|
4270
|
+
};
|
|
4271
|
+
});
|
|
4272
|
+
var billingAddress = orderDetails.billing_address;
|
|
4273
|
+
if (billingAddress) {
|
|
4274
|
+
webReturnObject.customer.billingAddress.push({
|
|
4275
|
+
id: billingAddress.customer_address_id || '',
|
|
4276
|
+
countryCode: billingAddress.country_id || '',
|
|
4277
|
+
address1: ((_b = billingAddress.street) === null || _b === void 0 ? void 0 : _b[0]) || '',
|
|
4278
|
+
address2: ((_c = billingAddress.street) === null || _c === void 0 ? void 0 : _c[1]) || '',
|
|
4279
|
+
address3: ((_d = billingAddress.street) === null || _d === void 0 ? void 0 : _d[2]) || '',
|
|
4280
|
+
city: billingAddress.city || '',
|
|
4281
|
+
country: '',
|
|
4282
|
+
postCode: billingAddress.postcode || ''
|
|
4295
4283
|
});
|
|
4296
4284
|
}
|
|
4297
|
-
|
|
4298
|
-
var address = this.orderDetails.billing_address;
|
|
4299
|
-
var billingAddressObj = {};
|
|
4300
|
-
billingAddressObj.id = address.customer_address_id ? address.customer_address_id : '';
|
|
4301
|
-
billingAddressObj.countryCode = address.country_id ? address.country_id : '';
|
|
4302
|
-
if (address.street && address.street.length > 0) {
|
|
4303
|
-
billingAddressObj.address1 = address.street[0] ? address.street[0] : '';
|
|
4304
|
-
billingAddressObj.address2 = address.street[1] ? address.street[1] : '';
|
|
4305
|
-
billingAddressObj.address3 = address.street[2] ? address.street[2] : '';
|
|
4306
|
-
}
|
|
4307
|
-
billingAddressObj.city = address.city ? address.city : '';
|
|
4308
|
-
billingAddressObj.country = '';
|
|
4309
|
-
billingAddressObj.postCode = address.postcode ? address.postcode : '';
|
|
4310
|
-
this.webReturnObject.customer.shippingAddress.push(billingAddressObj);
|
|
4311
|
-
}
|
|
4312
|
-
// let shipmentDetails = [] as ShipmentDetails[];
|
|
4313
|
-
// this.orderDetails.shipments.forEach(
|
|
4314
|
-
// shipment => {
|
|
4315
|
-
// let shipmentDetailsObj = {} as ShipmentDetails;
|
|
4316
|
-
// shipmentDetailsObj.id = shipment.shipment_id ? shipment.shipment_id : '';
|
|
4317
|
-
// shipmentDetailsObj.deliveryGroup = shipment.shipment_id ? shipment.shipment_id : '';
|
|
4318
|
-
// shipmentDetails.push(shipmentDetailsObj);
|
|
4319
|
-
// }
|
|
4320
|
-
// );
|
|
4321
|
-
// customerObj.shipmentDetails = shipmentDetails;
|
|
4322
|
-
// this.webReturnObject.customer = customerObj;
|
|
4323
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "customer", "customer mapping ended...");
|
|
4285
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "customer", "Mpping ended...");
|
|
4324
4286
|
return this;
|
|
4325
4287
|
};
|
|
4326
|
-
|
|
4327
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "
|
|
4288
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.isInStoreOrder = function () {
|
|
4289
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "Mapping started...");
|
|
4328
4290
|
this.webReturnObject.isInStoreOrder = false;
|
|
4329
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "
|
|
4291
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "Mapping ended...");
|
|
4330
4292
|
return this;
|
|
4331
4293
|
};
|
|
4332
|
-
|
|
4333
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "
|
|
4334
|
-
var
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
externalTransactionDetailsObj
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4294
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.externalTransactionDetails = function (invoiceId) {
|
|
4295
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "Mapping started...");
|
|
4296
|
+
var coupon = this.orderDetails.coupon_code
|
|
4297
|
+
? { name: this.orderDetails.coupon_code, id: this.orderDetails.coupon_code }
|
|
4298
|
+
: null;
|
|
4299
|
+
var externalTransactionDetailsObj = {
|
|
4300
|
+
uniqueId: this.orderDetails.increment_id || '',
|
|
4301
|
+
providerType: PROVIDERS.MAGENTO2,
|
|
4302
|
+
details: { invoiceId: (invoiceId === null || invoiceId === void 0 ? void 0 : invoiceId.toString()) || '' },
|
|
4303
|
+
coupons: coupon ? [coupon] : []
|
|
4304
|
+
};
|
|
4305
|
+
this.webReturnObject.externalTransactionDetails.push(externalTransactionDetailsObj);
|
|
4306
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "Mapping ended...");
|
|
4342
4307
|
return this;
|
|
4343
4308
|
};
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
var
|
|
4348
|
-
var
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4309
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.basketSummary = function () {
|
|
4310
|
+
var _a;
|
|
4311
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "basketSummary", "Mapping started...");
|
|
4312
|
+
var _e = this, orderDetails = _e.orderDetails, webReturnObject = _e.webReturnObject;
|
|
4313
|
+
var basketSummary = {
|
|
4314
|
+
discountTotal: orderDetails.discount_amount || 0,
|
|
4315
|
+
VATTotal: orderDetails.tax_amount || 0,
|
|
4316
|
+
saleTotal: orderDetails.subtotal || 0,
|
|
4317
|
+
basketTotal: (orderDetails.subtotal || 0) - (orderDetails.total_online_refunded || 0),
|
|
4318
|
+
totalItems: (_a = orderDetails.total_qty_ordered) !== null && _a !== void 0 ? _a : 0,
|
|
4319
|
+
refundTotal: orderDetails.total_online_refunded || 0,
|
|
4320
|
+
shippingTotal: orderDetails.shipping_incl_tax || 0,
|
|
4321
|
+
basketTotalWithShippingTotal: orderDetails.total_invoiced || 0,
|
|
4322
|
+
webOrder: {
|
|
4323
|
+
shippingTotal: orderDetails.shipping_incl_tax || 0,
|
|
4324
|
+
basketTotalWithShippingTotal: orderDetails.total_invoiced || 0
|
|
4325
|
+
}
|
|
4326
|
+
};
|
|
4327
|
+
webReturnObject.basketSummary = basketSummary;
|
|
4328
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "basketSummary", "Mapping ended...");
|
|
4329
|
+
return this;
|
|
4330
|
+
};
|
|
4331
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.refundRequest = function () {
|
|
4332
|
+
var _a;
|
|
4333
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapping started...");
|
|
4334
|
+
this.webReturnObject.refundRequest = ((_a = this.orderDetails.items) === null || _a === void 0 ? void 0 : _a.filter(function (product) { return (product === null || product === void 0 ? void 0 : product.base_price) && (product.qty_refunded || 0) > 0; }).map(function (product, index) { return ({
|
|
4335
|
+
itemLineId: index + 1,
|
|
4336
|
+
refundedQuantity: product.qty_refunded || 0,
|
|
4337
|
+
refundWithPromotion: true,
|
|
4338
|
+
quantity: product.qty_ordered || 0
|
|
4339
|
+
}); })) || [];
|
|
4340
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapped " + this.webReturnObject.refundRequest.length + " refund items.");
|
|
4341
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapping ended...");
|
|
4362
4342
|
return this;
|
|
4363
4343
|
};
|
|
4364
|
-
|
|
4344
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.updateTaxBreakdown = function () {
|
|
4345
|
+
var _this = this;
|
|
4346
|
+
var _a;
|
|
4347
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapping started...");
|
|
4348
|
+
var taxLines = ((_a = this.orderDetails.items) === null || _a === void 0 ? void 0 : _a.filter(function (product) { return product === null || product === void 0 ? void 0 : product.base_price; }).map(function (product, index) {
|
|
4349
|
+
var taxableAmount = product.row_total_incl_tax || 0;
|
|
4350
|
+
var VAT = product.tax_percent || 0;
|
|
4351
|
+
var preTax = _this.numberUtilService.trimTo2Decimal2((taxableAmount * 100) / (100 + VAT));
|
|
4352
|
+
var taxLineTotal = _this.numberUtilService.trimTo2Decimal2(taxableAmount - preTax);
|
|
4353
|
+
return {
|
|
4354
|
+
itemLineId: index + 1,
|
|
4355
|
+
VAT: VAT,
|
|
4356
|
+
VATCode: '',
|
|
4357
|
+
taxableAmount: taxableAmount,
|
|
4358
|
+
PreTax: preTax,
|
|
4359
|
+
taxLineTotal: taxLineTotal
|
|
4360
|
+
};
|
|
4361
|
+
})) || [];
|
|
4362
|
+
this.webReturnObject.basket["taxBreakdown"] = {
|
|
4363
|
+
taxLines: taxLines,
|
|
4364
|
+
totalTaxableAmount: this.orderDetails.tax_amount || 0
|
|
4365
|
+
};
|
|
4366
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapped " + taxLines.length + " tax lines.");
|
|
4367
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapping ended...");
|
|
4368
|
+
return this;
|
|
4369
|
+
};
|
|
4370
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.deviceId = function (deviceId) {
|
|
4365
4371
|
this.webReturnObject.deviceId = deviceId;
|
|
4366
4372
|
return this;
|
|
4367
4373
|
};
|
|
4368
|
-
|
|
4374
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.terminalId = function (terminalId) {
|
|
4369
4375
|
this.webReturnObject.terminalId = terminalId;
|
|
4370
4376
|
return this;
|
|
4371
4377
|
};
|
|
4372
|
-
|
|
4378
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.orgCode = function (orgCode) {
|
|
4373
4379
|
this.webReturnObject.orgCode = orgCode;
|
|
4374
4380
|
return this;
|
|
4375
4381
|
};
|
|
4376
|
-
|
|
4382
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.storeId = function () {
|
|
4377
4383
|
this.webReturnObject.storeId = this.orderDetails.store_id;
|
|
4378
4384
|
return this;
|
|
4379
4385
|
};
|
|
4380
|
-
|
|
4386
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.storeNodeId = function (storeNodeId) {
|
|
4381
4387
|
this.webReturnObject.storeNodeId = storeNodeId;
|
|
4382
4388
|
return this;
|
|
4383
4389
|
};
|
|
4384
|
-
|
|
4390
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.storeNodeStructure = function (storeNodeStructure) {
|
|
4385
4391
|
this.webReturnObject.storeNodeStructure = storeNodeStructure;
|
|
4386
4392
|
return this;
|
|
4387
4393
|
};
|
|
4388
|
-
|
|
4394
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.docId = function (docId) {
|
|
4389
4395
|
this.webReturnObject.id = docId;
|
|
4390
4396
|
return this;
|
|
4391
4397
|
};
|
|
4392
|
-
|
|
4398
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.updateUserID = function (userID) {
|
|
4393
4399
|
this.webReturnObject.userId = userID;
|
|
4394
4400
|
return this;
|
|
4395
4401
|
};
|
|
4396
|
-
|
|
4402
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.updateUserName = function (name) {
|
|
4397
4403
|
this.webReturnObject.userName = name;
|
|
4398
4404
|
return this;
|
|
4399
4405
|
};
|
|
4400
|
-
|
|
4401
|
-
appLogger_service.AppLoggerService.logDebug(this.className, "build", "
|
|
4406
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.build = function () {
|
|
4407
|
+
appLogger_service.AppLoggerService.logDebug(this.className, "build", "Mapping done...");
|
|
4402
4408
|
return this.webReturnObject;
|
|
4403
4409
|
};
|
|
4404
|
-
|
|
4410
|
+
WebReturnMagento2RestV1MapperBuilderClass.prototype.getUTCDateTime = function (date) {
|
|
4405
4411
|
if (date) {
|
|
4406
4412
|
return new Date(date).toISOString();
|
|
4407
4413
|
}
|
|
4408
4414
|
};
|
|
4409
|
-
return
|
|
4415
|
+
return WebReturnMagento2RestV1MapperBuilderClass;
|
|
4410
4416
|
}());
|
|
4411
4417
|
|
|
4412
4418
|
/*
|
|
@@ -4420,7 +4426,7 @@
|
|
|
4420
4426
|
exports.MapperLibraryComponent = MapperLibraryComponent;
|
|
4421
4427
|
exports.MapperLibraryModule = MapperLibraryModule;
|
|
4422
4428
|
exports.RJMapperBuilderClass = RJMapperBuilderClass;
|
|
4423
|
-
exports.
|
|
4429
|
+
exports.WebReturnMagento2RestV1MapperBuilderClass = WebReturnMagento2RestV1MapperBuilderClass;
|
|
4424
4430
|
exports.WebReturnMapperBuilderClass = WebReturnMapperBuilderClass;
|
|
4425
4431
|
exports.WebReturnSalesforceMapperBuilderClass = WebReturnSalesforceMapperBuilderClass;
|
|
4426
4432
|
|