@aptos-scp/scp-component-store-selling-features-domain-model 2.41.0 → 2.42.0

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.
@@ -146,6 +146,7 @@ export declare class StoreItem implements ISourceIndication, IStoreItemDescripto
146
146
  images?: IImage[];
147
147
  subscriptionFrequencyCodes?: string[];
148
148
  subType?: ItemSubType;
149
+ autoSubscribe?: boolean;
149
150
  static createFromJsonObject(storeItemJsonObj: any): StoreItem;
150
151
  static convertStoreItemComponentIPriceToPrice(value: IStoreItemsPrice): Price;
151
152
  static createFromItemObject(configurationManager: IConfigurationManager, retailLocationIdentity: RetailLocationIdentity, accountingCurrency: string, itemToConvert: IItem, locale?: string, sourceIndicator?: SourceType): StoreItem;
@@ -325,6 +325,9 @@ class StoreItem {
325
325
  if (storeItemJsonObj.subType) {
326
326
  storeItem.subType = storeItemJsonObj.subType;
327
327
  }
328
+ if (storeItemJsonObj.autoSubscribe) {
329
+ storeItem.autoSubscribe = storeItemJsonObj.autoSubscribe;
330
+ }
328
331
  storeItem.departmentGroupId = StoreItem.getStringFromJsonObject(storeItemJsonObj.departmentGroupId);
329
332
  return storeItem;
330
333
  }
@@ -453,6 +456,9 @@ class StoreItem {
453
456
  if (item.subType) {
454
457
  storeItem.subType = item.subType;
455
458
  }
459
+ if (item.autoSubscribe) {
460
+ storeItem.autoSubscribe = item.autoSubscribe;
461
+ }
456
462
  }
