@aptos-scp/scp-component-store-selling-features-domain-model 2.41.1 → 2.43.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.
- package/lib/domain/model/StoreItem.d.ts +1 -0
- package/lib/domain/model/StoreItem.js +6 -0
- package/lib/domain/model/item/BaseItemLineDecorator.d.ts +1 -0
- package/lib/domain/model/item/BaseItemLineDecorator.js +3 -0
- package/lib/domain/model/item/IItemLine.d.ts +2 -0
- package/lib/domain/model/item/ItemLine.d.ts +2 -0
- package/lib/domain/model/item/ItemLine.js +11 -5
- package/lib/domain/model/tender/RewardCardTenderAppliedAmountDecorator.d.ts +2 -0
- package/lib/domain/model/tender/RewardCardTenderAppliedAmountDecorator.js +6 -0
- package/lib/domain/model/tender/RewardCardTenderLine.d.ts +1 -3
- package/lib/domain/model/tender/RewardCardTenderLine.js +6 -10
- package/package.json +4 -4
|
@@ -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 (((
|
|
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 (((
|
|
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 (((
|
|
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 (((
|
|
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;
|
|
@@ -17,6 +17,8 @@ export declare class RewardCardTenderAppliedAmountDecorator extends BaseLineDeco
|
|
|
17
17
|
get tenderId(): string;
|
|
18
18
|
get voided(): boolean;
|
|
19
19
|
get voidSource(): VoidSource;
|
|
20
|
+
get preventsTransactionVoid(): boolean;
|
|
21
|
+
get allowVoid(): boolean;
|
|
20
22
|
get isAuthorized(): boolean;
|
|
21
23
|
protected newTransactionLine(): RewardCardTenderAppliedAmountDecorator;
|
|
22
24
|
}
|
|
@@ -41,6 +41,12 @@ class RewardCardTenderAppliedAmountDecorator extends BaseLineDecorator_1.BaseLin
|
|
|
41
41
|
get voidSource() {
|
|
42
42
|
return this.decoratedTransactionLine.voidSource;
|
|
43
43
|
}
|
|
44
|
+
get preventsTransactionVoid() {
|
|
45
|
+
return this.decoratedTransactionLine.preventsTransactionVoid;
|
|
46
|
+
}
|
|
47
|
+
get allowVoid() {
|
|
48
|
+
return this.decoratedTransactionLine.allowVoid;
|
|
49
|
+
}
|
|
44
50
|
get isAuthorized() {
|
|
45
51
|
return this.decoratedTransactionLine.isAuthorized;
|
|
46
52
|
}
|
|
@@ -11,8 +11,6 @@ export declare class RewardCardTenderLine extends BaseTransactionLine implements
|
|
|
11
11
|
private _appliedAmount;
|
|
12
12
|
private _pin;
|
|
13
13
|
private _tenderId;
|
|
14
|
-
private _voided;
|
|
15
|
-
private _voidSource;
|
|
16
14
|
static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): RewardCardTenderLine;
|
|
17
15
|
static createFromJsonObject(transactionLineJsonObj: any): RewardCardTenderLine;
|
|
18
16
|
get couldAffectPricing(): boolean;
|
|
@@ -32,6 +30,6 @@ export declare class RewardCardTenderLine extends BaseTransactionLine implements
|
|
|
32
30
|
* that references this RewardCardTenderLine.
|
|
33
31
|
*/
|
|
34
32
|
get isAuthorized(): boolean;
|
|
35
|
-
protected constructor(lineNumber: number, lineType: string, cardNumber: string, customerNumber: string, balanceAmount: Money, appliedAmount: Money, pin: string, tenderId: string
|
|
33
|
+
protected constructor(lineNumber: number, lineType: string, cardNumber: string, customerNumber: string, balanceAmount: Money, appliedAmount: Money, pin: string, tenderId: string);
|
|
36
34
|
protected newTransactionLine(): BaseTransactionLine;
|
|
37
35
|
}
|
|
@@ -5,7 +5,7 @@ const BaseTransactionLine_1 = require("../BaseTransactionLine");
|
|
|
5
5
|
const Constants_1 = require("../Constants");
|
|
6
6
|
exports.REWARD_CARD_TENDER_LINE_TYPE = "RewardCardTender";
|
|
7
7
|
class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
8
|
-
constructor(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, appliedAmount, pin, tenderId
|
|
8
|
+
constructor(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, appliedAmount, pin, tenderId) {
|
|
9
9
|
var _a;
|
|
10
10
|
const currency = (_a = (appliedAmount || balanceAmount)) === null || _a === void 0 ? void 0 : _a.currency;
|
|
11
11
|
const extendedAmount = appliedAmount || (currency ? new scp_component_business_core_1.Money(0, currency) : undefined);
|
|
@@ -16,8 +16,6 @@ class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
16
16
|
this._appliedAmount = appliedAmount;
|
|
17
17
|
this._pin = pin;
|
|
18
18
|
this._tenderId = tenderId;
|
|
19
|
-
this._voided = voided;
|
|
20
|
-
this._voidSource = voidSource;
|
|
21
19
|
}
|
|
22
20
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
23
21
|
const cardNumber = collectedData.get(Constants_1.CollectedDataKey.CardNumber);
|
|
@@ -25,7 +23,7 @@ class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
25
23
|
const balanceAmount = collectedData.get(Constants_1.CollectedDataKey.RewardCardBalanceAmount);
|
|
26
24
|
const pin = collectedData.get(Constants_1.CollectedDataKey.GiftCardPin);
|
|
27
25
|
const tenderId = collectedData.get(Constants_1.CollectedDataKey.TenderId);
|
|
28
|
-
return new RewardCardTenderLine(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, undefined, pin, tenderId
|
|
26
|
+
return new RewardCardTenderLine(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, undefined, pin, tenderId);
|
|
29
27
|
}
|
|
30
28
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
31
29
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
@@ -40,9 +38,7 @@ class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
40
38
|
: undefined;
|
|
41
39
|
const pin = transactionLineJsonObj._pin;
|
|
42
40
|
const tenderId = transactionLineJsonObj._tenderId;
|
|
43
|
-
const
|
|
44
|
-
const voidSource = transactionLineJsonObj._voidSource;
|
|
45
|
-
const line = new RewardCardTenderLine(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, appliedAmount, pin, tenderId, voided, voidSource);
|
|
41
|
+
const line = new RewardCardTenderLine(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, appliedAmount, pin, tenderId);
|
|
46
42
|
line.loadFromJsonObject(transactionLineJsonObj);
|
|
47
43
|
return line;
|
|
48
44
|
}
|
|
@@ -68,10 +64,10 @@ class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
68
64
|
return this._tenderId;
|
|
69
65
|
}
|
|
70
66
|
get voided() {
|
|
71
|
-
return
|
|
67
|
+
return false;
|
|
72
68
|
}
|
|
73
69
|
get voidSource() {
|
|
74
|
-
return
|
|
70
|
+
return undefined;
|
|
75
71
|
}
|
|
76
72
|
get preventsTransactionVoid() {
|
|
77
73
|
return false;
|
|
@@ -88,7 +84,7 @@ class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
88
84
|
return false;
|
|
89
85
|
}
|
|
90
86
|
newTransactionLine() {
|
|
91
|
-
return new RewardCardTenderLine(this.lineNumber, this.lineType, this._cardNumber, this._customerNumber, this._balanceAmount, this._appliedAmount, this._pin, this._tenderId
|
|
87
|
+
return new RewardCardTenderLine(this.lineNumber, this.lineType, this._cardNumber, this._customerNumber, this._balanceAmount, this._appliedAmount, this._pin, this._tenderId);
|
|
92
88
|
}
|
|
93
89
|
}
|
|
94
90
|
exports.RewardCardTenderLine = RewardCardTenderLine;
|
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.
|
|
3
|
+
"version": "2.43.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.
|
|
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.
|
|
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.
|
|
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",
|