@aptos-scp/scp-component-store-selling-features-domain-model 2.24.0 → 2.26.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 +3 -0
- package/lib/domain/model/PaymentFunctionSession.d.ts +23 -0
- package/lib/domain/model/PaymentFunctionSession.js +51 -0
- package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.d.ts +4 -1
- package/lib/domain/model/fiscalDevice/FiscalDeviceStatusLine.js +10 -4
- package/lib/domain/model/index.d.ts +1 -0
- package/lib/domain/model/index.js +1 -0
- package/package.json +1 -1
|
@@ -575,6 +575,7 @@ export declare enum CollectedDataKey {
|
|
|
575
575
|
FiscalDeviceActivitySuccessful = "fiscalDeviceActivitySuccessful",
|
|
576
576
|
VoidedInProcessFlag = "voidedInProcessFlag",
|
|
577
577
|
FiscalDeviceInformation = "fiscalDeviceInformation",
|
|
578
|
+
FiscalDeviceAdditionalData = "fiscalDeviceAdditionalData",
|
|
578
579
|
FiscalTransactionInformation = "fiscalTransactionInformation",
|
|
579
580
|
FiscalVarianceInformation = "FiscalVarianceInformation",
|
|
580
581
|
FiscalDeviceErrorCode = "fiscalDeviceErrorCode",
|
|
@@ -695,6 +696,7 @@ export declare enum CollectedDataKey {
|
|
|
695
696
|
PaymentAccountHolderMismatchAction = "paymentAccountHolderMismatchAction",
|
|
696
697
|
PaymentAccountHolderValidationLineReference = "paymentAccountHolderValidationLineReference",
|
|
697
698
|
PaymentAccountLookupLineReference = "paymentAccountLookupLineReference",
|
|
699
|
+
PaymentFunction = "paymentFunction",
|
|
698
700
|
PaidOutReference = "paidOutReference",
|
|
699
701
|
PhoneNumber = "phoneNumber",
|
|
700
702
|
Percent = "percentage",
|
|
@@ -1093,7 +1095,8 @@ export declare enum PaymentFunction {
|
|
|
1093
1095
|
AccountSummaryDisplay = "AccountSummaryDisplay",
|
|
1094
1096
|
CustomerInput = "CustomerInput",
|
|
1095
1097
|
DonationPrompt = "DonationPrompt",
|
|
1096
|
-
TenderAuthorization = "TenderAuthorization"
|
|
1098
|
+
TenderAuthorization = "TenderAuthorization",
|
|
1099
|
+
OptInConfirmation = "OptInConfirmation"
|
|
1097
1100
|
}
|
|
1098
1101
|
export declare const DELIVERY_CONTACT_UPDATED_EVENT: string;
|
|
1099
1102
|
export declare const DELIVERY_ITEM_UPDATED_EVENT: string;
|
|
@@ -582,6 +582,7 @@ var CollectedDataKey;
|
|
|
582
582
|
CollectedDataKey["FiscalDeviceActivitySuccessful"] = "fiscalDeviceActivitySuccessful";
|
|
583
583
|
CollectedDataKey["VoidedInProcessFlag"] = "voidedInProcessFlag";
|
|
584
584
|
CollectedDataKey["FiscalDeviceInformation"] = "fiscalDeviceInformation";
|
|
585
|
+
CollectedDataKey["FiscalDeviceAdditionalData"] = "fiscalDeviceAdditionalData";
|
|
585
586
|
CollectedDataKey["FiscalTransactionInformation"] = "fiscalTransactionInformation";
|
|
586
587
|
CollectedDataKey["FiscalVarianceInformation"] = "FiscalVarianceInformation";
|
|
587
588
|
CollectedDataKey["FiscalDeviceErrorCode"] = "fiscalDeviceErrorCode";
|
|
@@ -702,6 +703,7 @@ var CollectedDataKey;
|
|
|
702
703
|
CollectedDataKey["PaymentAccountHolderMismatchAction"] = "paymentAccountHolderMismatchAction";
|
|
703
704
|
CollectedDataKey["PaymentAccountHolderValidationLineReference"] = "paymentAccountHolderValidationLineReference";
|
|
704
705
|
CollectedDataKey["PaymentAccountLookupLineReference"] = "paymentAccountLookupLineReference";
|
|
706
|
+
CollectedDataKey["PaymentFunction"] = "paymentFunction";
|
|
705
707
|
CollectedDataKey["PaidOutReference"] = "paidOutReference";
|
|
706
708
|
CollectedDataKey["PhoneNumber"] = "phoneNumber";
|
|
707
709
|
CollectedDataKey["Percent"] = "percentage";
|
|
@@ -1101,6 +1103,7 @@ var PaymentFunction;
|
|
|
1101
1103
|
PaymentFunction["CustomerInput"] = "CustomerInput";
|
|
1102
1104
|
PaymentFunction["DonationPrompt"] = "DonationPrompt";
|
|
1103
1105
|
PaymentFunction["TenderAuthorization"] = "TenderAuthorization";
|
|
1106
|
+
PaymentFunction["OptInConfirmation"] = "OptInConfirmation";
|
|
1104
1107
|
})(PaymentFunction = exports.PaymentFunction || (exports.PaymentFunction = {}));
|
|
1105
1108
|
exports.DELIVERY_CONTACT_UPDATED_EVENT = "Delivery.ContactUpdated";
|
|
1106
1109
|
exports.DELIVERY_ITEM_UPDATED_EVENT = "Delivery.ItemUpdated";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IState } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
import { PaymentFunction } from "./Constants";
|
|
3
|
+
export declare const PAYMENT_FUNCTION_SESSION: string;
|
|
4
|
+
export declare enum PaymentFunctionSessionState {
|
|
5
|
+
Completed = "Completed",
|
|
6
|
+
InProgress = "InProgress"
|
|
7
|
+
}
|
|
8
|
+
export declare class PaymentFunctionSession implements IState {
|
|
9
|
+
private readonly _type;
|
|
10
|
+
private readonly _state;
|
|
11
|
+
private readonly _deviceId;
|
|
12
|
+
private readonly _paymentFunction;
|
|
13
|
+
static createFromJsonObject(paymentFunctionSessionJsonObj: any): PaymentFunctionSession;
|
|
14
|
+
static create(): PaymentFunctionSession;
|
|
15
|
+
get type(): string;
|
|
16
|
+
get deviceId(): string | undefined;
|
|
17
|
+
get paymentFunction(): PaymentFunction | undefined;
|
|
18
|
+
get stateValues(): Readonly<Map<string, any>>;
|
|
19
|
+
get inProgress(): boolean;
|
|
20
|
+
startPaymentFunction(paymentFunction: PaymentFunction, deviceId: string): PaymentFunctionSession;
|
|
21
|
+
complete(): PaymentFunctionSession;
|
|
22
|
+
private constructor();
|
|
23
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAYMENT_FUNCTION_SESSION = "PaymentFunctionSession";
|
|
4
|
+
var PaymentFunctionSessionState;
|
|
5
|
+
(function (PaymentFunctionSessionState) {
|
|
6
|
+
PaymentFunctionSessionState["Completed"] = "Completed";
|
|
7
|
+
PaymentFunctionSessionState["InProgress"] = "InProgress";
|
|
8
|
+
})(PaymentFunctionSessionState = exports.PaymentFunctionSessionState || (exports.PaymentFunctionSessionState = {}));
|
|
9
|
+
class PaymentFunctionSession {
|
|
10
|
+
constructor(state, paymentFunction, deviceId) {
|
|
11
|
+
this._type = exports.PAYMENT_FUNCTION_SESSION;
|
|
12
|
+
this._state = state;
|
|
13
|
+
this._deviceId = deviceId;
|
|
14
|
+
this._paymentFunction = paymentFunction;
|
|
15
|
+
}
|
|
16
|
+
static createFromJsonObject(paymentFunctionSessionJsonObj) {
|
|
17
|
+
const state = paymentFunctionSessionJsonObj._state;
|
|
18
|
+
const deviceId = paymentFunctionSessionJsonObj._deviceId;
|
|
19
|
+
const paymentFunction = paymentFunctionSessionJsonObj._paymentFunction;
|
|
20
|
+
return new PaymentFunctionSession(state, paymentFunction, deviceId);
|
|
21
|
+
}
|
|
22
|
+
static create() {
|
|
23
|
+
return new PaymentFunctionSession(PaymentFunctionSessionState.Completed);
|
|
24
|
+
}
|
|
25
|
+
get type() {
|
|
26
|
+
return this._type;
|
|
27
|
+
}
|
|
28
|
+
get deviceId() {
|
|
29
|
+
return this._deviceId;
|
|
30
|
+
}
|
|
31
|
+
get paymentFunction() {
|
|
32
|
+
return this._paymentFunction;
|
|
33
|
+
}
|
|
34
|
+
get stateValues() {
|
|
35
|
+
return new Map([
|
|
36
|
+
["PaymentFunctionSession.state", this._state],
|
|
37
|
+
["PaymentFunctionSession.paymentFunction", this._paymentFunction],
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
get inProgress() {
|
|
41
|
+
return this._state === PaymentFunctionSessionState.InProgress;
|
|
42
|
+
}
|
|
43
|
+
startPaymentFunction(paymentFunction, deviceId) {
|
|
44
|
+
return new PaymentFunctionSession(PaymentFunctionSessionState.InProgress, paymentFunction, deviceId);
|
|
45
|
+
}
|
|
46
|
+
complete() {
|
|
47
|
+
return new PaymentFunctionSession(PaymentFunctionSessionState.Completed);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PaymentFunctionSession = PaymentFunctionSession;
|
|
51
|
+
//# sourceMappingURL=PaymentFunctionSession.js.map
|
|
@@ -2,6 +2,7 @@ import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-stor
|
|
|
2
2
|
import { IFiscalDeviceInformation, IFiscalTransactionInformation } from "@aptos-scp/scp-types-commerce-devices";
|
|
3
3
|
import { ITransactionLineReferenceType } from "@aptos-scp/scp-types-commerce-transaction";
|
|
4
4
|
import { IDeviceActivityResult } from "@aptos-scp/scp-types-commerce-transaction/lib/IDeviceActivityResult";
|
|
5
|
+
import { AdditionalData } from "@aptos-scp/scp-types-country-box";
|
|
5
6
|
import { BaseTransactionLine } from "../BaseTransactionLine";
|
|
6
7
|
export declare const FISCAL_DEVICE_STATUS_LINE_TYPE: string;
|
|
7
8
|
export declare class FiscalDeviceStatusLine extends BaseTransactionLine {
|
|
@@ -12,6 +13,7 @@ export declare class FiscalDeviceStatusLine extends BaseTransactionLine {
|
|
|
12
13
|
private _fiscalTransactionInformation?;
|
|
13
14
|
private _fiscalVarianceInformation?;
|
|
14
15
|
private _voidedInProcessFlag?;
|
|
16
|
+
private _fiscalDeviceAdditionalData?;
|
|
15
17
|
/**
|
|
16
18
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
17
19
|
* data collected during the qualification process.
|
|
@@ -32,8 +34,9 @@ export declare class FiscalDeviceStatusLine extends BaseTransactionLine {
|
|
|
32
34
|
get voidedInProcessFlag(): boolean;
|
|
33
35
|
get fiscalDeviceInformation(): IFiscalDeviceInformation;
|
|
34
36
|
get fiscalTransactionInformation(): IFiscalTransactionInformation;
|
|
37
|
+
get fiscalDeviceAdditionalData(): AdditionalData[];
|
|
35
38
|
get fiscalVarianceInformation(): IFiscalTransactionInformation;
|
|
36
|
-
protected constructor(lineNumber: number, lineType: string, peripheralDeviceId: string, fiscalDeviceActivityResult: IDeviceActivityResult, transactionLineReference?: ITransactionLineReferenceType, fiscalDeviceInformation?: IFiscalDeviceInformation, fiscalTransactionInformation?: IFiscalTransactionInformation, fiscalVarianceInformation?: IFiscalTransactionInformation, voidedInProcessFlag?: boolean);
|
|
39
|
+
protected constructor(lineNumber: number, lineType: string, peripheralDeviceId: string, fiscalDeviceActivityResult: IDeviceActivityResult, transactionLineReference?: ITransactionLineReferenceType, fiscalDeviceInformation?: IFiscalDeviceInformation, fiscalTransactionInformation?: IFiscalTransactionInformation, fiscalVarianceInformation?: IFiscalTransactionInformation, voidedInProcessFlag?: boolean, fiscalDeviceAdditionalData?: AdditionalData[]);
|
|
37
40
|
protected newTransactionLine(): BaseTransactionLine;
|
|
38
41
|
}
|
|
39
42
|
export declare function isFiscalDeviceStatusLine(transactionLine: ITransactionLine): transactionLine is FiscalDeviceStatusLine;
|
|
@@ -5,7 +5,7 @@ const Constants_1 = require("../Constants");
|
|
|
5
5
|
exports.FISCAL_DEVICE_STATUS_LINE_TYPE = "FiscalDeviceStatus";
|
|
6
6
|
class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
7
7
|
// Since the constructor is only called from the create methods it is made protected to prevent use by others.
|
|
8
|
-
constructor(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation, voidedInProcessFlag) {
|
|
8
|
+
constructor(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation, voidedInProcessFlag, fiscalDeviceAdditionalData) {
|
|
9
9
|
super(lineNumber, lineType);
|
|
10
10
|
this._peripheralDeviceId = peripheralDeviceId;
|
|
11
11
|
this._fiscalDeviceActivityResult = fiscalDeviceActivityResult;
|
|
@@ -14,6 +14,7 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
14
14
|
this._fiscalTransactionInformation = fiscalTransactionInformation;
|
|
15
15
|
this._fiscalVarianceInformation = fiscalVarianceInformation;
|
|
16
16
|
this._voidedInProcessFlag = voidedInProcessFlag;
|
|
17
|
+
this._fiscalDeviceAdditionalData = fiscalDeviceAdditionalData;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
@@ -46,7 +47,8 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
46
47
|
const fiscalTransactionInformation = collectedData.get(Constants_1.CollectedDataKey.FiscalTransactionInformation);
|
|
47
48
|
const fiscalVarianceInformation = collectedData.get(Constants_1.CollectedDataKey.FiscalVarianceInformation);
|
|
48
49
|
const voidedInProcessFlag = collectedData.get(Constants_1.CollectedDataKey.VoidedInProcessFlag);
|
|
49
|
-
const
|
|
50
|
+
const fiscalDeviceAdditionalData = collectedData.get(Constants_1.CollectedDataKey.FiscalDeviceAdditionalData);
|
|
51
|
+
const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation, voidedInProcessFlag, fiscalDeviceAdditionalData);
|
|
50
52
|
return fiscalDeviceStatusLine;
|
|
51
53
|
}
|
|
52
54
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
@@ -59,7 +61,8 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
59
61
|
const fiscalTransactionInformation = transactionLineJsonObj._fiscalTransactionInformation;
|
|
60
62
|
const fiscalVarianceInformation = transactionLineJsonObj._fiscalVarianceInformation;
|
|
61
63
|
const voidedInProcessFlag = transactionLineJsonObj._voidedInProcessFlag;
|
|
62
|
-
const
|
|
64
|
+
const fiscalDeviceAdditionalData = transactionLineJsonObj._fiscalDeviceAdditionalData;
|
|
65
|
+
const fiscalDeviceStatusLine = new FiscalDeviceStatusLine(lineNumber, lineType, peripheralDeviceId, fiscalDeviceActivityResult, transactionLineReference, fiscalDeviceInformation, fiscalTransactionInformation, fiscalVarianceInformation, voidedInProcessFlag, fiscalDeviceAdditionalData);
|
|
63
66
|
fiscalDeviceStatusLine.loadFromJsonObject(transactionLineJsonObj);
|
|
64
67
|
return fiscalDeviceStatusLine;
|
|
65
68
|
}
|
|
@@ -84,11 +87,14 @@ class FiscalDeviceStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
84
87
|
get fiscalTransactionInformation() {
|
|
85
88
|
return this._fiscalTransactionInformation;
|
|
86
89
|
}
|
|
90
|
+
get fiscalDeviceAdditionalData() {
|
|
91
|
+
return this._fiscalDeviceAdditionalData;
|
|
92
|
+
}
|
|
87
93
|
get fiscalVarianceInformation() {
|
|
88
94
|
return this._fiscalVarianceInformation;
|
|
89
95
|
}
|
|
90
96
|
newTransactionLine() {
|
|
91
|
-
return new FiscalDeviceStatusLine(this.lineNumber, this.lineType, this._peripheralDeviceId, this._fiscalDeviceActivityResult, this._transactionLineReference, this._fiscalDeviceInformation, this._fiscalTransactionInformation, this._fiscalVarianceInformation, this._voidedInProcessFlag);
|
|
97
|
+
return new FiscalDeviceStatusLine(this.lineNumber, this.lineType, this._peripheralDeviceId, this._fiscalDeviceActivityResult, this._transactionLineReference, this._fiscalDeviceInformation, this._fiscalTransactionInformation, this._fiscalVarianceInformation, this._voidedInProcessFlag, this._fiscalDeviceAdditionalData);
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
exports.FiscalDeviceStatusLine = FiscalDeviceStatusLine;
|
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.26.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",
|