@pmcretail/mapper-library 0.0.9 → 0.0.10

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.
@@ -18,10 +18,10 @@ class MapperLibraryComponent {
18
18
  MapperLibraryComponent.decorators = [
19
19
  { type: Component, args: [{
20
20
  selector: 'lib-mapper-library',
21
- template: `
22
- <p>
23
- mapper-library works!
24
- </p>
21
+ template: `
22
+ <p>
23
+ mapper-library works!
24
+ </p>
25
25
  `
26
26
  }] }
27
27
  ];
@@ -3563,7 +3563,7 @@ class RJMapperBuilderClass {
3563
3563
  (/** @type {?} */ (this)).rjObject['Header'].TradingRegionID = (/** @type {?} */ (this)).tradingRegionId;
3564
3564
  (/** @type {?} */ (this)).rjObject['Header'].Eurozone = " "; //unknown
3565
3565
  (/** @type {?} */ (this)).rjObject['Header'].EuroBaseExchangeRate = ""; //unknown
3566
- (/** @type {?} */ (this)).rjObject['Header'].PrintableName = ""; //unknown
3566
+ (/** @type {?} */ (this)).rjObject['Header'].PrintableName = (/** @type {?} */ (this)).transactionDocument.userName; //unknown
3567
3567
  return (/** @type {?} */ (this));
3568
3568
  }
3569
3569
  /**
@@ -3696,7 +3696,7 @@ class RJMapperBuilderClass {
3696
3696
  obj['NetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
3697
3697
  obj['EffectiveNetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
3698
3698
  obj['Description'] = element.reasonCode;
3699
- obj['UserID'] = (/** @type {?} */ (this)).transactionDocument.basket.userId;
3699
+ obj['UserID'] = (/** @type {?} */ (this)).transactionDocument.userName;
3700
3700
  obj['ReasonCodeID'] = element.reasonCode;
3701
3701
  obj['DiscountType'] = element.discountType.toUpperCase() == DISCOUNTTYPE.PERCENT.toUpperCase() ? 0 : 1; // todo - compare values
3702
3702
  obj['RoundingRule'] = 2;
@@ -3730,7 +3730,7 @@ class RJMapperBuilderClass {
3730
3730
  obj.EffectiveNetValue = 0;
3731
3731
  obj.Description = data.percentageDiscountReasonName ? data.percentageDiscountReasonName : data.priceOverrideReasonName;
3732
3732
  obj.DeviceID = this.deviceId;
3733
- obj.UserID = this.userId;
3733
+ obj.UserID = this.transactionDocument.userName;
3734
3734
  obj.DateTimeCreated = this.updatedAt;
3735
3735
  obj.AuthorisingUserID = this.userId;
3736
3736
  obj.ReasonCodeID = data.percentageDiscountReasonCode ? data.percentageDiscountReasonCode : data.priceOverrideReasonCode;
@@ -3748,8 +3748,8 @@ class RJMapperBuilderClass {
3748
3748
  (/** @type {?} */ (this)).rjObject['Trailer'] = {};
3749
3749
  (/** @type {?} */ (this)).rjObject.Trailer.DateTimeCompleted = (/** @type {?} */ (this)).updatedAt;
3750
3750
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy = {};
3751
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId; //todo
3752
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId; //todo
3751
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
3752
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
3753
3753
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
3754
3754
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
3755
3755
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).transactionDocument.terminalId;
@@ -3853,17 +3853,15 @@ class RJMapperBuilderClass {
3853
3853
  let obj = {
3854
3854
  XMLSchemaVersion: (/** @type {?} */ (this)).xmlSchemaVersion,
3855
3855
  LineNumber: (/** @type {?} */ (this)).generateLineNumber(),
3856
- NetValue: (/** @type {?} */ (this)).convertToString(-1 * (Math.round(element.amount))),
3857
- EffectiveNetValue: (/** @type {?} */ (this)).convertToString(-1 * (Math.round(element.amount))),
3856
+ NetValue: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
3857
+ EffectiveNetValue: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
3858
3858
  Description: (/** @type {?} */ (this)).getDescription(value[0].name, element),
3859
3859
  DeviceID: (/** @type {?} */ (this)).deviceId,
3860
- //todo
3861
- UserID: (/** @type {?} */ (this)).userId,
3862
- //todo
3860
+ UserID: (/** @type {?} */ (this)).transactionDocument.userName,
3863
3861
  DateTimeCreated: (/** @type {?} */ (this)).updatedAt,
3864
3862
  TenderType: value[0].tenderType,
3865
3863
  TenderSubType: value[0].tenderSubType,
3866
- TenderAmount: (/** @type {?} */ (this)).convertToString(-1 * (Math.round(element.amount))),
3864
+ TenderAmount: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
3867
3865
  CurrencyID: (/** @type {?} */ (this)).transactionDocument.baseCurrency,
3868
3866
  CurrencyDescription: (/** @type {?} */ (this)).transactionDocument.baseCurrency,
3869
3867
  GiftVoucherSalesAllowed: '',
@@ -3884,9 +3882,7 @@ class RJMapperBuilderClass {
3884
3882
  EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
3885
3883
  Description: (/** @type {?} */ (this)).getDescription(value[0].name, element),
3886
3884
  DeviceID: (/** @type {?} */ (this)).deviceId,
3887
- //todo
3888
- UserID: (/** @type {?} */ (this)).userId,
3889
- //todo
3885
+ UserID: (/** @type {?} */ (this)).transactionDocument.userName,
3890
3886
  DateTimeCreated: (/** @type {?} */ (this)).updatedAt,
3891
3887
  TenderType: value[0].tenderType,
3892
3888
  TenderSubType: value[0].tenderSubType,
@@ -4100,7 +4096,7 @@ class RJMapperBuilderClass {
4100
4096
  * @return {THIS}
4101
4097
  */
4102
4098
  setCashierID(value) {
4103
- (/** @type {?} */ (this)).cashierId = value;
4099
+ (/** @type {?} */ (this)).cashierId = ((/** @type {?} */ (this)).transactionDocument && (/** @type {?} */ (this)).transactionDocument.userName) ? (/** @type {?} */ (this)).transactionDocument.userName : '';
4104
4100
  return (/** @type {?} */ (this));
4105
4101
  }
4106
4102
  /**
@@ -4304,9 +4300,7 @@ class RJMapperBuilderClass {
4304
4300
  EffectiveNetValue: this.removeDecimal(element.totalLinePrice),
4305
4301
  Description: element.description,
4306
4302
  DeviceID: this.deviceId,
4307
- //to do
4308
- UserID: this.userId,
4309
- //to do,
4303
+ UserID: this.transactionDocument.userName,
4310
4304
  DateTimeCreated: this.createdAt,
4311
4305
  ExtendedValue: this.removeDecimal(element.price),
4312
4306
  UnitPrice: this.removeDecimal(element.price),