@aptos-scp/scp-component-store-selling-features-domain-model 1.35.0 → 1.36.1
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/TenderHandlingSession.d.ts +2 -0
- package/lib/domain/model/TenderHandlingSession.js +9 -2
- 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
|
|
@@ -90,6 +90,7 @@ export declare class TenderHandlingSession implements IState {
|
|
|
90
90
|
complete(): TenderHandlingSession;
|
|
91
91
|
addOriginalTransaction(originalTransaction: TransactionWithAdditionalData, configuredTenders: IConfigurationValues): TenderHandlingSession;
|
|
92
92
|
updateOriginalTransactionDetails(originalTransactionDetails: IOriginalTransactionDetails, originalTransactionId: string): TenderHandlingSession;
|
|
93
|
+
clearOriginalTransactionDetails(originalTransactionId: string): TenderHandlingSession;
|
|
93
94
|
getReferencedOriginalTender(reference: IOriginalTransactionRefundReference): IOriginalTender;
|
|
94
95
|
getOriginalReferenceNumber(statusLine: TenderAuthorizationStatusLine): string;
|
|
95
96
|
getOriginalTenderReferenceLineSequenceNumber(reference: IOriginalTransactionRefundReference): number;
|
|
@@ -97,6 +98,7 @@ export declare class TenderHandlingSession implements IState {
|
|
|
97
98
|
get originalTransactionDetails(): IOriginalTransactionDetails[];
|
|
98
99
|
get inProgress(): boolean;
|
|
99
100
|
private constructor();
|
|
101
|
+
private filterOutTransactionDetails;
|
|
100
102
|
}
|
|
101
103
|
export declare function originalTenderHasOriginalLineNumber(originalTender: IOriginalTender, lineNumber: number): boolean;
|
|
102
104
|
export declare function getOriginalTransactionReferences(transactionId: string, originalLineReferences: IOriginalLineReference[]): IOriginalTransactionRefundReference[];
|
|
@@ -54,11 +54,14 @@ class TenderHandlingSession {
|
|
|
54
54
|
return new TenderHandlingSession(TenderHandlingSessionState.InProgress, originalTransactionDetails);
|
|
55
55
|
}
|
|
56
56
|
updateOriginalTransactionDetails(originalTransactionDetails, originalTransactionId) {
|
|
57
|
-
const originalTransactionsDetails = this.
|
|
58
|
-
this._originalTransactionDetails.filter((origDetails) => origDetails.originalTransactionId !== originalTransactionId);
|
|
57
|
+
const originalTransactionsDetails = this.filterOutTransactionDetails(originalTransactionId);
|
|
59
58
|
originalTransactionsDetails.push(originalTransactionDetails);
|
|
60
59
|
return new TenderHandlingSession(TenderHandlingSessionState.InProgress, originalTransactionsDetails);
|
|
61
60
|
}
|
|
61
|
+
clearOriginalTransactionDetails(originalTransactionId) {
|
|
62
|
+
const originalTransactionsDetails = this.filterOutTransactionDetails(originalTransactionId);
|
|
63
|
+
return new TenderHandlingSession(TenderHandlingSessionState.InProgress, originalTransactionsDetails);
|
|
64
|
+
}
|
|
62
65
|
getReferencedOriginalTender(reference) {
|
|
63
66
|
var _a, _b, _c;
|
|
64
67
|
if (reference) {
|
|
@@ -96,6 +99,10 @@ class TenderHandlingSession {
|
|
|
96
99
|
get inProgress() {
|
|
97
100
|
return this._state === TenderHandlingSessionState.InProgress;
|
|
98
101
|
}
|
|
102
|
+
filterOutTransactionDetails(originalTransactionId) {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_a = this._originalTransactionDetails) === null || _a === void 0 ? void 0 : _a.filter((origDetails) => origDetails.originalTransactionId !== originalTransactionId);
|
|
105
|
+
}
|
|
99
106
|
}
|
|
100
107
|
exports.TenderHandlingSession = TenderHandlingSession;
|
|
101
108
|
function originalTenderHasOriginalLineNumber(originalTender, lineNumber) {
|
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.1",
|
|
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",
|