@pmcretail/mapper-library 0.0.44 → 0.0.45

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@pmcretail/mapper-library', ['exports', '@angular/core', 'rxjs', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.pmcretail = global.pmcretail || {}, global.pmcretail["mapper-library"] = {}), global.ng.core, global.rxjs, global.ng.common));
5
- })(this, (function (exports, i0, rxjs, i1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@pmcretail/common-services/common/app-logger.service'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define('@pmcretail/mapper-library', ['exports', '@angular/core', 'rxjs', '@pmcretail/common-services/common/app-logger.service', '@angular/common'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.pmcretail = global.pmcretail || {}, global.pmcretail["mapper-library"] = {}), global.ng.core, global.rxjs, global.appLogger_service, global.ng.common));
5
+ })(this, (function (exports, i0, rxjs, appLogger_service, i1) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -630,6 +630,7 @@
630
630
  this.peerSync = this.peerSource.asObservable();
631
631
  this.scanSource = new rxjs.BehaviorSubject(false);
632
632
  this.scanner = this.scanSource.asObservable();
633
+ this.className = "BasketService";
633
634
  }
634
635
  Object.defineProperty(BasketService.prototype, "isMixedBasketSales", {
635
636
  get: function () {
@@ -671,7 +672,7 @@
671
672
  }
672
673
  finally { if (e_1) throw e_1.error; }
673
674
  }
674
- console.log("e:basket :basket service : basketDetails updated values for transaction id", basketDetails.transactionId, JSON.stringify(basketDetails));
675
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketTotal", "basketDetails updated values for transaction id\n " + basketDetails.transactionId + ", basketDetails\n " + JSON.stringify(basketDetails));
675
676
  basketDetails.basketTotal = basketDetails.total;
676
677
  basketState.updateBasket(basketDetails);
677
678
  };
@@ -682,7 +683,7 @@
682
683
  */
683
684
  BasketService.prototype.addlinePromotion = function (promotionList, basketDetails) {
684
685
  var e_2, _a, e_3, _b;
685
- console.log("e:basket :basket Service : promotionList and basketDetails for linePromotions", JSON.stringify(promotionList), JSON.stringify(basketDetails));
686
+ appLogger_service.AppLoggerService.logDebug(this.className, "addlinePromotion", "promotionList " + JSON.stringify(promotionList) + " and \n basketDetails\n " + JSON.stringify(basketDetails) + " for linePromotions");
686
687
  if (promotionList &&
687
688
  promotionList.result &&
688
689
  promotionList.result.linePromotions &&
@@ -725,7 +726,7 @@
725
726
  */
726
727
  BasketService.prototype.addTransactionPromotion = function (promotionList, basketdetails) {
727
728
  var _this = this;
728
- console.log("e:basket :basket Service : promotionList and basketDetails for transactionPromotion", JSON.stringify(promotionList), JSON.stringify(basketdetails), JSON.stringify(basketdetails.transactionPromotion));
729
+ appLogger_service.AppLoggerService.logDebug(this.className, "addTransactionPromotion", "promotionList " + JSON.stringify(promotionList) + " and \n basketDetails\n " + JSON.stringify(basketdetails) + " for transactionPromotions " + JSON.stringify(basketdetails.transactionPromotion));
729
730
  if (promotionList &&
730
731
  promotionList.result &&
731
732
  promotionList.result.transactionPromotion &&
@@ -742,7 +743,7 @@
742
743
  basketdetails = _this.transactionPromotionProductPortionCalc(basketdetails, transactionPromotionEntryUpdated);
743
744
  });
744
745
  }
745
- console.log("basket details in refund calculation file", JSON.stringify(basketdetails));
746
+ appLogger_service.AppLoggerService.logDebug(this.className, "addTransactionPromotion", "basket details in refund calculation file", basketdetails);
746
747
  return basketdetails;
747
748
  };
748
749
  BasketService.prototype.updateProductTotalForSummary = function (basketDetails) {
@@ -776,7 +777,7 @@
776
777
  basketDetails.quantity +
777
778
  (product.quantity -
778
779
  (product.refundedQuantity ? product.refundedQuantity : 0));
779
- console.log("e-basket:ExchangeSummaryScreen:update basketdetails total :" +
780
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateProductTotalForSummary", "update basketdetails total :" +
780
781
  basketDetails.total +
781
782
  " Product line ID : " +
782
783
  product.itemLineId +
@@ -795,12 +796,12 @@
795
796
  };
796
797
  BasketService.prototype.updateBasketTotalForSummary = function (basketDetails) {
797
798
  basketDetails.basketTotal = basketDetails.total;
798
- console.info("ebasket : basket Service : update Basket Total for transaction transactionDiscount ", JSON.stringify(basketDetails.transactionDiscount));
799
- console.info("ebasket : basket Service : update Basket Total for transaction transactionPromotion ", JSON.stringify(basketDetails.transactionPromotion));
799
+ appLogger_service.AppLoggerService.logInfo(this.className, "updateBasketTotalForSummary", "update Basket Total for transaction transactionDiscount ", basketDetails.transactionDiscount);
800
+ appLogger_service.AppLoggerService.logInfo(this.className, "updateBasketTotalForSummary", "update Basket Total for transaction transactionPromotion ", basketDetails.transactionPromotion);
800
801
  basketDetails = this.updateTransactionPromotion(basketDetails);
801
802
  basketDetails = this.updateTransactionDiscount(basketDetails);
802
803
  basketDetails.basketTotal = Number(basketDetails.basketTotal.toFixed(2));
803
- console.info("ebasket : basket Service : update Basket Total: basketTotal after promotion applied for basketTotal", basketDetails.basketTotal);
804
+ appLogger_service.AppLoggerService.logInfo(this.className, "updateBasketTotalForSummary", "update Basket Total: basketTotal after promotion applied for basketTotal", basketDetails.basketTotal);
804
805
  return basketDetails;
805
806
  };
806
807
  BasketService.prototype.updateTransactionDiscount = function (basketDetails) {
@@ -810,7 +811,7 @@
810
811
  var discountAmount = _a.discountAmount;
811
812
  return n + discountAmount;
812
813
  }, 0);
813
- console.log("ebasket : basket Service : discountTotal ", discountTotal);
814
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTransactionDiscount", "discountTotal ", discountTotal);
814
815
  basketDetails.basketTotal =
815
816
  basketDetails.basketTotal - Math.abs(discountTotal);
816
817
  }
@@ -852,7 +853,7 @@
852
853
  basket.quantity +
853
854
  (product.quantity -
854
855
  (product.refundedQuantity ? product.refundedQuantity : 0));
855
- console.log("e-basket:basket service:update basketdetails total :" +
856
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketTotalWithoutDiscount", "e-basket:basket service:update basketdetails total :" +
856
857
  JSON.stringify(basket) +
857
858
  basket.total +
858
859
  " Product line ID : " +
@@ -872,7 +873,7 @@
872
873
  return basket;
873
874
  };
874
875
  BasketService.prototype.updateBasketTotalWithDiscounts = function (basket) {
875
- console.log("e:basket :RefundBasketScreen : this.basketDetails new values", basket, JSON.stringify(basket.basketTotal));
876
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketTotalWithDiscounts", "this.basketDetails new values " + basket + ", \n " + JSON.stringify(basket.basketTotal));
876
877
  if (basket.transactionPromotion && basket.transactionPromotion.length > 0) {
877
878
  var discountTotal = basket.transactionPromotion.reduce(function (n, _a) {
878
879
  var promotionAmount = _a.promotionAmount;
@@ -887,7 +888,7 @@
887
888
  }, 0);
888
889
  basket.basketTotal = basket.basketTotal - discountTotal;
889
890
  }
890
- console.log("e:basket :RefundBasketScreen : basket new values", JSON.stringify(basket));
891
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketTotalWithDiscounts", "basket new values", basket);
891
892
  return basket;
892
893
  };
893
894
  BasketService.prototype.transactionDiscountAndPromotionProductortionCalculation = function (basket) {
@@ -900,7 +901,7 @@
900
901
  basket = _this.transactionPromotionProductPortionCalc(basket, promotion);
901
902
  });
902
903
  }
903
- console.log("ebasket: basket item discount protion calculation", basket, basket.products);
904
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionDiscountAndPromotionProductortionCalculation", "basket item discount protion calculation ,\n " + basket + ",\n " + basket.products);
904
905
  return basket;
905
906
  };
