@pmcretail/mapper-library 0.0.16 → 0.0.17
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 +14 -14
- package/bundles/pmcretail-mapper-library.umd.js.map +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js.map +1 -1
- package/esm2015/lib/WebReturn-mapper.class.js +15 -15
- package/esm5/lib/WebReturn-mapper.class.js +15 -15
- package/fesm2015/pmcretail-mapper-library.js +14 -14
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +14 -14
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/package.json +1 -1
|
@@ -6406,25 +6406,25 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
|
|
|
6406
6406
|
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['postCode'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.postcode) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.postcode) : '';
|
|
6407
6407
|
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['country'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.country) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.country) : '';
|
|
6408
6408
|
// basketSummary
|
|
6409
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['discountTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount);
|
|
6410
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['VATTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid);
|
|
6411
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['saleTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_invoiced);
|
|
6412
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid);
|
|
6413
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered);
|
|
6414
|
-
(/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded)
|
|
6409
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['discountTotal'] = Number((/** @type {?} */ (this)).document.discount_amount ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount) : 0);
|
|
6410
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['VATTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
|
|
6411
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['saleTotal'] = Number((/** @type {?} */ (this)).document.base_total_invoiced ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_invoiced) : 0);
|
|
6412
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
|
|
6413
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = Number((/** @type {?} */ (this)).document.total_qty_ordered ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered) : 0);
|
|
6414
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = Number((/** @type {?} */ (this)).document.base_total_refunded ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) : 0);
|
|
6415
6415
|
// basket line discount
|
|
6416
6416
|
(/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
|
|
6417
6417
|
/** @type {?} */
|
|
6418
6418
|
var lineDiscount = {
|
|
6419
|
-
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items
|
|
6420
|
-
discountAmount: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items
|
|
6419
|
+
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id) : 0,
|
|
6420
|
+
discountAmount: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.discount_amount)) : 0
|
|
6421
6421
|
};
|
|
6422
6422
|
(/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
|
|
6423
6423
|
// basket transaction discount
|
|
6424
6424
|
(/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
|
|
6425
6425
|
/** @type {?} */
|
|
6426
6426
|
var transactionDiscount = {
|
|
6427
|
-
discountAmount: (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount)
|
|
6427
|
+
discountAmount: ((/** @type {?} */ (this)).document && (/** @type {?} */ (this)).document.discount_amount) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount)) : 0
|
|
6428
6428
|
};
|
|
6429
6429
|
(/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'].push(transactionDiscount);
|
|
6430
6430
|
// basket products
|
|
@@ -6433,11 +6433,11 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
|
|
|
6433
6433
|
var product = {
|
|
6434
6434
|
description: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.name) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.name) : '',
|
|
6435
6435
|
SKU: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.sku) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.sku) : '',
|
|
6436
|
-
quantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_ordered) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_ordered) :
|
|
6437
|
-
refundedQuantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_refunded) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_refunded) :
|
|
6438
|
-
price: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price) :
|
|
6439
|
-
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id) :
|
|
6440
|
-
totalLinePrice: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.row_invoiced) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.row_invoiced) :
|
|
6436
|
+
quantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_ordered) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_ordered)) : 0,
|
|
6437
|
+
refundedQuantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_refunded) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_refunded)) : 0,
|
|
6438
|
+
price: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price)) : 0,
|
|
6439
|
+
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id)) : 0,
|
|
6440
|
+
totalLinePrice: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.row_invoiced) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.row_invoiced)) : 0,
|
|
6441
6441
|
};
|
|
6442
6442
|
(/** @type {?} */ (this)).webReturnObject.basket['products'].push(product);
|
|
6443
6443
|
return (/** @type {?} */ (this));
|