@aptos-scp/scp-component-store-selling-features-domain-model 1.34.0 → 1.36.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/Constants.d.ts +2 -1
- package/lib/domain/model/Constants.js +1 -0
- package/lib/domain/model/TenderAuthorizationSession.d.ts +3 -0
- package/lib/domain/model/TenderAuthorizationSession.js +12 -0
- package/lib/domain/model/item/BasePriceChangeLineDecorator.d.ts +1 -0
- package/lib/domain/model/item/BasePriceChangeLineDecorator.js +3 -0
- package/lib/domain/model/item/ItemPriceChangeLine.d.ts +3 -1
- package/lib/domain/model/item/ItemPriceChangeLine.js +9 -3
- package/lib/domain/model/item/SupersededPriceChangeLineDecorator.d.ts +11 -0
- package/lib/domain/model/item/SupersededPriceChangeLineDecorator.js +31 -0
- package/lib/domain/model/item/index.d.ts +1 -0
- package/lib/domain/model/item/index.js +1 -0
- package/package.json +1 -1
|
@@ -427,7 +427,8 @@ export declare enum UiInputKey {
|
|
|
427
427
|
ORIGINAL_TENDER = "input_originalTender",
|
|
428
428
|
REFUNDABLE_TENDERS = "input_refundableTenders",
|
|
429
429
|
BEST_REDEMPTION_PROMPT_STATUS = "input_bestRedemptionPromptStatus",
|
|
430
|
-
TENDER_IS_ORIGINAL_TENDER = "input_tenderIsOriginalTender"
|
|
430
|
+
TENDER_IS_ORIGINAL_TENDER = "input_tenderIsOriginalTender",
|
|
431
|
+
TENDER_KEYED_ENTRY = "input_tenderKeyedEntry"
|
|
431
432
|
}
|
|
432
433
|
export declare enum CollectedDataKey {
|
|
433
434
|
Abort = "abort",
|
|
@@ -431,6 +431,7 @@ var UiInputKey;
|
|
|
431
431
|
UiInputKey["REFUNDABLE_TENDERS"] = "input_refundableTenders";
|
|
432
432
|
UiInputKey["BEST_REDEMPTION_PROMPT_STATUS"] = "input_bestRedemptionPromptStatus";
|
|
433
433
|
UiInputKey["TENDER_IS_ORIGINAL_TENDER"] = "input_tenderIsOriginalTender";
|
|
434
|
+
UiInputKey["TENDER_KEYED_ENTRY"] = "input_tenderKeyedEntry";
|
|
434
435
|
})(UiInputKey = exports.UiInputKey || (exports.UiInputKey = {}));
|
|
435
436
|
//
|
|
436
437
|
// Keys for use in relaying data collectedData (qualification) and nonContextualData (action).
|
|
@@ -12,6 +12,7 @@ export declare enum TenderAuthorizationState {
|
|
|
12
12
|
BalanceInquiryInProgress = "BalanceInquiryInProgress",
|
|
13
13
|
GiftCardIssueInProgress = "GiftCardIssueInProgress",
|
|
14
14
|
GiftCardRefundInProgress = "GiftCardRefundInProgress",
|
|
15
|
+
ManualEntryInProgress = "ManualEntryInProgress",
|
|
15
16
|
WaitingForPartialAuthorizationApproval = "waitingForPartialAuthorizationApproval",
|
|
16
17
|
WaitingForRetryLastAuthorization = "WaitingForRetryLastAuthorization",
|
|
17
18
|
WaitingForNonIntegratedInput = "WaitingForNonIntegratedInput",
|
|
@@ -73,6 +74,7 @@ export declare class TenderAuthorizationSession implements IState {
|
|
|
73
74
|
get inBalanceInquiryInProgress(): boolean;
|
|
74
75
|
get inGiftCardIssueInProgress(): boolean;
|
|
75
76
|
get inGiftCardRefundInProgress(): boolean;
|
|
77
|
+
get inManualEntryInProgress(): boolean;
|
|
76
78
|
get inWaitingForPartialAuthorizationApproval(): boolean;
|
|
77
79
|
get inWaitingForTransactionVoid(): boolean;
|
|
78
80
|
get inWaitingForNonIntegratedInput(): boolean;
|
|
@@ -82,6 +84,7 @@ export declare class TenderAuthorizationSession implements IState {
|
|
|
82
84
|
startAuthorization(lineNumber: number, tenderAuthCategory?: TenderAuthCategory): TenderAuthorizationSession;
|
|
83
85
|
startInProgress(lineNumber: number, tenderAuthCategory: TenderAuthCategory, authorizationMode?: AuthorizationMode): TenderAuthorizationSession;
|
|
84
86
|
startTenderVoid(lineNumber: number, tenderAuthCategory: TenderAuthCategory): TenderAuthorizationSession;
|
|
87
|
+
startManualEntry(lineNumber: number): TenderAuthorizationSession;
|
|
85
88
|
startBalanceInquiry(lineNumber: number): TenderAuthorizationSession;
|
|
86
89
|
startGiftCardIssue(lineNumber: number): TenderAuthorizationSession;
|
|
87
90
|
startGiftCardRefund(lineNumber: number): TenderAuthorizationSession;
|
|
@@ -15,6 +15,7 @@ var TenderAuthorizationState;
|
|
|
15
15
|
TenderAuthorizationState["BalanceInquiryInProgress"] = "BalanceInquiryInProgress";
|
|
16
16
|
TenderAuthorizationState["GiftCardIssueInProgress"] = "GiftCardIssueInProgress";
|
|
17
17
|
TenderAuthorizationState["GiftCardRefundInProgress"] = "GiftCardRefundInProgress";
|
|
18
|
+
TenderAuthorizationState["ManualEntryInProgress"] = "ManualEntryInProgress";
|
|
18
19
|
TenderAuthorizationState["WaitingForPartialAuthorizationApproval"] = "waitingForPartialAuthorizationApproval";
|
|
19
20
|
TenderAuthorizationState["WaitingForRetryLastAuthorization"] = "WaitingForRetryLastAuthorization";
|
|
20
21
|
TenderAuthorizationState["WaitingForNonIntegratedInput"] = "WaitingForNonIntegratedInput";
|
|
@@ -41,6 +42,7 @@ const TenderAuthorizationStateNumericMap = {
|
|
|
41
42
|
8: "waitingForPartialAuthorizationApproval",
|
|
42
43
|
9: "GiftCardRefundInProgress",
|
|
43
44
|
10: "TenderVoidInProgress",
|
|
45
|
+
11: "ManualEntryInProgress",
|
|
44
46
|
};
|
|
45
47
|
exports.TENDER_AUTH_SESSION = "TenderAuthSession";
|
|
46
48
|
class TenderAuthorizationSession {
|
|
@@ -181,6 +183,9 @@ class TenderAuthorizationSession {
|
|
|
181
183
|
get inGiftCardRefundInProgress() {
|
|
182
184
|
return this._state === TenderAuthorizationState.GiftCardRefundInProgress;
|
|
183
185
|
}
|
|
186
|
+
get inManualEntryInProgress() {
|
|
187
|
+
return this._state === TenderAuthorizationState.ManualEntryInProgress;
|
|
188
|
+
}
|
|
184
189
|
get inWaitingForPartialAuthorizationApproval() {
|
|
185
190
|
return this._state === TenderAuthorizationState.WaitingForPartialAuthorizationApproval;
|
|
186
191
|
}
|
|
@@ -199,6 +204,7 @@ class TenderAuthorizationSession {
|
|
|
199
204
|
get isAuthorizationDeviceActive() {
|
|
200
205
|
return (this.inGiftCardIssueInProgress ||
|
|
201
206
|
this.inBalanceInquiryInProgress ||
|
|
207
|
+
this.inManualEntryInProgress ||
|
|
202
208
|
this.inWaitingForReversal ||
|
|
203
209
|
this.inWaitingForTransactionVoid ||
|
|
204
210
|
this.inCancelInProgress ||
|
|
@@ -228,6 +234,12 @@ class TenderAuthorizationSession {
|
|
|
228
234
|
? this
|
|
229
235
|
: new TenderAuthorizationSession(TenderAuthorizationState.TenderVoidInProgress, lineNumber, undefined, undefined, undefined, undefined, undefined, undefined, undefined, tenderAuthCategory);
|
|
230
236
|
}
|
|
237
|
+
startManualEntry(lineNumber) {
|
|
238
|
+
logger.traceEntry("startManualEntry");
|
|
239
|
+
return this.inManualEntryInProgress
|
|
240
|
+
? this
|
|
241
|
+
: new TenderAuthorizationSession(TenderAuthorizationState.ManualEntryInProgress, lineNumber, undefined, undefined);
|
|
242
|
+
}
|
|
231
243
|
startBalanceInquiry(lineNumber) {
|
|
232
244
|
logger.traceEntry("startBalanceInquiry");
|
|
233
245
|
return this.inBalanceInquiryInProgress
|
|
@@ -13,6 +13,7 @@ export declare abstract class BasePriceChangeLineDecorator extends BaseLineDecor
|
|
|
13
13
|
get extendedAmountIncludingTax(): Money;
|
|
14
14
|
get couldAffectPricing(): boolean;
|
|
15
15
|
get unitPrice(): Price;
|
|
16
|
+
get superseded(): boolean;
|
|
16
17
|
get preventsTransactionVoid(): boolean;
|
|
17
18
|
get allowVoid(): boolean;
|
|
18
19
|
protected constructor(lineDecoratorType: string, decoratedTransactionLine: ItemPriceChangeLine, annotationDescription: string, annotationSourceType: string, annotationSourceLineNumber?: number);
|
|
@@ -32,6 +32,9 @@ class BasePriceChangeLineDecorator extends BaseLineDecorator_1.BaseLineDecorator
|
|
|
32
32
|
get unitPrice() {
|
|
33
33
|
return this.decoratedTransactionLine.unitPrice;
|
|
34
34
|
}
|
|
35
|
+
get superseded() {
|
|
36
|
+
return this.decoratedTransactionLine.superseded;
|
|
37
|
+
}
|
|
35
38
|
get preventsTransactionVoid() {
|
|
36
39
|
return false;
|
|
37
40
|
}
|
|
@@ -12,6 +12,7 @@ export declare class ItemPriceChangeLine extends BaseTransactionLine implements
|
|
|
12
12
|
private _reasonDescription;
|
|
13
13
|
private _supervisorOverrideLineReference;
|
|
14
14
|
private _copiedFromLineNumber;
|
|
15
|
+
private _superseded;
|
|
15
16
|
/**
|
|
16
17
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
17
18
|
* data collected during the qualification process.
|
|
@@ -37,7 +38,8 @@ export declare class ItemPriceChangeLine extends BaseTransactionLine implements
|
|
|
37
38
|
get allowVoid(): boolean;
|
|
38
39
|
get copiedFromLineNumber(): number;
|
|
39
40
|
copyLineWithNewLineNumber(newLineNumber: number, linePropertyOverrides?: Readonly<Map<string, any>>): ItemPriceChangeLine;
|
|
40
|
-
|
|
41
|
+
get superseded(): boolean;
|
|
42
|
+
protected constructor(changeLineNumber: number, price: Price, reasonCode: string, reasonListType: string, reasonDescription: string, lineNumber: number, lineType: string, supervisorOverrideLineReference: ITransactionLineReferenceType, extendedAmount?: Money, extendedAmountExcludingTax?: Money, extendedAmountIncludingTax?: Money, copiedFromLineNumber?: number, superseded?: boolean);
|
|
41
43
|
protected clone(): BaseTransactionLine;
|
|
42
44
|
protected newTransactionLine(): BaseTransactionLine;
|
|
43
45
|
}
|
|
@@ -9,7 +9,7 @@ exports.CHANGE_ITEM_PRICE_LINE_TYPE = "ChangeItemPrice";
|
|
|
9
9
|
class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
10
10
|
// The constructor is only used by the create methods, which should be used instead of the constructor to create an
|
|
11
11
|
// instance.
|
|
12
|
-
constructor(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber) {
|
|
12
|
+
constructor(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber, superseded) {
|
|
13
13
|
super(lineNumber, lineType, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax);
|
|
14
14
|
this._changeLineNumber = changeLineNumber;
|
|
15
15
|
this._price = price;
|
|
@@ -18,6 +18,7 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
18
18
|
this._reasonDescription = reasonDescription;
|
|
19
19
|
this._supervisorOverrideLineReference = supervisorOverrideLineReference;
|
|
20
20
|
this._copiedFromLineNumber = copiedFromLineNumber;
|
|
21
|
+
this._superseded = superseded;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
@@ -55,7 +56,9 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
55
56
|
const reasonListType = transactionLineJsonObj._reasonListType;
|
|
56
57
|
const reasonDescription = transactionLineJsonObj._reasonDescription;
|
|
57
58
|
const supervisorOverrideLineReference = transactionLineJsonObj._supervisorOverrideLineReference;
|
|
58
|
-
const
|
|
59
|
+
const copiedFromLineNumber = transactionLineJsonObj._copiedFromLineNumber;
|
|
60
|
+
const superseded = transactionLineJsonObj._superseded;
|
|
61
|
+
const itemPriceChangeLine = new ItemPriceChangeLine(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber, superseded);
|
|
59
62
|
itemPriceChangeLine.loadFromJsonObject(transactionLineJsonObj);
|
|
60
63
|
return itemPriceChangeLine;
|
|
61
64
|
}
|
|
@@ -100,6 +103,9 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
100
103
|
clonedItem._copiedFromLineNumber = (_b = linePropertyOverrides) === null || _b === void 0 ? void 0 : _b.get(Constants_1.LinePropertyOverrides.CopiedFromLineNumber);
|
|
101
104
|
return clonedItem.updateLineNumber(newLineNumber);
|
|
102
105
|
}
|
|
106
|
+
get superseded() {
|
|
107
|
+
return this._superseded;
|
|
108
|
+
}
|
|
103
109
|
clone() {
|
|
104
110
|
const newTransactionLine = super.clone();
|
|
105
111
|
// These are handled by the constructor called by newTransactionLine().
|
|
@@ -120,7 +126,7 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
120
126
|
}
|
|
121
127
|
*/
|
|
122
128
|
newTransactionLine() {
|
|
123
|
-
return new ItemPriceChangeLine(this._changeLineNumber, this._price, this._reasonCode, this._reasonListType, this._reasonDescription, this.lineNumber, this.lineType, this._supervisorOverrideLineReference, this.extendedAmount, this.extendedAmountExcludingTax, this.extendedAmountIncludingTax, this._copiedFromLineNumber);
|
|
129
|
+
return new ItemPriceChangeLine(this._changeLineNumber, this._price, this._reasonCode, this._reasonListType, this._reasonDescription, this.lineNumber, this.lineType, this._supervisorOverrideLineReference, this.extendedAmount, this.extendedAmountExcludingTax, this.extendedAmountIncludingTax, this._copiedFromLineNumber, this._superseded);
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
exports.ItemPriceChangeLine = ItemPriceChangeLine;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ITransactionLine, ITransactionLineFactory } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
import { BasePriceChangeLineDecorator } from "./BasePriceChangeLineDecorator";
|
|
3
|
+
import { ItemPriceChangeLine } from "./ItemPriceChangeLine";
|
|
4
|
+
export declare const DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE: string;
|
|
5
|
+
export declare class SupersededPriceChangeLineDecorator extends BasePriceChangeLineDecorator {
|
|
6
|
+
static createFromJsonObject(transactionLineJsonObj: any, transactionLineFactory: ITransactionLineFactory): SupersededPriceChangeLineDecorator;
|
|
7
|
+
constructor(priceChangeLine: ItemPriceChangeLine, annotationSourceType: string, annotationSourceLineNumber: number);
|
|
8
|
+
get superseded(): boolean;
|
|
9
|
+
protected newTransactionLine(): SupersededPriceChangeLineDecorator;
|
|
10
|
+
}
|
|
11
|
+
export declare function isSupersededPriceChangeLineDecorator(transactionLine: ITransactionLine): transactionLine is SupersededPriceChangeLineDecorator;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const BaseLineDecorator_1 = require("../BaseLineDecorator");
|
|
4
|
+
const BasePriceChangeLineDecorator_1 = require("./BasePriceChangeLineDecorator");
|
|
5
|
+
exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE = "SUPERSEDED_PRICE_CHANGE_LINE_DECORATOR";
|
|
6
|
+
class SupersededPriceChangeLineDecorator extends BasePriceChangeLineDecorator_1.BasePriceChangeLineDecorator {
|
|
7
|
+
static createFromJsonObject(transactionLineJsonObj, transactionLineFactory) {
|
|
8
|
+
const decoratedTransactionLineJsonObj = BaseLineDecorator_1.BaseLineDecorator.getDecoratedTransactionLineJsonObjectFromJsonObject(transactionLineJsonObj);
|
|
9
|
+
const decoratedPriceChangeLine = transactionLineFactory.createTransactionLineFromJsonObj(decoratedTransactionLineJsonObj);
|
|
10
|
+
const annotationSourceType = BaseLineDecorator_1.BaseLineDecorator.getAnnotationSourceTypeFromJsonObject(transactionLineJsonObj);
|
|
11
|
+
const annotationSourceLineNumber = BaseLineDecorator_1.BaseLineDecorator.getAnnotationSourceLineNumberFromJsonObject(transactionLineJsonObj);
|
|
12
|
+
const supersededPriceChangeLineDecorator = new SupersededPriceChangeLineDecorator(decoratedPriceChangeLine, annotationSourceType, annotationSourceLineNumber);
|
|
13
|
+
return supersededPriceChangeLineDecorator;
|
|
14
|
+
}
|
|
15
|
+
constructor(priceChangeLine, annotationSourceType, annotationSourceLineNumber) {
|
|
16
|
+
super(exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE, priceChangeLine, undefined, annotationSourceType, annotationSourceLineNumber);
|
|
17
|
+
}
|
|
18
|
+
get superseded() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
newTransactionLine() {
|
|
22
|
+
return new SupersededPriceChangeLineDecorator(this.decoratedTransactionLine, this.annotationSourceType, this.annotationSourceLineNumber);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.SupersededPriceChangeLineDecorator = SupersededPriceChangeLineDecorator;
|
|
26
|
+
function isSupersededPriceChangeLineDecorator(transactionLine) {
|
|
27
|
+
return (transactionLine.lineDecoratorType ===
|
|
28
|
+
exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE);
|
|
29
|
+
}
|
|
30
|
+
exports.isSupersededPriceChangeLineDecorator = isSupersededPriceChangeLineDecorator;
|
|
31
|
+
//# sourceMappingURL=SupersededPriceChangeLineDecorator.js.map
|
|
@@ -35,3 +35,4 @@ export * from "./ItemLineNonFinancialRewardDecorator";
|
|
|
35
35
|
export * from "./IAllLinePricingAdjustments";
|
|
36
36
|
export * from "./ISerializedPriceCalculationResultsWithSource";
|
|
37
37
|
export * from "./ItemLineExtensibilityFormDataDecorator";
|
|
38
|
+
export * from "./SupersededPriceChangeLineDecorator";
|
|
@@ -38,4 +38,5 @@ __export(require("./ItemLineTaxOverrideDecorator"));
|
|
|
38
38
|
__export(require("./ItemLineNonFinancialRewardDecorator"));
|
|
39
39
|
__export(require("./IAllLinePricingAdjustments"));
|
|
40
40
|
__export(require("./ItemLineExtensibilityFormDataDecorator"));
|
|
41
|
+
__export(require("./SupersededPriceChangeLineDecorator"));
|
|
41
42
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-scp/scp-component-store-selling-features-domain-model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.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",
|