@aptos-scp/scp-component-store-selling-features-domain-model 1.54.0 → 1.55.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 +4 -1
- package/lib/domain/model/Constants.js +1 -0
- package/lib/domain/model/account/IPaymentAccountLookupLine.d.ts +2 -0
- package/lib/domain/model/account/PaymentAccountLookupLine.d.ts +5 -2
- package/lib/domain/model/account/PaymentAccountLookupLine.js +16 -9
- package/lib/domain/model/account/PaymentAccountSession.d.ts +21 -0
- package/lib/domain/model/account/PaymentAccountSession.js +48 -0
- package/lib/domain/model/account/index.d.ts +1 -0
- package/lib/domain/model/account/index.js +1 -0
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Quantity } from "@aptos-scp/scp-component-business-core";
|
|
2
|
+
import { EntryMethod } from "@aptos-scp/scp-types-commerce-devices";
|
|
2
3
|
export interface ILabel {
|
|
3
4
|
i18nCode?: string;
|
|
4
5
|
default?: string;
|
|
@@ -130,6 +131,7 @@ export declare enum UiInputKey {
|
|
|
130
131
|
EMPLOYEE_DISCOUNT_OVERRIDE = "input_employeeDiscountOverride",
|
|
131
132
|
EXCHANGE_RATE_VALUE = "input_exchangeRateValue",
|
|
132
133
|
EMPLOYEE_ID = "input_employeeId",
|
|
134
|
+
ENTRY_METHOD = "input_entryMethod",
|
|
133
135
|
EXEMPTED_TAX_AUTHORITIES = "input_exemptedTaxAuthorities",
|
|
134
136
|
EXISTING_GIFT_CARD = "input_existingGiftCard",
|
|
135
137
|
EXPIRED_COUPON_OVERRIDE = "input_expiredCouponOverride",
|
|
@@ -1048,6 +1050,7 @@ export declare enum AssignCustomerForReturnAction {
|
|
|
1048
1050
|
export declare const DELIVERY_CONTACT_UPDATED_EVENT: string;
|
|
1049
1051
|
export declare const PAYMENT_ACCOUNT_LOOKUP_EVENT: string;
|
|
1050
1052
|
export interface IPaymentAccountLookupEventData {
|
|
1051
|
-
|
|
1053
|
+
deviceId: string;
|
|
1054
|
+
entryMethod?: EntryMethod;
|
|
1052
1055
|
}
|
|
1053
1056
|
export declare const DELIVERY_SHIPPING_FEE_UPDATED_EVENT: string;
|
|
@@ -133,6 +133,7 @@ var UiInputKey;
|
|
|
133
133
|
UiInputKey["EMPLOYEE_DISCOUNT_OVERRIDE"] = "input_employeeDiscountOverride";
|
|
134
134
|
UiInputKey["EXCHANGE_RATE_VALUE"] = "input_exchangeRateValue";
|
|
135
135
|
UiInputKey["EMPLOYEE_ID"] = "input_employeeId";
|
|
136
|
+
UiInputKey["ENTRY_METHOD"] = "input_entryMethod";
|
|
136
137
|
UiInputKey["EXEMPTED_TAX_AUTHORITIES"] = "input_exemptedTaxAuthorities";
|
|
137
138
|
UiInputKey["EXISTING_GIFT_CARD"] = "input_existingGiftCard";
|
|
138
139
|
UiInputKey["EXPIRED_COUPON_OVERRIDE"] = "input_expiredCouponOverride";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IMoney } from "@aptos-scp/scp-component-business-core";
|
|
1
2
|
import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
3
|
import { ICardHolder } from "@aptos-scp/scp-types-commerce-devices";
|
|
3
4
|
import { PaymentAccountLookupResult } from "@aptos-scp/scp-types-commerce-transaction";
|
|
@@ -9,4 +10,5 @@ export interface IPaymentAccountLookupLine extends ITransactionLine {
|
|
|
9
10
|
readonly cardToken?: string;
|
|
10
11
|
readonly referenceNumber?: string;
|
|
11
12
|
readonly authorizationDeviceId?: string;
|
|
13
|
+
readonly accountBalance?: IMoney;
|
|
12
14
|
}
|
|
@@ -3,6 +3,7 @@ import { PaymentAccountLookupResult } from "@aptos-scp/scp-types-commerce-transa
|
|
|
3
3
|
import { ICardHolder, ResponseCodes } from "@aptos-scp/scp-types-commerce-devices";
|
|
4
4
|
import { BaseTransactionLine } from "../BaseTransactionLine";
|
|
5
5
|
import { IPaymentAccountLookupLine } from "./IPaymentAccountLookupLine";
|
|
6
|
+
import { IMoney } from "@aptos-scp/scp-component-business-core";
|
|
6
7
|
export declare const PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE: string;
|
|
7
8
|
export declare class PaymentAccountLookupLine extends BaseTransactionLine implements IPaymentAccountLookupLine {
|
|
8
9
|
private readonly _cardHolder;
|
|
@@ -12,6 +13,7 @@ export declare class PaymentAccountLookupLine extends BaseTransactionLine implem
|
|
|
12
13
|
private readonly _cardToken?;
|
|
13
14
|
private readonly _referenceNumber?;
|
|
14
15
|
private readonly _authorizationDeviceId?;
|
|
16
|
+
private readonly _accountBalance?;
|
|
15
17
|
static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): PaymentAccountLookupLine;
|
|
16
18
|
static createFromJsonObject(transactionLineJsonObj: any): PaymentAccountLookupLine;
|
|
17
19
|
get couldAffectPricing(): boolean;
|
|
@@ -22,8 +24,9 @@ export declare class PaymentAccountLookupLine extends BaseTransactionLine implem
|
|
|
22
24
|
get cardToken(): string;
|
|
23
25
|
get referenceNumber(): string;
|
|
24
26
|
get authorizationDeviceId(): string;
|
|
25
|
-
|
|
27
|
+
get accountBalance(): IMoney;
|
|
28
|
+
protected constructor(lineNumber: number, lineType: string, cardHolder: ICardHolder, lookupResult?: PaymentAccountLookupResult, lookupResultReason?: string, accountNumber?: string, cardToken?: string, referenceNumber?: string, authorizationDeviceId?: string, accountBalance?: IMoney);
|
|
26
29
|
protected newTransactionLine(): PaymentAccountLookupLine;
|
|
27
30
|
}
|
|
28
|
-
export declare function
|
|
31
|
+
export declare function isPaymentAccountLookupLine(transactionLine: ITransactionLine): transactionLine is PaymentAccountLookupLine;
|
|
29
32
|
export declare function convertLookupResultToResponseCode(lookupResult: PaymentAccountLookupResult): ResponseCodes;
|
|
@@ -6,7 +6,7 @@ const BaseTransactionLine_1 = require("../BaseTransactionLine");
|
|
|
6
6
|
const Constants_1 = require("../Constants");
|
|
7
7
|
exports.PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE = "PaymentAccountLookup";
|
|
8
8
|
class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
9
|
-
constructor(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId) {
|
|
9
|
+
constructor(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance) {
|
|
10
10
|
super(lineNumber, lineType);
|
|
11
11
|
this._cardHolder = cardHolder;
|
|
12
12
|
this._lookupResult = lookupResult;
|
|
@@ -15,9 +15,10 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
|
|
|
15
15
|
this._cardToken = cardToken;
|
|
16
16
|
this._referenceNumber = referenceNumber;
|
|
17
17
|
this._authorizationDeviceId = authorizationDeviceId;
|
|
18
|
+
this._accountBalance = accountBalance;
|
|
18
19
|
}
|
|
19
20
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f;
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
22
|
const accountLookupResponse = collectedData.get(Constants_1.CollectedDataKey.TenderAuthResponse);
|
|
22
23
|
const lookupResult = convertResponseCodeToLookupResult((_a = accountLookupResponse) === null || _a === void 0 ? void 0 : _a.responseCode);
|
|
23
24
|
const lookupResultReason = (_b = accountLookupResponse) === null || _b === void 0 ? void 0 : _b.status;
|
|
@@ -25,8 +26,9 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
|
|
|
25
26
|
const accountNumber = (_d = accountLookupResponse) === null || _d === void 0 ? void 0 : _d.cardNumber;
|
|
26
27
|
const cardToken = (_e = accountLookupResponse) === null || _e === void 0 ? void 0 : _e.cardToken;
|
|
27
28
|
const referenceNumber = (_f = accountLookupResponse) === null || _f === void 0 ? void 0 : _f.referenceNumber;
|
|
29
|
+
const accountBalance = (_g = accountLookupResponse) === null || _g === void 0 ? void 0 : _g.balance;
|
|
28
30
|
const authorizationDeviceId = collectedData.get(Constants_1.CollectedDataKey.AuthorizationDeviceId);
|
|
29
|
-
return new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId);
|
|
31
|
+
return new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance);
|
|
30
32
|
}
|
|
31
33
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
32
34
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
@@ -38,7 +40,8 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
|
|
|
38
40
|
const cardToken = transactionLineJsonObj._cardToken;
|
|
39
41
|
const referenceNumber = transactionLineJsonObj._referenceNumber;
|
|
40
42
|
const authorizationDeviceId = transactionLineJsonObj._authorizationDeviceId;
|
|
41
|
-
const
|
|
43
|
+
const accountBalance = transactionLineJsonObj._accountBalance;
|
|
44
|
+
const accountLookupLine = new PaymentAccountLookupLine(lineNumber, lineType, cardHolder, lookupResult, lookupResultReason, accountNumber, cardToken, referenceNumber, authorizationDeviceId, accountBalance);
|
|
42
45
|
accountLookupLine.loadFromJsonObject(transactionLineJsonObj);
|
|
43
46
|
return accountLookupLine;
|
|
44
47
|
}
|
|
@@ -66,16 +69,20 @@ class PaymentAccountLookupLine extends BaseTransactionLine_1.BaseTransactionLine
|
|
|
66
69
|
get authorizationDeviceId() {
|
|
67
70
|
return this._authorizationDeviceId;
|
|
68
71
|
}
|
|
72
|
+
get accountBalance() {
|
|
73
|
+
return this._accountBalance;
|
|
74
|
+
}
|
|
69
75
|
newTransactionLine() {
|
|
70
|
-
return new PaymentAccountLookupLine(this.lineNumber, this.lineType, this._cardHolder, this._lookupResult, this._lookupResultReason, this._accountNumber, this._cardToken, this._referenceNumber, this._authorizationDeviceId);
|
|
76
|
+
return new PaymentAccountLookupLine(this.lineNumber, this.lineType, this._cardHolder, this._lookupResult, this._lookupResultReason, this._accountNumber, this._cardToken, this._referenceNumber, this._authorizationDeviceId, this._accountBalance);
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
exports.PaymentAccountLookupLine = PaymentAccountLookupLine;
|
|
74
|
-
function
|
|
75
|
-
return (transactionLine
|
|
76
|
-
transactionLine
|
|
80
|
+
function isPaymentAccountLookupLine(transactionLine) {
|
|
81
|
+
return (transactionLine &&
|
|
82
|
+
(transactionLine instanceof PaymentAccountLookupLine ||
|
|
83
|
+
transactionLine.lineType === exports.PAYMENT_ACCOUNT_LOOKUP_LINE_TYPE));
|
|
77
84
|
}
|
|
78
|
-
exports.
|
|
85
|
+
exports.isPaymentAccountLookupLine = isPaymentAccountLookupLine;
|
|
79
86
|
function convertResponseCodeToLookupResult(responseCode) {
|
|
80
87
|
switch (responseCode) {
|
|
81
88
|
case scp_types_commerce_devices_1.ResponseCodes.Approved:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IState } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
export declare const PAYMENT_ACCOUNT_SESSION: string;
|
|
3
|
+
export declare enum PaymentAccountSessionState {
|
|
4
|
+
Completed = "Completed",
|
|
5
|
+
LookupInProgress = "LookupInProgress"
|
|
6
|
+
}
|
|
7
|
+
export declare class PaymentAccountSession implements IState {
|
|
8
|
+
private readonly _type;
|
|
9
|
+
private readonly _state;
|
|
10
|
+
private readonly _deviceId;
|
|
11
|
+
static createFromJsonObject(paymentAccountSessionJsonObj: any): PaymentAccountSession;
|
|
12
|
+
static create(): PaymentAccountSession;
|
|
13
|
+
get type(): string;
|
|
14
|
+
get deviceId(): string | undefined;
|
|
15
|
+
get stateValues(): Readonly<Map<string, any>>;
|
|
16
|
+
complete(): PaymentAccountSession;
|
|
17
|
+
get inProgress(): boolean;
|
|
18
|
+
get inLookupInProgress(): boolean;
|
|
19
|
+
startLookup(deviceId: string): PaymentAccountSession;
|
|
20
|
+
private constructor();
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAYMENT_ACCOUNT_SESSION = "PaymentAccountSession";
|
|
4
|
+
var PaymentAccountSessionState;
|
|
5
|
+
(function (PaymentAccountSessionState) {
|
|
6
|
+
PaymentAccountSessionState["Completed"] = "Completed";
|
|
7
|
+
PaymentAccountSessionState["LookupInProgress"] = "LookupInProgress";
|
|
8
|
+
})(PaymentAccountSessionState = exports.PaymentAccountSessionState || (exports.PaymentAccountSessionState = {}));
|
|
9
|
+
class PaymentAccountSession {
|
|
10
|
+
constructor(state, deviceId) {
|
|
11
|
+
this._type = "PaymentAccountSession";
|
|
12
|
+
this._state = state;
|
|
13
|
+
this._deviceId = deviceId;
|
|
14
|
+
}
|
|
15
|
+
static createFromJsonObject(paymentAccountSessionJsonObj) {
|
|
16
|
+
const state = paymentAccountSessionJsonObj._state;
|
|
17
|
+
const deviceId = paymentAccountSessionJsonObj._deviceId;
|
|
18
|
+
return new PaymentAccountSession(state, deviceId);
|
|
19
|
+
}
|
|
20
|
+
static create() {
|
|
21
|
+
return new PaymentAccountSession(PaymentAccountSessionState.Completed);
|
|
22
|
+
}
|
|
23
|
+
get type() {
|
|
24
|
+
return this._type;
|
|
25
|
+
}
|
|
26
|
+
get deviceId() {
|
|
27
|
+
return this._deviceId;
|
|
28
|
+
}
|
|
29
|
+
get stateValues() {
|
|
30
|
+
return new Map([["PaymentAccountSession.state", this._state]]);
|
|
31
|
+
}
|
|
32
|
+
complete() {
|
|
33
|
+
return new PaymentAccountSession(PaymentAccountSessionState.Completed);
|
|
34
|
+
}
|
|
35
|
+
get inProgress() {
|
|
36
|
+
return this._state === PaymentAccountSessionState.LookupInProgress;
|
|
37
|
+
}
|
|
38
|
+
get inLookupInProgress() {
|
|
39
|
+
return this._state === PaymentAccountSessionState.LookupInProgress;
|
|
40
|
+
}
|
|
41
|
+
startLookup(deviceId) {
|
|
42
|
+
return this.inLookupInProgress
|
|
43
|
+
? this
|
|
44
|
+
: new PaymentAccountSession(PaymentAccountSessionState.LookupInProgress, deviceId);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.PaymentAccountSession = PaymentAccountSession;
|
|
48
|
+
//# sourceMappingURL=PaymentAccountSession.js.map
|
|
@@ -4,5 +4,6 @@ function __export(m) {
|
|
|
4
4
|
}
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
__export(require("./PaymentAccountLookupLine"));
|
|
7
|
+
__export(require("./PaymentAccountSession"));
|
|
7
8
|
__export(require("./PaymentAccountHolderValidationLine"));
|
|
8
9
|
//# 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.55.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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@aptos-scp/scp-component-user": "^1.4.0",
|
|
62
62
|
"@aptos-scp/scp-types-client-registration": "^1.4.0",
|
|
63
63
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|
|
64
|
-
"@aptos-scp/scp-types-commerce-devices": "^
|
|
64
|
+
"@aptos-scp/scp-types-commerce-devices": "^4.1.0",
|
|
65
65
|
"@aptos-scp/scp-types-commerce-transaction": "^1.75.0",
|
|
66
66
|
"@aptos-scp/scp-types-customer": "^3.7.0",
|
|
67
67
|
"@aptos-scp/scp-types-einvoice": "^1.17.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@aptos-scp/scp-component-taxation": "^5.27.3",
|
|
84
84
|
"@aptos-scp/scp-component-user": "^1.4.0",
|
|
85
85
|
"@aptos-scp/scp-types-client-registration": "^1.4.0",
|
|
86
|
-
"@aptos-scp/scp-types-commerce-devices": "^
|
|
86
|
+
"@aptos-scp/scp-types-commerce-devices": "^4.1.0",
|
|
87
87
|
"@aptos-scp/scp-types-commerce-transaction": "^1.75.0",
|
|
88
88
|
"@aptos-scp/scp-types-core": "^1.0.5",
|
|
89
89
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|