@pmcretail/mapper-library 0.0.51 → 0.0.53

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.
@@ -4079,6 +4079,25 @@
4079
4079
  appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "externalTransactionDetails mapping ended...");
4080
4080
  return this;
4081
4081
  };
4082
+ WebReturnSalesforceMapperBuilderClass.prototype.updateTaxBreakdown = function () {
4083
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapping started...");
4084
+ var taxLines = this.orderDetails.product_items
4085
+ .map(function (product, index) {
4086
+ var VAT = product.tax_rate ? (product.tax_rate * 100) : 0;
4087
+ var VATCode = product.tax_class_id || '';
4088
+ return {
4089
+ itemLineId: index + 1,
4090
+ VAT: VAT,
4091
+ VATCode: VATCode
4092
+ };
4093
+ }) || [];
4094
+ this.webReturnObject.basket["taxBreakdown"] = {
4095
+ taxLines: taxLines
4096
+ };
4097
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapped " + taxLines.length + " tax lines.");
4098
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTaxBreakdown", "Mapping ended...");
4099
+ return this;
4100
+ };
4082
4101
  WebReturnSalesforceMapperBuilderClass.prototype.basketSummary = function () {
4083
4102
  appLogger_service.AppLoggerService.logDebug(this.className, "basketSummary", "basketSummary mapping started...");
4084
4103
  var basketSummary = {};
@@ -4334,14 +4353,16 @@
4334
4353
  return this;
4335
4354
  };
4336
4355
  WebReturnMagento2RestV1MapperBuilderClass.prototype.refundRequest = function () {
4337
- var _a;
4338
4356
  appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapping started...");
4339
- 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 ({
4357
+ this.webReturnObject.refundRequest = (this.orderDetails.items || [])
4358
+ .filter(function (product) { return product === null || product === void 0 ? void 0 : product.base_price; })
4359
+ .map(function (product, index) { return ({
4340
4360
  itemLineId: index + 1,
4341
4361
  refundedQuantity: product.qty_refunded || 0,
4342
4362
  refundWithPromotion: true,
4343
4363
  quantity: product.qty_ordered || 0
4344
- }); })) || [];
4364
+ }); })
4365
+ .filter(function (product) { return product.refundedQuantity !== 0; });
4345
4366
  appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapped " + this.webReturnObject.refundRequest.length + " refund items.");
4346
4367
  appLogger_service.AppLoggerService.logDebug(this.className, "refundRequest", "Mapping ended...");
4347
4368
  return this;