457
463
  catch (err) {
458
464
  logger.catching(err, entryMessage);
@@ -130,6 +130,7 @@ export declare abstract class BaseItemLineDecorator extends BaseLineDecorator<II
130
130
  get extendedPresentationAmount(): Money;
131
131
  get subscriptionFrequencyCodes(): string[];
132
132
  get subType(): ItemSubType;
133
+ get autoSubscribe(): boolean;
133
134
  get cancelled(): boolean;
134
135
  get extensibilityFormData(): IExtensibilityForm[];
135
136
  get itemTaxExemptAmount(): Money;
@@ -339,6 +339,9 @@ class BaseItemLineDecorator extends BaseLineDecorator_1.BaseLineDecorator {
339
339
  get subType() {
340
340
  return this.decoratedTransactionLine.subType;
341
341
  }
342
+ get autoSubscribe() {
343
+ return this.decoratedTransactionLine.autoSubscribe;
344
+ }
342
345
  get cancelled() {
343
346
  return this.decoratedTransactionLine.cancelled;
344
347
  }
@@ -212,6 +212,8 @@ export interface IItemLine extends ITransactionLine, IVoidableLine, IPriceProvid
212
212
  readonly subscriptionFrequencyCodes?: string[];
213
213
  /** item sub type */
214
214
  readonly subType?: ItemSubType;
215
+ /** flag that indicates if the item is auto subscribed */
216
+ readonly autoSubscribe?: boolean;
215
217
  /**
216
218
  * For order actions, the line number of the item being acted upon from the order.
217
219
  */
@@ -91,6 +91,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
91
91
  private _itemSelectedUnitPrice?;
92
92
  private _subscriptionFrequencyCodes?;
93
93
  private _subType?;
94
+ private _autoSubscribe?;
94
95
  private _pricingCalculationSourceIndicator?;
95
96
  private _taxationCalculationSourceIndicator?;
96
97
  private _pricingDataSourceIndicator?;
@@ -261,6 +262,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
261
262
  get extendedPresentationAmount(): Money;
262
263
  get subscriptionFrequencyCodes(): string[];
263
264
  get subType(): ItemSubType;
265
+ get autoSubscribe(): boolean;
264
266
  get pricingCalculationSourceIndicator(): SourceIndicator;
265
267
  get taxationCalculationSourceIndicator(): SourceIndicator;
266
268
  get pricingDataSourceIndicator(): SourceIndicator;
@@ -39,7 +39,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
39
39
  // tslint:disable-next-line:cyclomatic-complexity
40
40
  // eslint-disable-next-line complexity
41
41
  static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
42
- var _a, _b, _c, _d, _e, _f, _g, _h;
42
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
43
43
  let accountingCurrency = collectedData.get("accountingCurrency");
44
44
  const additionalItemInfo = collectedData.get("additionalItemInfo");
45
45
  const authResponse = collectedData.get(Constants_1.CollectedDataKey.TenderAuthResponse);
@@ -105,6 +105,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
105
105
  itemLine._eligibleForSendSale = (_c = storeItem.treatmentRules) === null || _c === void 0 ? void 0 : _c.eligibleForSendSale;
106
106
  itemLine._subscriptionFrequencyCodes = storeItem.subscriptionFrequencyCodes;
107
107
  itemLine._subType = (_d = storeItem) === null || _d === void 0 ? void 0 : _d.subType;
108
+ itemLine._autoSubscribe = (_e = storeItem) === null || _e === void 0 ? void 0 : _e.autoSubscribe;
108
109
  if (collectedData.get(Constants_1.CollectedDataKey.OriginalAlternativeLookupCodesExternalItem)) {
109
110
  itemLine._itemLookupKeys = ItemLine.getItemLookupKeyFromCollectedData(collectedData.get(Constants_1.CollectedDataKey.OriginalAlternativeLookupCodesExternalItem));
110
111
  }
@@ -202,13 +203,13 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
202
203
  if (taxIndicatorOnReceipt) {
203
204
  itemLine._taxIndicatorOnReceipt = taxIndicatorOnReceipt;
204
205
  }
205
- if (((_e = originalLoyaltyInformation) === null || _e === void 0 ? void 0 : _e.length) > 0) {
206
+ if (((_f = originalLoyaltyInformation) === null || _f === void 0 ? void 0 : _f.length) > 0) {
206
207
  itemLine._originalLoyaltyInformation = originalLoyaltyInformation;
207
208
  }
208
209
  if (originalCompetitivePriceInformation) {
209
210
  itemLine._originalCompetitivePriceInformation = originalCompetitivePriceInformation;
210
211
  }
211
- if (((_f = originalSupervisorOverrideInformation) === null || _f === void 0 ? void 0 : _f.length) > 0) {
212
+ if (((_g = originalSupervisorOverrideInformation) === null || _g === void 0 ? void 0 : _g.length) > 0) {
212
213
  itemLine._originalSupervisorOverrideInformation = originalSupervisorOverrideInformation;
213
214
  }
214
215
  if (originalTaxOverride) {
@@ -247,11 +248,11 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
247
248
  itemLine._originalAdjustments = originalAdjustments;
248
249
  }
249
250
  const originalRedemptionLoyaltyTransactionKeys = collectedData.get(Constants_1.CollectedDataKey.OriginalRedemptionLoyaltyTransactionKeys);
250
- if (((_g = originalRedemptionLoyaltyTransactionKeys) === null || _g === void 0 ? void 0 : _g.length) > 0) {
251
+ if (((_h = originalRedemptionLoyaltyTransactionKeys) === null || _h === void 0 ? void 0 : _h.length) > 0) {
251
252
  itemLine._originalRedemptionLoyaltyTransactionKeys = originalRedemptionLoyaltyTransactionKeys;
252
253
  }
253
254
  const originalSaleLoyaltyTransactionKeys = collectedData.get(Constants_1.CollectedDataKey.OriginalSaleLoyaltyTransactionKeys);
254
- if (((_h = originalSaleLoyaltyTransactionKeys) === null || _h === void 0 ? void 0 : _h.length) > 0) {
255
+ if (((_j = originalSaleLoyaltyTransactionKeys) === null || _j === void 0 ? void 0 : _j.length) > 0) {
255
256
  itemLine._originalSaleLoyaltyTransactionKeys = originalSaleLoyaltyTransactionKeys;
256
257
  }
257
258
  const originalTransactionLineReference = collectedData.get(Constants_1.CollectedDataKey.OriginalTransactionLineReference);
@@ -689,6 +690,9 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
689
690
  get subType() {
690
691
  return this._subType;
691
692
  }
693
+ get autoSubscribe() {
694
+ return this._autoSubscribe;
695
+ }
692
696
  get pricingCalculationSourceIndicator() {
693
697
  return this._pricingCalculationSourceIndicator;
694
698
  }
@@ -944,6 +948,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
944
948
  newItemLine._itemSelectedUnitPrice = this._itemSelectedUnitPrice;
945
949
  newItemLine._subscriptionFrequencyCodes = this._subscriptionFrequencyCodes;
946
950
  newItemLine._subType = this._subType;
951
+ newItemLine._autoSubscribe = this._autoSubscribe;
947
952
  newItemLine._pricingCalculationSourceIndicator = this._pricingCalculationSourceIndicator;
948
953
  newItemLine._taxationCalculationSourceIndicator = this._taxationCalculationSourceIndicator;
949
954
  newItemLine._pricingDataSourceIndicator = this._pricingDataSourceIndicator;
@@ -1089,6 +1094,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
1089
1094
  this._itemSelectedUnitPrice = transactionLineJsonObj._itemSelectedUnitPrice;
1090
1095
  this._subscriptionFrequencyCodes = transactionLineJsonObj._subscriptionFrequencyCodes;
1091
1096
  this._subType = transactionLineJsonObj._subType;
1097
+ this._autoSubscribe = transactionLineJsonObj._autoSubscribe;
1092
1098
  this._pricingCalculationSourceIndicator = transactionLineJsonObj._pricingCalculationSourceIndicator;
1093
1099
  this._taxationCalculationSourceIndicator = transactionLineJsonObj._taxationCalculationSourceIndicator;
1094
1100
  this._pricingDataSourceIndicator = transactionLineJsonObj._pricingDataSourceIndicator;
@@ -1,12 +1,15 @@
1
1
  import { ITransactionLine, ITransactionLineFactory } from "@aptos-scp/scp-component-store-selling-core";
2
2
  import { BaseItemLineDecorator } from "./BaseItemLineDecorator";
3
- import { IItemLine, IRewardCardTender } from "./IItemLine";
3
+ import { IItemLine, IItemSubline, IRewardCardTender } from "./IItemLine";
4
4
  export declare const DECORATOR_TYPE_ITEM_LINE_REWARD_CARD_TENDER: string;
5
5
  export declare function isItemLineRewardCardTenderDecorator(transactionLine: ITransactionLine): transactionLine is ItemLineRewardCardTenderDecorator;
6
6
  export declare class ItemLineRewardCardTenderDecorator extends BaseItemLineDecorator {
7
+ private _sublines;
7
8
  private _rewardCardTenders;
8
9
  static createFromJsonObject(transactionLineJsonObj: any, transactionLineFactory: ITransactionLineFactory): ItemLineRewardCardTenderDecorator;
9
- constructor(rewardCardTenders: IRewardCardTender[], itemLine: IItemLine, annotationDescription: string, annotationSourceType: string);
10
+ constructor(rewardCardTenders: IRewardCardTender[], itemLine: IItemLine, sublines: IItemSubline[], annotationDescription: string, annotationSourceType: string);
11
+ get sublines(): IItemSubline[];
12
+ setSublines(sublines: IItemSubline[]): IItemLine;
10
13
  get rewardCardTenders(): IRewardCardTender[];
11
14
  protected clone(): BaseItemLineDecorator;
12
15
  protected newTransactionLine(): BaseItemLineDecorator;
@@ -9,8 +9,9 @@ function isItemLineRewardCardTenderDecorator(transactionLine) {
9
9
  }
10
10
  exports.isItemLineRewardCardTenderDecorator = isItemLineRewardCardTenderDecorator;
11
11
  class ItemLineRewardCardTenderDecorator extends BaseItemLineDecorator_1.BaseItemLineDecorator {
12
- constructor(rewardCardTenders, itemLine, annotationDescription, annotationSourceType) {
12
+ constructor(rewardCardTenders, itemLine, sublines, annotationDescription, annotationSourceType) {
13
13
  super(new scp_component_business_core_1.Money(0.0, itemLine.lineSavings.currency), exports.DECORATOR_TYPE_ITEM_LINE_REWARD_CARD_TENDER, itemLine, annotationDescription, annotationSourceType);
14
+ this._sublines = sublines;
14
15
  this._rewardCardTenders = rewardCardTenders;
15
16
  }
16
17
  static createFromJsonObject(transactionLineJsonObj, transactionLineFactory) {
@@ -27,19 +28,29 @@ class ItemLineRewardCardTenderDecorator extends BaseItemLineDecorator_1.BaseItem
27
28
  });
28
29
  const annotationDescription = BaseItemLineDecorator_1.BaseItemLineDecorator.getAnnotationDescriptionFromJsonObject(transactionLineJsonObj);
29
30
  const annotationSourceType = BaseItemLineDecorator_1.BaseItemLineDecorator.getAnnotationSourceTypeFromJsonObject(transactionLineJsonObj);
30
- const itemLineRewardCardTenderDecorator = new ItemLineRewardCardTenderDecorator(rewardCardTenders, decoratedItemLine, annotationDescription, annotationSourceType);
31
+ const sublines = BaseItemLineDecorator_1.BaseItemLineDecorator.getSublinesFromJsonObject(transactionLineJsonObj);
32
+ const itemLineRewardCardTenderDecorator = new ItemLineRewardCardTenderDecorator(rewardCardTenders, decoratedItemLine, sublines, annotationDescription, annotationSourceType);
31
33
  return itemLineRewardCardTenderDecorator;
32
34
  }
35
+ get sublines() {
36
+ return this._sublines;
37
+ }
38
+ setSublines(sublines) {
39
+ const newLine = this.clone();
40
+ newLine._sublines = sublines;
41
+ return newLine;
42
+ }
33
43
  get rewardCardTenders() {
34
44
  return this._rewardCardTenders;
35
45
  }
36
46
  clone() {
37
47
  const itemLineRewardCardTenderDecorator = super.clone();
38
48
  itemLineRewardCardTenderDecorator._rewardCardTenders = this._rewardCardTenders;
49
+ itemLineRewardCardTenderDecorator._sublines = this._sublines;
39
50
  return itemLineRewardCardTenderDecorator;
40
51
  }
41
52
  newTransactionLine() {
42
- return new ItemLineRewardCardTenderDecorator(this._rewardCardTenders, this.decoratedTransactionLine, this.annotationDescription, this.annotationSourceType);
53
+ return new ItemLineRewardCardTenderDecorator(this._rewardCardTenders, this.decoratedTransactionLine, this._sublines, this.annotationDescription, this.annotationSourceType);
43
54
  }
44
55
  }
45
56
  exports.ItemLineRewardCardTenderDecorator = ItemLineRewardCardTenderDecorator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.41.0",
3
+ "version": "2.42.0",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -57,7 +57,7 @@
57
57
  "@aptos-scp/scp-component-business-core": "^1.12.7",
58
58
  "@aptos-scp/scp-component-logging": "^2.1.16",
59
59
  "@aptos-scp/scp-component-pricing": "^7.69.0",
60
- "@aptos-scp/scp-component-store-items": "^1.23.0",
60
+ "@aptos-scp/scp-component-store-items": "^1.24.0",
61
61
  "@aptos-scp/scp-component-store-selling-core": "^18.9.3",
62
62
  "@aptos-scp/scp-component-taxation": "^5.28.0",
63
63
  "@aptos-scp/scp-component-user": "^1.4.0",
@@ -80,7 +80,7 @@
80
80
  "@aptos-scp/scp-component-logging": "^2.1.16",
81
81
  "@aptos-scp/scp-component-pricing": "^7.69.0",
82
82
  "@aptos-scp/scp-component-rn-circuit-breaker": "^1.0.15",
83
- "@aptos-scp/scp-component-store-items": "^1.23.0",
83
+ "@aptos-scp/scp-component-store-items": "^1.24.0",
84
84
  "@aptos-scp/scp-component-store-selling-core": "^18.9.3",
85
85
  "@aptos-scp/scp-component-taxation": "^5.28.0",
86
86
  "@aptos-scp/scp-component-user": "^1.4.0",
@@ -98,7 +98,7 @@
98
98
  "@aptos-scp/scp-types-orders": "^4.11.0",
99
99
  "@aptos-scp/scp-types-pricing": "^4.31.1",
100
100
  "@aptos-scp/scp-types-ss-transaction-history": "^1.6.0",
101
- "@aptos-scp/scp-types-store-items": "^1.41.0",
101
+ "@aptos-scp/scp-types-store-items": "^1.42.0",
102
102
  "@aptos-scp/scp-types-terminal-settings": "^1.3.0",
103
103
  "@aptos-scp/scp-types-transaction": "^1.4.3",
104
104
  "@aptos-scp/scp-types-user": "^1.5.2",