906
907
  BasketService.prototype.transactionPromotionProductPortionCalc = function (basket, promotion) {
@@ -917,7 +918,7 @@
917
918
  total += (p.total - _this.numberUtilService.trimTo2Decimal2(productContributionInTotal));
918
919
  }
919
920
  });
920
- console.log("ebasket: trnsactionPromotion: " + JSON.stringify(promotion) + ", selected products total: " + total);
921
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotionProductPortionCalc", "ebasket: trnsactionPromotion: " + JSON.stringify(promotion) + ", selected products total: " + total);
921
922
  basket.products.forEach(function (product) {
922
923
  product = _this.validateProductItemDiscount(product);
923
924
  var productContributionInTotal = _this.numberUtilService.trimTo2Decimal2(product.itemDiscounts.trnDiscountsPortion) +
@@ -946,10 +947,10 @@
946
947
  total += (p.total - _this.numberUtilService.trimTo2Decimal2(productContributionInTotal));
947
948
  }
948
949
  });
949
- console.log("ebasket: trnsactionDiscount: " + JSON.stringify(discount) + ", selected products total: " + total);
950
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionDiscountProductPortionCalc", "ebasket: trnsactionDiscount: " + JSON.stringify(discount) + ", selected products total: " + total);
950
951
  basket.products.forEach(function (product) {
951
952
  product = _this.validateProductItemDiscount(product);
952
- console.log(product.discountable, "ebasket : basket service : discountable in basket service");
953
+ appLogger_service.AppLoggerService.logDebug(_this.className, "transactionDiscountProductPortionCalc", "discountable in basket service", product.discountable);
953
954
  var productContributionInTotal = _this.numberUtilService.trimTo2Decimal2(product.itemDiscounts.trnDiscountsPortion) +
954
955
  _this.numberUtilService.trimTo2Decimal2(product.itemDiscounts.trnPromotionsPortion) -
955
956
  _this.numberUtilService.trimTo2Decimal2(product.itemDiscounts.refundPortion);
@@ -1015,7 +1016,7 @@
1015
1016
  return largestNumber + 1;
1016
1017
  };
1017
1018
  BasketService.prototype.updateBasketProductDataAsPerQuantity = function (product, quantity) {
1018
- console.log("ebasket: updateBasketProductDataAsPerQuantity : " + quantity + " product: " + JSON.stringify(product));
1019
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketProductDataAsPerQuantity", "ebasket: updateBasketProductDataAsPerQuantity : " + quantity + " product: " + JSON.stringify(product));
1019
1020
  product.quantity = quantity;
1020
1021
  if (product.hasOwnProperty("lineDiscount")) {
1021
1022
  // && this.product.quantity !== this.productDetailForm.controls.quantity.value
@@ -1033,11 +1034,11 @@
1033
1034
  else {
1034
1035
  product.total = product.totalLinePrice;
1035
1036
  }
1036
- console.log("ebasket: updateBasketProductDataAsPerQuantity : " + quantity + " product: " + JSON.stringify(product));
1037
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateBasketProductDataAsPerQuantity", "ebasket: updateBasketProductDataAsPerQuantity : " + quantity + " product: " + JSON.stringify(product));
1037
1038
  return product;
1038
1039
  };
1039
1040
  BasketService.prototype.filterProductListWithWebOrder = function (isWebOrder) {
1040
- console.log("ebasket: filterProductListWithWebOrder hit", JSON.stringify(this.currentBasket.products));
1041
+ appLogger_service.AppLoggerService.logDebug(this.className, "filterProductListWithWebOrder", "filterProductListWithWebOrder hit", this.currentBasket.products);
1041
1042
  if (isWebOrder)
1042
1043
  return this.currentBasket.products.filter(function (x) { return x.isWebOrder; });
1043
1044
  else {
@@ -1045,11 +1046,11 @@
1045
1046
  }
1046
1047
  };
1047
1048
  BasketService.prototype.filterProductListWithDelivery = function () {
1048
- console.log("ebasket: filterProductListWithDelivery hit", JSON.stringify(this.currentBasket.products));
1049
+ appLogger_service.AppLoggerService.logDebug(this.className, "filterProductListWithDelivery", "filterProductListWithDelivery hit", this.currentBasket.products);
1049
1050
  return this.currentBasket.products.filter(function (x) { return x.deliveryMethod === DELIVERY_METHODS.DELIVERY.toString(); });
1050
1051
  };
1051
1052
  BasketService.prototype.filterProductListWithDeliveryGroup = function (group, products) {
1052
- console.log("ebasket: filterProductListWithDeliveryGroup hit", JSON.stringify(products));
1053
+ appLogger_service.AppLoggerService.logDebug(this.className, "filterProductListWithDeliveryGroup", "filterProductListWithDeliveryGroup hit", products);
1053
1054
  return products.filter(function (x) { return x.deliveryGroup === group; });
1054
1055
  };
1055
1056
  BasketService.prototype.generateNewDeliveryGroupNumber = function (products) {
@@ -1066,7 +1067,7 @@
1066
1067
  return (largestNumber + 1).toString();
1067
1068
  };
1068
1069
  BasketService.prototype.getDeliveryGroupNumbers = function (products) {
1069
- console.log("getDeliveryGroupNumbers initiating : ", JSON.stringify(products));
1070
+ appLogger_service.AppLoggerService.logDebug(this.className, "getDeliveryGroupNumbers", "getDeliveryGroupNumbers initiating : ", products);
1070
1071
  var uniqueAndsortedResult = [];
1071
1072
  if (products.length > 0) {
1072
1073
  var deliveryGroupArr = products.map(function (product) {
@@ -1079,12 +1080,12 @@
1079
1080
  return 0;
1080
1081
  });
1081
1082
  uniqueAndsortedResult = Array.from(new Set(deliveryGroupArr)).sort(function (a, b) { return a - b; });
1082
- console.log("getDeliveryGroupNumbers : ", JSON.stringify(uniqueAndsortedResult));
1083
+ appLogger_service.AppLoggerService.logDebug(this.className, "getDeliveryGroupNumbers", "getDeliveryGroupNumbers : uniqueAndsortedResult", uniqueAndsortedResult);
1083
1084
  }
1084
1085
  return uniqueAndsortedResult;
1085
1086
  };
1086
1087
  BasketService.prototype.updateProductsWithNewDeliveryGroupNumber = function (products) {
1087
- console.log("updateProductsWithNewDeliveryGroupNumber initiating : ", JSON.stringify(products));
1088
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateProductsWithNewDeliveryGroupNumber", "initiating : ", products);
1088
1089
  var newGroupNumber = this.generateNewDeliveryGroupNumber(this.currentBasket.products);
1089
1090
  if (products.length > 0) {
1090
1091
  this.currentBasket.products.forEach(function (cBProducts) {
@@ -1099,6 +1100,7 @@
1099
1100
  return;
1100
1101
  };
1101
1102
  BasketService.prototype.calculateEstimatedTime = function (products) {
1103
+ var _this = this;
1102
1104
  try {
1103
1105
  var time_1;
1104
1106
  var estmatedTime_1 = 0;
@@ -1108,31 +1110,31 @@
1108
1110
  time_1 = Number(element.leadTime.value) * 24 * 7;
1109
1111
  estmatedTime_1 = Math.max(estmatedTime_1, time_1);
1110
1112
  estimatedDays_1 = (estmatedTime_1 === time_1) ? element.leadTime.type : estimatedDays_1;
1111
- console.log("week", estmatedTime_1, estimatedDays_1);
1113
+ appLogger_service.AppLoggerService.logDebug(_this.className, "calculateEstimatedTime", "week " + estmatedTime_1 + " " + estimatedDays_1);
1112
1114
  }
1113
1115
  else if (element.leadTime.type.toLocaleLowerCase() === "days") {
1114
1116
  time_1 = Number(element.leadTime.value) * 24;
1115
1117
  estmatedTime_1 = Math.max(estmatedTime_1, time_1);
1116
1118
  estimatedDays_1 = (estmatedTime_1 === time_1) ? element.leadTime.type : estimatedDays_1;
1117
- console.log("days", estmatedTime_1, estimatedDays_1);
1119
+ appLogger_service.AppLoggerService.logDebug(_this.className, "calculateEstimatedTime", "days " + estmatedTime_1 + " " + estimatedDays_1);
1118
1120
  }
1119
1121
  else if (element.leadTime.type.toLocaleLowerCase() === "months") {
1120
1122
  time_1 = Number(element.leadTime.value) * 24 * 30;
1121
1123
  estmatedTime_1 = Math.max(estmatedTime_1, time_1);
1122
1124
  estimatedDays_1 = (estmatedTime_1 === time_1) ? element.leadTime.type : estimatedDays_1;
1123
- console.log("months", estmatedTime_1, estimatedDays_1);
1125
+ appLogger_service.AppLoggerService.logDebug(_this.className, "calculateEstimatedTime", "months " + estmatedTime_1 + " " + estimatedDays_1);
1124
1126
  }
1125
1127
  else if (element.leadTime.type.toLocaleLowerCase() === "years") {
1126
1128
  time_1 = Number(element.leadTime.value) * 24 * 365;
1127
1129
  estmatedTime_1 = Math.max(estmatedTime_1, time_1);
1128
1130
  estimatedDays_1 = (estmatedTime_1 === time_1) ? element.leadTime.type : estimatedDays_1;
1129
- console.log("years", estmatedTime_1, estimatedDays_1);
1131
+ appLogger_service.AppLoggerService.logDebug(_this.className, "calculateEstimatedTime", "years " + estmatedTime_1 + " " + estimatedDays_1);
1130
1132
  }
1131
1133
  else {
1132
1134
  time_1 = Number(element.leadTime.value);
1133
1135
  estmatedTime_1 = Math.max(estmatedTime_1, time_1);
1134
1136
  estimatedDays_1 = (estmatedTime_1 === time_1) ? element.leadTime.type : estimatedDays_1;
1135
- console.log("hours", estmatedTime_1, estimatedDays_1);
1137
+ appLogger_service.AppLoggerService.logDebug(_this.className, "calculateEstimatedTime", "hours " + estmatedTime_1 + " " + estimatedDays_1);
1136
1138
  }
1137
1139
  });
1138
1140
  if (estimatedDays_1.toLocaleLowerCase() === "days") {
@@ -1154,12 +1156,12 @@
1154
1156
  return estimate;
1155
1157
  }
1156
1158
  catch (error) {
1157
- console.log("error in calculateEstimatedTime", error);
1159
+ appLogger_service.AppLoggerService.logError(this.className, "calculateEstimatedTime", "error in calculateEstimatedTime", error);
1158
1160
  }
1159
1161
  return 0;
1160
1162
  };
1161
1163
  BasketService.prototype.updateProductsWithDeliveryGroupNumber = function (oldGroup, newGroup) {
1162
- console.log("updateProductsWithDeliveryGroupNumber initiating");
1164
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateProductsWithDeliveryGroupNumber initiating");
1163
1165
  this.currentBasket.products.forEach(function (cBProducts) {
1164
1166
  if (cBProducts.deliveryGroup === oldGroup) {
1165
1167
  cBProducts.deliveryGroup = newGroup;
@@ -1170,7 +1172,7 @@
1170
1172
  };
1171
1173
  BasketService.prototype.getDeliveryInfo = function () {
1172
1174
  var _this = this;
1173
- console.log("getDeliveryGroupInfor initiating");
1175
+ appLogger_service.AppLoggerService.logDebug(this.className, "getDeliveryInfo", "getDeliveryGroupInfor initiating");
1174
1176
  try {
1175
1177
  var groupInfo_1 = {
1176
1178
  groups: []
@@ -1195,7 +1197,7 @@
1195
1197
  return groupInfo_1;
1196
1198
  }
1197
1199
  catch (error) {
1198
- console.log("error", error);
1200
+ appLogger_service.AppLoggerService.logError(this.className, "getDeliveryInfo", "error while getting delivery info", error);
1199
1201
  }
1200
1202
  };
1201
1203
  return BasketService;
@@ -1204,6 +1206,7 @@
1204
1206
  var NumberUtilService = /** @class */ (function () {
1205
1207
  function NumberUtilService(cp) {
1206
1208
  this.cp = cp;
1209
+ this.className = "NumberUtilService";
1207
1210
  }
1208
1211
  NumberUtilService.prototype.trimTo2Decimal = function (no) {
1209
1212
  //return Math.floor(no * 100) / 100;
@@ -1221,7 +1224,7 @@
1221
1224
  if (numValue) {
1222
1225
  var numb = parseFloat(numValue.toString().replace(',', ''));
1223
1226
  returnValue = this.cp.transform(Number(numValue).toFixed(2), currencyCode.toLocaleUpperCase(), "symbol");
1224
- console.log("AppendWithCurrencySymbol :" + returnValue);
1227
+ appLogger_service.AppLoggerService.logDebug(this.className, "AppendWithCurrencySymbol", "AppendWithCurrencySymbol :", returnValue);
1225
1228
  }
1226
1229
  else {
1227
1230
  returnValue = this.cp.transform("0.00", currencyCode.toLocaleUpperCase(), "symbol");
@@ -1246,6 +1249,7 @@
1246
1249
  function TransactionDocumentBuilder(transactionDoc, currencyPipe, basketService) {
1247
1250
  this.currencyPipe = currencyPipe;
1248
1251
  this.basketService = basketService;
1252
+ this.className = "TransactionDocumentBuilder";
1249
1253
  this.numberUtilService = new NumberUtilService(currencyPipe);
1250
1254
  this.basketService = new BasketService(this.numberUtilService);
1251
1255
  this.storeInfo = JSON.parse(localStorage.getItem('storeInfo') || '{}');
@@ -1292,7 +1296,7 @@
1292
1296
  .substring(1);
1293
1297
  this.transactionDocument.transactionRef =
1294
1298
  storeDetails.orgCode + storeDetails.storeId + date.toISOString() + random;
1295
- console.log("ebasket: transaction ref created", this.transactionDocument.transactionRef);
1299
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionRef", "transaction ref created", this.transactionDocument.transactionRef);
1296
1300
  return this;
1297
1301
  };
1298
1302
  /**
@@ -1402,7 +1406,7 @@
1402
1406
  */
1403
1407
  TransactionDocumentBuilder.prototype.basket = function (basketDetails) {
1404
1408
  var _this = this;
1405
- console.log("ebasket: basket details update in transaction document", JSON.stringify(basketDetails));
1409
+ appLogger_service.AppLoggerService.logDebug(this.className, "basket", "basket details update in transaction document", basketDetails);
1406
1410
  this.transactionDocument.subsidiaryId = basketDetails.subsidiaryId || (localStorage.getItem('subsidiaryId') || '');
1407
1411
  this.transactionDocument.basket.products = [];
1408
1412
  this.transactionDocument.basket.lineDiscount = [];
@@ -1455,7 +1459,7 @@
1455
1459
  _this.transactionDocument.basket.products.push(p);
1456
1460
  _this.lineDiscount(basketDetails);
1457
1461
  });
1458
- console.info("ebasket: transactiondocument basket details updated", JSON.stringify(this.transactionDocument.basket));
1462
+ appLogger_service.AppLoggerService.logInfo(this.className, "basket", "transactiondocument basket details updated", this.transactionDocument.basket);
1459
1463
  return this;
1460
1464
  };
1461
1465
  /**
@@ -1465,7 +1469,7 @@
1465
1469
  TransactionDocumentBuilder.prototype.currentTransactionDetails = function (basket) {
1466
1470
  var _a;
1467
1471
  var _this = this;
1468
- console.log("ebasket: current transaction details for exchanges", basket);
1472
+ appLogger_service.AppLoggerService.logDebug(this.className, "currentTransactionDetails", "current transaction details for exchanges", basket);
1469
1473
  this.transactionDocument.currentTransactionDetails.products = [];
1470
1474
  this.transactionDocument.currentTransactionDetails.linePromotion = [];
1471
1475
  this.transactionDocument.currentTransactionDetails.lineDiscount = [];
@@ -1490,7 +1494,7 @@
1490
1494
  _this.transactionDocument.currentTransactionDetails.lineDiscount.push(product.lineDiscount);
1491
1495
  }
1492
1496
  });
1493
- console.log("ebasket: current transaction details after removing old products", this.transactionDocument.currentTransactionDetails.products);
1497
+ appLogger_service.AppLoggerService.logDebug(this.className, "currentTransactionDetails", "current transaction details after removing old products", this.transactionDocument.currentTransactionDetails.products);
1494
1498
  if (basket.transactionDiscount && basket.transactionDiscount.length > 0) {
1495
1499
  (_a = this.transactionDocument.currentTransactionDetails.transactionDiscount).push.apply(_a, __spreadArray([], __read(basket.transactionDiscount)));
1496
1500
  }
@@ -1515,7 +1519,7 @@
1515
1519
  this.transactionDocument.currentTransactionDetails.basketSummary.discountTotal = 0;
1516
1520
  }
1517
1521
  }
1518
- console.log("ebasket:this.transactionDocument.currentTransactionDetails", JSON.stringify(this.transactionDocument.currentTransactionDetails));
1522
+ appLogger_service.AppLoggerService.logInfo(this.className, "currentTransactionDetails", "currentTransactionDetails", this.transactionDocument.currentTransactionDetails);
1519
1523
  return this;
1520
1524
  };
1521
1525
  /**
@@ -1544,7 +1548,7 @@
1544
1548
  taxableAmount: product.total,
1545
1549
  PreTax: 0
1546
1550
  };
1547
- console.info("Product contribution : item line ID :current transaction Details", product.itemLineId, "tax line :", JSON.stringify(taxLine), JSON.stringify(basketDetails.basketTotal));
1551
+ appLogger_service.AppLoggerService.logInfo(_this.className, "updateCurrentTransactionDetailsTaxBreakdown", "item line ID :current transaction Details\",\n " + product.itemLineId + ", tax line : " + taxLine + ", basketDetails.basketTotal " + basketDetails.basketTotal);
1548
1552
  //step 1
1549
1553
  // if Transaction Discount and/or promotion applied, find net selling price of each product as taxableamount
1550
1554
  //If transaction discount/promotion is applied taxable amount should be deducting transaction promotion and transaction disacount portion
@@ -1575,15 +1579,14 @@
1575
1579
  else {
1576
1580
  this.transactionDocument.currentTransactionDetails.basketSummary.VATTotal = 0.00;
1577
1581
  }
1578
- console.log("eBasket:after calculating tax currenttransactionDetails", this.transactionDocument.currentTransactionDetails);
1582
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsTaxBreakdown", "eBasket:after calculating tax currenttransactionDetails", this.transactionDocument.currentTransactionDetails);
1579
1583
  return this;
1580
1584
  };
1581
1585
  TransactionDocumentBuilder.prototype.updateCurrentTransactionDetailsTotalTaxSummary = function () {
1582
1586
  var _this = this;
1583
- console.log("Total Tax Summery Request :", JSON.stringify(this.transactionDocument.currentTransactionDetails.taxBreakdown));
1587
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsTotalTaxSummary", "Total Tax Summery Request :", this.transactionDocument.currentTransactionDetails.taxBreakdown);
1584
1588
  var totalTaxSummaryArray = [];
1585
1589
  var totalTaxSummaryGroup = [];
1586
- console.log("Tax Lines for Total Tax Summery :", JSON.stringify(this.transactionDocument.currentTransactionDetails.taxBreakdown.taxLines));
1587
1590
  this.transactionDocument.currentTransactionDetails.taxBreakdown.taxLines.forEach(function (element) {
1588
1591
  var TaxSummary = {
1589
1592
  VATCode: "",
@@ -1599,7 +1602,7 @@
1599
1602
  TaxSummary.TXrateSum = _this.numberUtilService.trimTo2Decimal2(TaxSummary.PreTaxSum + TaxSummary.TaxSum);
1600
1603
  totalTaxSummaryArray.push(TaxSummary);
1601
1604
  });
1602
- console.log("Total Tax Summery Without Grouped : ", JSON.stringify(totalTaxSummaryArray));
1605
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsTotalTaxSummary", "Total Tax Summery Without Grouped : ", totalTaxSummaryArray);
1603
1606
  totalTaxSummaryGroup = totalTaxSummaryArray.reduce(function (preparedArray, currentObj) {
1604
1607
  var ind = preparedArray.findIndex(function (x) { return x.VAT === currentObj.VAT; });
1605
1608
  if (ind === -1) {
@@ -1615,7 +1618,7 @@
1615
1618
  return preparedArray;
1616
1619
  }, []);
1617
1620
  // listOfTags.map(x => unique.filter(a => a.label == x.label && a.color == x.color).length > 0 ? null : unique.push(x));
1618
- console.log("Total Tax Summer Group :", JSON.stringify(totalTaxSummaryGroup));
1621
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsTotalTaxSummary", "Total Tax Summer Group :", totalTaxSummaryGroup);
1619
1622
  this.transactionDocument.currentTransactionDetails.totalTaxSummary = totalTaxSummaryGroup;
1620
1623
  return this;
1621
1624
  };
@@ -1625,10 +1628,10 @@
1625
1628
  */
1626
1629
  TransactionDocumentBuilder.prototype.updateCurrentTransactionDetailsDiscountTotal = function () {
1627
1630
  var refundTotal = this.transactionDocument.currentTransactionDetails.basketSummary.refundTotal ? this.transactionDocument.currentTransactionDetails.basketSummary.refundTotal : 0;
1628
- console.log("e-basket: transaction builder updateCurrentTransactionDetailsDiscountTotal: discountTotal", refundTotal, this.transactionDocument.currentTransactionDetails.basketSummary.basketTotal, this.transactionDocument.currentTransactionDetails.basketSummary.saleTotal);
1631
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsDiscountTotal", "refundTotal " + refundTotal + ", basketTotal " + this.transactionDocument.currentTransactionDetails.basketSummary.basketTotal + ",saleTotal " + this.transactionDocument.currentTransactionDetails.basketSummary.saleTotal);
1629
1632
  var discountTotal = Math.abs(Math.abs(this.transactionDocument.currentTransactionDetails.basketSummary.saleTotal) -
1630
1633
  (Math.abs(this.transactionDocument.currentTransactionDetails.basketSummary.basketTotal) + Math.abs(refundTotal)));
1631
- console.log("e-basket: transaction builder updateCurrentTransactionDetailsDiscountTotal: discountTotal", discountTotal);
1634
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsDiscountTotal", "discountTotal", discountTotal);
1632
1635
  return Number(discountTotal.toFixed(2));
1633
1636
  };
1634
1637
  /**
@@ -1642,7 +1645,7 @@
1642
1645
  if (product.refundedTotal) {
1643
1646
  totalRefund = totalRefund + product.refundedTotal;
1644
1647
  }
1645
- console.log("ebasket : transaction Service: totalRefund for Current TransactionDetails" + totalRefund);
1648
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateCurrentTransactionDetailsRefundTotal", "totalRefund for Current TransactionDetails", totalRefund);
1646
1649
  }
1647
1650
  return totalRefund;
1648
1651
  };
@@ -1669,7 +1672,7 @@
1669
1672
  else {
1670
1673
  this.transactionDocument.basketSummary.VATTotal = 0.00;
1671
1674
  }
1672
- console.info("ebasket: basketsummary updated in transaction document: ", JSON.stringify(this.transactionDocument.basketSummary));
1675
+ appLogger_service.AppLoggerService.logInfo(this.className, "basketSummary", "basketsummary updated in transaction document: ", this.transactionDocument.basketSummary);
1673
1676
  return this;
1674
1677
  };
1675
1678
  /**
@@ -1690,7 +1693,7 @@
1690
1693
  return acc;
1691
1694
  }, []);
1692
1695
  }
1693
- // console.info(
1696
+ // AppLoggerService.logInfo(this.className,
1694
1697
  // "e-basket :line discount updated in transaction document",
1695
1698
  // this.transactionDocument.basket.lineDiscount
1696
1699
  // );
@@ -1719,7 +1722,7 @@
1719
1722
  this_1.transactionDocument.basket.exchange.push(element.exchange);
1720
1723
  }
1721
1724
  }
1722
- console.log("e-basket :TransactionDocumentBuilder: this.transactionDocument.basket exchange", JSON.stringify(this_1.transactionDocument.basket.exchange));
1725
+ appLogger_service.AppLoggerService.logDebug(this_1.className, "exchange", "this.transactionDocument.basket exchange", this_1.transactionDocument.basket.exchange);
1723
1726
  };
1724
1727
  var this_1 = this;
1725
1728
  for (var index = 0; index < basketDetails.products.length; index++) {
@@ -1775,7 +1778,7 @@
1775
1778
  // return acc;
1776
1779
  // }, []);
1777
1780
  // }
1778
- console.log("e-basket :TransactionDocumentBuilder: this.transactionDocument.basket.transactionPromotion", JSON.stringify(this.transactionDocument.basket.transactionPromotion));
1781
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotion", "this.transactionDocument.basket.transactionPromotion", this.transactionDocument.basket.transactionPromotion);
1779
1782
  }
1780
1783
  return this;
1781
1784
  };
@@ -1783,7 +1786,7 @@
1783
1786
  if (basketDetails.transactionDiscount) {
1784
1787
  this.transactionDocument.basket.transactionDiscount =
1785
1788
  basketDetails.transactionDiscount;
1786
- console.log("e-basket :TransactionDocumentBuilder: transaction Discount", JSON.stringify(this.transactionDocument.basket.transactionDiscount));
1789
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionDiscount", "transaction Discount", this.transactionDocument.basket.transactionDiscount);
1787
1790
  }
1788
1791
  return this;
1789
1792
  };
@@ -1793,7 +1796,7 @@
1793
1796
  * @returns
1794
1797
  */
1795
1798
  TransactionDocumentBuilder.prototype.paymentDetails = function (paymentDetails) {
1796
- console.info("ebasket : payment details after transaction completed", JSON.stringify(paymentDetails));
1799
+ appLogger_service.AppLoggerService.logInfo(this.className, "paymentDetails", "payment details after transaction completed", paymentDetails);
1797
1800
  this.transactionDocument.paymentDetails = paymentDetails;
1798
1801
  return this;
1799
1802
  };
@@ -1829,7 +1832,7 @@
1829
1832
  * @returns at
1830
1833
  */
1831
1834
  TransactionDocumentBuilder.prototype.giftOption = function (gift) {
1832
- console.log("e-basket :TransactionDocumentBuilder: this.transactionDocument.giftoption", gift);
1835
+ appLogger_service.AppLoggerService.logDebug(this.className, "giftOption", "this.transactionDocument.giftoption", gift);
1833
1836
  if (gift) {
1834
1837
  this.transactionDocument.giftedReceipt = gift;
1835
1838
  }
@@ -1922,7 +1925,7 @@
1922
1925
  */
1923
1926
  TransactionDocumentBuilder.prototype.getBasketDetails = function () {
1924
1927
  var _this = this;
1925
- console.info("ebasket: Getting Basket for transactionDocument", JSON.stringify(this.transactionDocument));
1928
+ appLogger_service.AppLoggerService.logInfo(this.className, "getBasketDetails", "Getting Basket for transactionDocument", this.transactionDocument);
1926
1929
  var basket = {
1927
1930
  subsidiaryId: this.transactionDocument.subsidiaryId,
1928
1931
  transactionDiscount: this.transactionDocument.basket.transactionDiscount,
@@ -1941,7 +1944,7 @@
1941
1944
  };
1942
1945
  basket.products = [];
1943
1946
  this.transactionDocument.basket.products.forEach(function (product, index) {
1944
- console.log(JSON.stringify(product), "ebasket: basket detail update in basket");
1947
+ appLogger_service.AppLoggerService.logDebug(_this.className, JSON.stringify(product), "ebasket: basket detail update in basket");
1945
1948
  var p = {};
1946
1949
  p.SKU = product.SKU;
1947
1950
  p.barcode = product.barCode;
@@ -2023,7 +2026,7 @@
2023
2026
  if (this.transactionDocument.type === TRANSACTION_TYPE.SALE_REFUND) {
2024
2027
  basket.quantity = this.getRefundedTotalWithQuantity(basket);
2025
2028
  }
2026
- console.info("ebasket: Basket created successfully", JSON.stringify(basket));
2029
+ appLogger_service.AppLoggerService.logInfo(this.className, "getBasketDetails", "Basket created successfully", basket);
2027
2030
  return basket;
2028
2031
  };
2029
2032
  /**
@@ -2079,7 +2082,7 @@
2079
2082
  // p.itemDiscounts = product.itemDiscounts as ItemDiscount;
2080
2083
  // }
2081
2084
  // // if(!p.itemDiscounts){
2082
- // // console.log(p.itemDiscounts);
2085
+ // // AppLoggerService.logDebug(this.className, p.itemDiscounts);
2083
2086
  // // this.basketService.transactionDiscountAndPromotionProductortionCalculation(basket);
2084
2087
  // // }
2085
2088
  // p.refundPromotionalQuantity = product.refundedPromotionalQuantity ? product.refundedPromotionalQuantity : 0;
@@ -2143,7 +2146,7 @@
2143
2146
  // if (!basket.products[0].hasOwnProperty('itemDiscounts')) {
2144
2147
  // basket = this.getTransactionDiscountAndTransactionPromotionPortion(basket);
2145
2148
  // }
2146
- // console.log("ebasket : TransactionDocumentBuilder :new created refunded basket", JSON.stringify(basket))
2149
+ // AppLoggerService.logDebug(this.className, "ebasket : TransactionDocumentBuilder :new created refunded basket", JSON.stringify(basket))
2147
2150
  // basket.quantity = basket.products.reduce(
2148
2151
  // (n: any, { quantity }: any) => n + quantity,
2149
2152
  // 0
@@ -2151,11 +2154,11 @@
2151
2154
  // basket.total = this.getTotalWithLineDiscountAndLinePromotionApplied(basket);
2152
2155
  // basket.basketTotal = basket.total;
2153
2156
  // basket.basketTotal = basket.basketTotal - this.getTotalDiscountWithTransactionDiscountsAndPromotions(basket);
2154
- // console.log(
2157
+ // AppLoggerService.logDebug(this.className,
2155
2158
  // "ebasket : TransactionDocumentBuilder : update Basket Total: after promotion :basketTotal",
2156
2159
  // basket.basketTotal
2157
2160
  // );
2158
- // console.log(
2161
+ // AppLoggerService.logDebug(this.className,
2159
2162
  // "e:basket :TransactionDocumentBuilder : basketDetails updated values",
2160
2163
  // JSON.stringify(basket)
2161
2164
  // );
@@ -2207,19 +2210,19 @@
2207
2210
  return n + discountAmount;
2208
2211
  }, 0);
2209
2212
  }
2210
- console.log("ebasket : TransactionDocumentBuilder : Transaction discount Total:", discountTotal);
2213
+ appLogger_service.AppLoggerService.logDebug(this.className, "getTotalDiscountWithTransactionDiscountsAndPromotions", "Transaction discount Total:", discountTotal);
2211
2214
  return discountTotal;
2212
2215
  };
2213
2216
  TransactionDocumentBuilder.prototype.appendCurrencySymbol = function (currency, value) {
2214
2217
  // value=this.decimalpipe.transform(value,'1.2');
2215
2218
  if (value >= 0) {
2216
2219
  var returnval = currency + value;
2217
- console.log(returnval, "ebasket: add currency with value");
2220
+ appLogger_service.AppLoggerService.logDebug(this.className, "appendCurrencySymbol", "add currency with value", returnval);
2218
2221
  return returnval;
2219
2222
  }
2220
2223
  else {
2221
2224
  var returnval = "-" + (currency + value * -1);
2222
- console.log(returnval, "-(currency+(value*-1))");
2225
+ appLogger_service.AppLoggerService.logDebug(this.className, "appendCurrencySymbol", "returnVal", returnval);
2223
2226
  return returnval;
2224
2227
  }
2225
2228
  };
@@ -2231,7 +2234,7 @@
2231
2234
  // this.transactionDocument.basket.products.forEach((product) => {
2232
2235
  // product.refundedQuantity = product.quantity;
2233
2236
  // product.refundedTotal = product.totalLinePrice * -1;
2234
- // console.log(
2237
+ // AppLoggerService.logDebug(this.className,
2235
2238
  // "ebasket: Transaction price override :",
2236
2239
  // this.transactionDocument.basket.lineDiscount
2237
2240
  // );
@@ -2240,15 +2243,15 @@
2240
2243
  // this.transactionDocument.basket.linePromotion.length > 0
2241
2244
  // ) {
2242
2245
  // this.transactionDocument.basket.linePromotion.forEach((linePromotion) => {
2243
- // console.log(
2246
+ // AppLoggerService.logDebug(this.className,
2244
2247
  // "Promotion: basket linePromotion : ",
2245
2248
  // this.transactionDocument.basket.linePromotion
2246
2249
  // );
2247
- // console.log(
2250
+ // AppLoggerService.logDebug(this.className,
2248
2251
  // "linePromotion.itemLineId.toString() : ",
2249
2252
  // linePromotion.itemLineId.toString()
2250
2253
  // );
2251
- // console.log(
2254
+ // AppLoggerService.logDebug(this.className,
2252
2255
  // "condition : " +
2253
2256
  // (product.itemLineId === linePromotion.itemLineId.toString())
2254
2257
  // );
@@ -2263,15 +2266,15 @@
2263
2266
  // this.transactionDocument.basket.lineDiscount.length > 0
2264
2267
  // ) {
2265
2268
  // this.transactionDocument.basket.lineDiscount.forEach((lineDiscount) => {
2266
- // console.log(
2269
+ // AppLoggerService.logDebug(this.className,
2267
2270
  // "product.itemLineId : " +
2268
2271
  // this.transactionDocument.basket.lineDiscount
2269
2272
  // );
2270
- // console.log(
2273
+ // AppLoggerService.logDebug(this.className,
2271
2274
  // "lineDiscount.itemLineId.toString() : " +
2272
2275
  // lineDiscount.itemLineId.toString()
2273
2276
  // );
2274
- // console.log(
2277
+ // AppLoggerService.logDebug(this.className,
2275
2278
  // "condition : " +
2276
2279
  // (product.itemLineId === lineDiscount.itemLineId.toString())
2277
2280
  // );
@@ -2280,10 +2283,10 @@
2280
2283
  // }
2281
2284
  // });
2282
2285
  // }
2283
- // console.log("Product description :" + product.description);
2284
- // console.log("Product total :" + product.refundedTotal);
2286
+ // AppLoggerService.logDebug(this.className, "Product description :" + product.description);
2287
+ // AppLoggerService.logDebug(this.className, "Product total :" + product.refundedTotal);
2285
2288
  // // product.displayrefundedamount=this.appendCurrencySymbol(CURRENCY[this.transactionDocument.baseCurrency],product.refundedTotal);
2286
- // // console.log(product.displayrefundedamount,"displayrefundedamount");
2289
+ // // AppLoggerService.logDebug(this.className, product.displayrefundedamount,"displayrefundedamount");
2287
2290
  // product.refunded = true;
2288
2291
  // });
2289
2292
  // const baskettotal = (this.transactionDocument.basketSummary.basketTotal *= -1);
@@ -2324,7 +2327,7 @@
2324
2327
  // product.quantity * Number(product.selectedPrice.toFixed(2));
2325
2328
  // }
2326
2329
  saletotal += product.total;
2327
- console.log("e-basket:update product Total:" + saletotal, JSON.stringify(product));
2330
+ appLogger_service.AppLoggerService.logDebug(this.className, "getTotalWithLineDiscountAndLinePromotionApplied", "e-basket:update product Total:" + saletotal, product);
2328
2331
  }
2329
2332
  }
2330
2333
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -2356,10 +2359,10 @@
2356
2359
  */
2357
2360
  TransactionDocumentBuilder.prototype.updateDiscountTotal = function () {
2358
2361
  var refundTotal = this.transactionDocument.basketSummary.refundTotal ? this.transactionDocument.basketSummary.refundTotal : 0;
2359
- console.info("e-basket: transaction builder: refundTotal", JSON.stringify(refundTotal), JSON.stringify(this.transactionDocument.basketSummary));
2362
+ appLogger_service.AppLoggerService.logInfo(this.className, "updateDiscountTotal", "refundTotal: " + refundTotal + " this.transactionDocument.basketSummary: " + this.transactionDocument.basketSummary);
2360
2363
  var discountTotal = Math.abs(Math.abs(this.transactionDocument.basketSummary.saleTotal) -
2361
2364
  (Math.abs(this.transactionDocument.basketSummary.basketTotal) + Math.abs(refundTotal)));
2362
- console.log("e-basket: transaction builder: discountTotal", JSON.stringify(discountTotal));
2365
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateDiscountTotal", "discountTotal", discountTotal);
2363
2366
  return Number(discountTotal.toFixed(2));
2364
2367
  };
2365
2368
  TransactionDocumentBuilder.prototype.updateReasonCode = function (reasonCode) {
@@ -2411,7 +2414,7 @@
2411
2414
  taxableAmount: product.total,
2412
2415
  PreTax: 0
2413
2416
  };
2414
- console.info("Product contribution : item line ID :", product.itemLineId, "tax line :", JSON.stringify(taxLine));
2417
+ appLogger_service.AppLoggerService.logInfo(_this.className, "updateTaxBreakdown", "item line ID :, " + product.itemLineId + ",\n \"tax line :\", " + taxLine);
2415
2418
  // step 1
2416
2419
  // if Transaction Discount and/or promotion applied, find net selling price of each product as taxableamount
2417
2420
  // if (transactionDiscountTotal > 0) {
@@ -2420,7 +2423,7 @@
2420
2423
  product.itemDiscounts.trnPromotionsPortion -
2421
2424
  product.itemDiscounts.refundPortion;
2422
2425
  // tp+td-rp;
2423
- console.info("Product contribution : item line ID :", product.itemLineId, "contribution :", JSON.stringify(productContributionInTotal));
2426
+ appLogger_service.AppLoggerService.logInfo(_this.className, "updateTaxBreakdown", "item line ID , " + product.itemLineId + ",\n \"contribution :\", " + productContributionInTotal);
2424
2427
  // calculate net selling price after applying transaction discount as per product contribution
2425
2428
  taxLine.taxableAmount -= productContributionInTotal;
2426
2429
  // }
@@ -2439,10 +2442,10 @@
2439
2442
  };
2440
2443
  TransactionDocumentBuilder.prototype.updateTotalTaxSummary = function () {
2441
2444
  var _this = this;
2442
- console.log("Total Tax Summery Request :", JSON.stringify(this.transactionDocument.basket.taxBreakdown));
2445
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTotalTaxSummary", "Total Tax Summery Request :", this.transactionDocument.basket.taxBreakdown);
2443
2446
  var totalTaxSummaryArray = [];
2444
2447
  var totalTaxSummaryGroup = [];
2445
- console.log("Tax Lines for Total Tax Summery :", JSON.stringify(this.transactionDocument.basket.taxBreakdown.taxLines));
2448
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTotalTaxSummary", "Tax Lines for Total Tax Summery :", this.transactionDocument.basket.taxBreakdown.taxLines);
2446
2449
  this.transactionDocument.basket.taxBreakdown.taxLines.forEach(function (element) {
2447
2450
  var TaxSummary = {
2448
2451
  VATCode: "",
@@ -2458,7 +2461,7 @@
2458
2461
  TaxSummary.TXrateSum = _this.numberUtilService.trimTo2Decimal2(TaxSummary.PreTaxSum + TaxSummary.TaxSum);
2459
2462
  totalTaxSummaryArray.push(TaxSummary);
2460
2463
  });
2461
- console.log("Total Tax Summery Without Grouped : ", JSON.stringify(totalTaxSummaryArray));
2464
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTotalTaxSummary", "Total Tax Summery Without Grouped : ", totalTaxSummaryArray);
2462
2465
  totalTaxSummaryGroup = totalTaxSummaryArray.reduce(function (preparedArray, currentObj) {
2463
2466
  var ind = preparedArray.findIndex(function (x) { return x.VAT === currentObj.VAT; });
2464
2467
  if (ind === -1) {
@@ -2473,7 +2476,7 @@
2473
2476
  }
2474
2477
  return preparedArray;
2475
2478
  }, []);
2476
- console.log("Total Tax Summer Group :", totalTaxSummaryGroup);
2479
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateTotalTaxSummary", "Total Tax Summer Group :", totalTaxSummaryGroup);
2477
2480
  this.transactionDocument.basket.totalTaxSummary = totalTaxSummaryGroup;
2478
2481
  return this;
2479
2482
  };
@@ -2505,7 +2508,7 @@
2505
2508
  if (product.refundedTotal) {
2506
2509
  totalRefund = totalRefund + product.refundedTotal;
2507
2510
  }
2508
- console.log("ebasket : transaction Service: totalRefund" + totalRefund);
2511
+ appLogger_service.AppLoggerService.logDebug(this.className, "getRefundTotal", "totalRefund", totalRefund);
2509
2512
  }
2510
2513
  return totalRefund;
2511
2514
  };
@@ -2518,6 +2521,7 @@
2518
2521
 
2519
2522
  var RJMapperBuilderClass = /** @class */ (function () {
2520
2523
  function RJMapperBuilderClass(transactionDoc) {
2524
+ this.className = "RJMapperBuilderClass";
2521
2525
  this.itemCount = 0;
2522
2526
  this.largestNumber = 0;
2523
2527
  this.rjObject = {};
@@ -3320,7 +3324,7 @@
3320
3324
  return value;
3321
3325
  }
3322
3326
  catch (e) {
3323
- console.log(value, 'can not be converted in string', e);
3327
+ appLogger_service.AppLoggerService.logError(this.className, "convertToString", 'can not be converted in string', e);
3324
3328
  }
3325
3329
  };
3326
3330
  RJMapperBuilderClass.prototype.generateDynamicStockLookUp = function () {
@@ -3399,6 +3403,7 @@
3399
3403
  var WebReturnMapperBuilderClass = /** @class */ (function () {
3400
3404
  function WebReturnMapperBuilderClass(document, currencyPipe) {
3401
3405
  this.currencyPipe = currencyPipe;
3406
+ this.className = "WebReturnMapperBuilderClass";
3402
3407
  this.webReturnObject = {
3403
3408
  id: '',
3404
3409
  orgCode: "",
@@ -3592,7 +3597,7 @@
3592
3597
  transactionPromotion.subLevelType = PROMOTION_LEVEL.LINE;
3593
3598
  transactionPromotion.trigger = couponTriggerPromotions_1;
3594
3599
  }
3595
- console.log("e-basket: update LinePromotion With Coupon", JSON.stringify(transactionPromotion));
3600
+ appLogger_service.AppLoggerService.logDebug(this.className, "WebReturnMapper", "update LinePromotion With Coupon", transactionPromotion);
3596
3601
  if (!this.webReturnObject.basket.transactionPromotion) {
3597
3602
  this.webReturnObject.basket.transactionPromotion = [];
3598
3603
  }
@@ -3616,7 +3621,7 @@
3616
3621
  };
3617
3622
  WebReturnMapperBuilderClass.prototype.transactionPromotionProductPortionCalc = function (txDoc, promotion) {
3618
3623
  var _this = this;
3619
- console.log("ebasket: transactionPromotionProductPortionCalc: trnsactionPromotion: " + JSON.stringify(promotion));
3624
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotionProductPortionCalc", "trnsactionPromotion: " + JSON.stringify(promotion));
3620
3625
  if (promotion.type === PROMOTION_TYPE.COUPON && promotion.subLevelType === PROMOTION_LEVEL.LINE) {
3621
3626
  txDoc.basket.products.forEach(function (product) {
3622
3627
  product = _this.validateProductItemDiscount(product);
@@ -3659,7 +3664,7 @@
3659
3664
  }
3660
3665
  }
3661
3666
  catch (error) {
3662
- console.log("updateTransactionPromotionPrtionCalc => failed:", JSON.stringify(error));
3667
+ appLogger_service.AppLoggerService.logError(this.className, "updateTransactionPromotionPrtionCalc", "updateTransactionPromotionPrtionCalc => failed:", error);
3663
3668
  }
3664
3669
  };
3665
3670
  WebReturnMapperBuilderClass.prototype.deviceId = function (deviceId) {
@@ -3715,11 +3720,11 @@
3715
3720
  }
3716
3721
  };
3717
3722
  WebReturnMapperBuilderClass.prototype.isInStoreOrder = function () {
3718
- console.log("Mapper library: WebReturnMapperBuilderClass: isInStoreOrder mapping started...");
3723
+ appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "isInStoreOrder mapping started...");
3719
3724
  if (this.document.payment && this.document.payment.method && this.document.payment.method === 'pos_order') {
3720
3725
  this.webReturnObject.isInStoreOrder = true;
3721
3726
  }
3722
- console.log("Mapper library: WebReturnMapperBuilderClass: isInStoreOrder mapping ended...");
3727
+ appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "isInStoreOrder mapping ended...");
3723
3728
  return this;
3724
3729
  };
3725
3730
  return WebReturnMapperBuilderClass;
@@ -3728,6 +3733,7 @@
3728
3733
  var WebReturnSalesforceMapperBuilderClass = /** @class */ (function () {
3729
3734
  function WebReturnSalesforceMapperBuilderClass(orderDetails, currencyPipe) {
3730
3735
  this.currencyPipe = currencyPipe;
3736
+ this.className = "WebReturnSalesforceMapperBuilderClass";
3731
3737
  this.webReturnObject = {
3732
3738
  id: '',
3733
3739
  orgCode: "",
@@ -3762,7 +3768,7 @@
3762
3768
  this.numberUtilService = new NumberUtilService(currencyPipe);
3763
3769
  }
3764
3770
  WebReturnSalesforceMapperBuilderClass.prototype.webReturnCommonMapper = function () {
3765
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: webReturnCommonMapper started...");
3771
+ appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "Mapper library: WebReturnSalesforceMapperBuilderClass: webReturnCommonMapper started...");
3766
3772
  this.webReturnObject['type'] = TRANSACTION_TYPE.WEB_RETURNS;
3767
3773
  this.webReturnObject['datetime'] = this.getUTCDateTime(this.orderDetails.last_modified);
3768
3774
  this.webReturnObject.baseCurrency = this.orderDetails.currency;
@@ -3773,13 +3779,13 @@
3773
3779
  this.webReturnObject.updatedAt = this.getUTCDateTime(this.orderDetails.last_modified);
3774
3780
  this.webReturnObject.transCompletedAt = this.getUTCDateTime(this.orderDetails.last_modified);
3775
3781
  this.webReturnObject['externalTransactionId'] = this.orderDetails.order_no;
3776
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: webReturnCommonMapper ended...");
3782
+ appLogger_service.AppLoggerService.logDebug(this.className, "webReturnCommonMapper", "webReturnCommonMapper ended...");
3777
3783
  return this;
3778
3784
  };
3779
3785
  // export(status, details) {
3780
- // console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: export mapping started...");
3781
- // console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: status:", status);
3782
- // console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: details:", JSON.stringify(details));
3786
+ // AppLoggerService.logDebug(this.className, "Mapper library: WebReturnSalesforceMapperBuilderClass: export mapping started...");
3787
+ // AppLoggerService.logDebug(this.className, "Mapper library: WebReturnSalesforceMapperBuilderClass: status:", status);
3788
+ // AppLoggerService.logDebug(this.className, "Mapper library: WebReturnSalesforceMapperBuilderClass: details:", JSON.stringify(details));
3783
3789
  // if (status && details && details.providers && details.providers.length > 0) {
3784
3790
  // details.providers.forEach(
3785
3791
  // providerObj => {
@@ -3793,7 +3799,7 @@
3793
3799
  // } else {
3794
3800
  // this.webReturnObject.export = false;
3795
3801
  // }
3796
- // console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: export mapping end...")
3802
+ // AppLoggerService.logDebug(this.className, "Mapper library: WebReturnSalesforceMapperBuilderClass: export mapping end...")
3797
3803
  // return this;
3798
3804
  // }
3799
3805
  WebReturnSalesforceMapperBuilderClass.prototype.getDeliveryMethod = function () {
@@ -3810,7 +3816,7 @@
3810
3816
  };
3811
3817
  WebReturnSalesforceMapperBuilderClass.prototype.product = function () {
3812
3818
  var _this = this;
3813
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: product mapping started...");
3819
+ appLogger_service.AppLoggerService.logDebug(this.className, "product", "product mapping started...");
3814
3820
  this.webReturnObject.basket['products'] = [];
3815
3821
  if (this.orderDetails.product_items && this.orderDetails.product_items.length > 0) {
3816
3822
  this.orderDetails.product_items.forEach(function (product, index) {
@@ -3829,11 +3835,11 @@
3829
3835
  }
3830
3836
  });
3831
3837
  }
3832
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: product mapping ended...");
3838
+ appLogger_service.AppLoggerService.logDebug(this.className, "product", "product mapping ended...");
3833
3839
  return this;
3834
3840
  };
3835
3841
  WebReturnSalesforceMapperBuilderClass.prototype.linePromotion = function () {
3836
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: linePromotion mapping started...");
3842
+ appLogger_service.AppLoggerService.logDebug(this.className, "linePromotion", "linePromotion mapping started...");
3837
3843
  this.webReturnObject.basket.linePromotion = [];
3838
3844
  var linePromotionArray = [];
3839
3845
  if (this.orderDetails.product_items && this.orderDetails.product_items.length > 0) {
@@ -3863,14 +3869,14 @@
3863
3869
  });
3864
3870
  }
3865
3871
  this.webReturnObject.basket.linePromotion = linePromotionArray;
3866
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: linePromotion mapping ended...");
3872
+ appLogger_service.AppLoggerService.logDebug(this.className, "linePromotion", "linePromotion mapping ended...");
3867
3873
  return this;
3868
3874
  };
3869
3875
  WebReturnSalesforceMapperBuilderClass.prototype.transactionPromotion = function () {
3870
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: transactionPromotion mapping started...");
3876
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotion", "transactionPromotion mapping started...");
3871
3877
  var transactionPromotionArray = this.getTransactionPromotions(this.orderDetails);
3872
3878
  this.webReturnObject.basket.transactionPromotion = transactionPromotionArray;
3873
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: transactionPromotion mapping ended...");
3879
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotion", "transactionPromotion mapping ended...");
3874
3880
  return this;
3875
3881
  };
3876
3882
  WebReturnSalesforceMapperBuilderClass.prototype.getTransactionPromotions = function (basket) {
@@ -3895,12 +3901,11 @@
3895
3901
  transactionPromotionArray_1.push(transactionPromotionObj);
3896
3902
  });
3897
3903
  }
3898
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: getTransactionPromotions : ", JSON.stringify(transactionPromotionArray_1));
3904
+ appLogger_service.AppLoggerService.logDebug(this.className, "getTransactionPromotions", "getTransactionPromotions : ", transactionPromotionArray_1);
3899
3905
  return transactionPromotionArray_1;
3900
3906
  }
3901
3907
  catch (error) {
3902
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: failed:", error);
3903
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: failed:", JSON.stringify(error));
3908
+ appLogger_service.AppLoggerService.logError(this.className, "getTransactionPromotions", "failed:", error);
3904
3909
  throw new Error(error);
3905
3910
  }
3906
3911
  };
@@ -3943,8 +3948,7 @@
3943
3948
  transactionPromotion.subLevelType = PROMOTION_LEVEL.LINE;
3944
3949
  transactionPromotion.trigger = triggerPromotion_1;
3945
3950
  }
3946
- console.log("linePromotion mapping ended...");
3947
- console.log("e-basket: updateLinePromotionWithCoupon", JSON.stringify(transactionPromotion));
3951
+ appLogger_service.AppLoggerService.logDebug(this.className, "updateLinePromotionWithCoupon", "transactionPromotion", transactionPromotion);
3948
3952
  if (!this.webReturnObject.basket.transactionPromotion) {
3949
3953
  this.webReturnObject.basket.transactionPromotion = [];
3950
3954
  }
@@ -3954,8 +3958,7 @@
3954
3958
  return this;
3955
3959
  }
3956
3960
  catch (error) {
3957
- console.log("Ebasket: Salesforce: linePromotion mapping=> failed:", error);
3958
- console.log("Ebasket: Salesforce: linePromotion mapping=> failed:", JSON.stringify(error));
3961
+ appLogger_service.AppLoggerService.logError(this.className, "updateLinePromotionWithCoupon", "linePromotion mapping=> failed:", error);
3959
3962
  throw new Error(error);
3960
3963
  }
3961
3964
  };
@@ -3970,7 +3973,7 @@
3970
3973
  };
3971
3974
  WebReturnSalesforceMapperBuilderClass.prototype.transactionPromotionProductPortionCalc = function (txDoc, promotion) {
3972
3975
  var _this = this;
3973
- console.log("ebasket: transactionPromotionProductPortionCalc: trnsactionPromotion: " + JSON.stringify(promotion));
3976
+ appLogger_service.AppLoggerService.logDebug(this.className, "transactionPromotionProductPortionCalc", "trnsactionPromotion: " + JSON.stringify(promotion));
3974
3977
  if (promotion.type === PROMOTION_TYPE.COUPON && promotion.subLevelType === PROMOTION_LEVEL.LINE) {
3975
3978
  txDoc.basket.products.forEach(function (product) {
3976
3979
  product = _this.validateProductItemDiscount(product);
@@ -4007,7 +4010,7 @@
4007
4010
  return product;
4008
4011
  };
4009
4012
  WebReturnSalesforceMapperBuilderClass.prototype.customer = function () {
4010
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: customer mapping started...");
4013
+ appLogger_service.AppLoggerService.logDebug(this.className, "customer", "customer mapping started...");
4011
4014
  var customerObj = {};
4012
4015
  customerObj.email = this.orderDetails.customer_info && this.orderDetails.customer_info.email ? this.orderDetails.customer_info.email : '';
4013
4016
  customerObj.firstName = this.orderDetails.billing_address && this.orderDetails.billing_address.first_name ? this.orderDetails.billing_address.first_name : '';
@@ -4043,20 +4046,20 @@
4043
4046
  });
4044
4047
  customerObj.shipmentDetails = shipmentDetails;
4045
4048
  this.webReturnObject.customer = customerObj;
4046
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: customer mapping ended...");
4049
+ appLogger_service.AppLoggerService.logDebug(this.className, "customer", "customer mapping ended...");
4047
4050
  return this;
4048
4051
  };
4049
4052
  WebReturnSalesforceMapperBuilderClass.prototype.isInStoreOrder = function () {
4050
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: isInStoreOrder mapping started...");
4053
+ appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "isInStoreOrder mapping started...");
4051
4054
  if (this.orderDetails.c_isInStoreOrder) {
4052
4055
  this.webReturnObject.isInStoreOrder = true;
4053
4056
  }
4054
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: isInStoreOrder mapping ended...");
4057
+ appLogger_service.AppLoggerService.logDebug(this.className, "isInStoreOrder", "isInStoreOrder mapping ended...");
4055
4058
  return this;
4056
4059
  };
4057
4060
  WebReturnSalesforceMapperBuilderClass.prototype.externalTransactionDetails = function () {
4058
4061
  var _this = this;
4059
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: externalTransactionDetails mapping started...");
4062
+ appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "externalTransactionDetails mapping started...");
4060
4063
  var externalTransactionDetails = [];
4061
4064
  if (this.orderDetails.shipments && this.orderDetails.shipments.length > 0) {
4062
4065
  this.orderDetails.shipments.forEach(function (shipment) {
@@ -4071,11 +4074,11 @@
4071
4074
  });
4072
4075
  }
4073
4076
  this.webReturnObject.externalTransactionDetails = externalTransactionDetails;
4074
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: externalTransactionDetails mapping ended...");
4077
+ appLogger_service.AppLoggerService.logDebug(this.className, "externalTransactionDetails", "externalTransactionDetails mapping ended...");
4075
4078
  return this;
4076
4079
  };
4077
4080
  WebReturnSalesforceMapperBuilderClass.prototype.basketSummary = function () {
4078
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: basketSummary mapping started...");
4081
+ appLogger_service.AppLoggerService.logDebug(this.className, "basketSummary", "basketSummary mapping started...");
4079
4082
  var basketSummary = {};
4080
4083
  var basketSummaryWebOrder = {};
4081
4084
  var linePromotionTotal = this.webReturnObject.basket.linePromotion.map(function (linePromotion) { return linePromotion.promotionAmount; }).reduce(function (accumulator, currentValue) { return accumulator + currentValue; }, 0);
@@ -4091,7 +4094,7 @@
4091
4094
  basketSummaryWebOrder.basketTotalWithShippingTotal = this.orderDetails.order_total ? this.orderDetails.order_total : 0;
4092
4095
  basketSummary.webOrder = basketSummaryWebOrder;
4093
4096
  this.webReturnObject.basketSummary = basketSummary;
4094
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: basketSummary mapping ended...");
4097
+ appLogger_service.AppLoggerService.logDebug(this.className, "basketSummary", "basketSummary mapping ended...");
4095
4098
  return this;
4096
4099
  };
4097
4100
  WebReturnSalesforceMapperBuilderClass.prototype.deviceId = function (deviceId) {
@@ -4131,7 +4134,7 @@
4131
4134
  return this;
4132
4135
  };
4133
4136
  WebReturnSalesforceMapperBuilderClass.prototype.build = function () {
4134
- console.log("Mapper library: WebReturnSalesforceMapperBuilderClass: mapping done...");
4137
+ appLogger_service.AppLoggerService.logDebug(this.className, "build", "mapping done...");
4135
4138
  return this.webReturnObject;
4136
4139
  };
4137
4140
  WebReturnSalesforceMapperBuilderClass.prototype.getUTCDateTime = function (date) {