@aptos-scp/scp-component-store-selling-features-domain-model 1.56.0 → 1.58.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/UIBusinessEventTypes.d.ts +1 -0
- package/lib/domain/UIBusinessEventTypes.js +1 -0
- package/lib/domain/model/TenderAuthorizationSession.d.ts +3 -0
- package/lib/domain/model/TenderAuthorizationSession.js +13 -1
- package/lib/domain/model/TenderControlTransaction.d.ts +3 -1
- package/lib/domain/model/TenderControlTransaction.js +11 -0
- package/lib/domain/model/configuration/ITaxBehaviorConfig.d.ts +1 -0
- package/package.json +5 -5
|
@@ -318,3 +318,4 @@ export declare const APPLY_ITEM_SEND_SALE_EVENT: string;
|
|
|
318
318
|
export declare const UPDATE_LINE_DISPLAY_EVENT: string;
|
|
319
319
|
export declare const AUTO_LOG_ON_EVENT: string;
|
|
320
320
|
export declare const TRANSACTION_VOID_RECOVER_RECEIPT_EVENT: string;
|
|
321
|
+
export declare const PAY_ON_ACCOUNT_EVENT: string;
|
|
@@ -325,4 +325,5 @@ exports.APPLY_ITEM_SEND_SALE_EVENT = "ApplyItemSendSale";
|
|
|
325
325
|
exports.UPDATE_LINE_DISPLAY_EVENT = "UpdateLineDisplay";
|
|
326
326
|
exports.AUTO_LOG_ON_EVENT = "AutoLogOn";
|
|
327
327
|
exports.TRANSACTION_VOID_RECOVER_RECEIPT_EVENT = "TransactionVoidRecoverReceipt";
|
|
328
|
+
exports.PAY_ON_ACCOUNT_EVENT = "PayOnAccount";
|
|
328
329
|
//# sourceMappingURL=UIBusinessEventTypes.js.map
|
|
@@ -10,6 +10,7 @@ export declare enum TenderAuthorizationState {
|
|
|
10
10
|
WaitingForCallforAuthorization = "WaitingForCallforAuthorization",
|
|
11
11
|
Completed = "Completed",
|
|
12
12
|
BalanceInquiryInProgress = "BalanceInquiryInProgress",
|
|
13
|
+
PayOnAccountInProgress = "PayOnAccountInProgress",
|
|
13
14
|
GiftCardIssueInProgress = "GiftCardIssueInProgress",
|
|
14
15
|
GiftCardRefundInProgress = "GiftCardRefundInProgress",
|
|
15
16
|
ManualEntryInProgress = "ManualEntryInProgress",
|
|
@@ -72,6 +73,7 @@ export declare class TenderAuthorizationSession implements IState {
|
|
|
72
73
|
get inCancelInProgress(): boolean;
|
|
73
74
|
get completed(): boolean;
|
|
74
75
|
get inBalanceInquiryInProgress(): boolean;
|
|
76
|
+
get inPayOnAccountInProgress(): boolean;
|
|
75
77
|
get inGiftCardIssueInProgress(): boolean;
|
|
76
78
|
get inGiftCardRefundInProgress(): boolean;
|
|
77
79
|
get inManualEntryInProgress(): boolean;
|
|
@@ -86,6 +88,7 @@ export declare class TenderAuthorizationSession implements IState {
|
|
|
86
88
|
startTenderVoid(lineNumber: number, tenderAuthCategory: TenderAuthCategory): TenderAuthorizationSession;
|
|
87
89
|
startManualEntry(lineNumber: number): TenderAuthorizationSession;
|
|
88
90
|
startBalanceInquiry(lineNumber: number): TenderAuthorizationSession;
|
|
91
|
+
startPayOnAccount(lineNumber: number): TenderAuthorizationSession;
|
|
89
92
|
startGiftCardIssue(lineNumber: number): TenderAuthorizationSession;
|
|
90
93
|
startGiftCardRefund(lineNumber: number): TenderAuthorizationSession;
|
|
91
94
|
startWaitingForPartialAuthorizationApproval(lineNumber: number): TenderAuthorizationSession;
|
|
@@ -13,6 +13,7 @@ var TenderAuthorizationState;
|
|
|
13
13
|
TenderAuthorizationState["WaitingForCallforAuthorization"] = "WaitingForCallforAuthorization";
|
|
14
14
|
TenderAuthorizationState["Completed"] = "Completed";
|
|
15
15
|
TenderAuthorizationState["BalanceInquiryInProgress"] = "BalanceInquiryInProgress";
|
|
16
|
+
TenderAuthorizationState["PayOnAccountInProgress"] = "PayOnAccountInProgress";
|
|
16
17
|
TenderAuthorizationState["GiftCardIssueInProgress"] = "GiftCardIssueInProgress";
|
|
17
18
|
TenderAuthorizationState["GiftCardRefundInProgress"] = "GiftCardRefundInProgress";
|
|
18
19
|
TenderAuthorizationState["ManualEntryInProgress"] = "ManualEntryInProgress";
|
|
@@ -43,6 +44,7 @@ const TenderAuthorizationStateNumericMap = {
|
|
|
43
44
|
9: "GiftCardRefundInProgress",
|
|
44
45
|
10: "TenderVoidInProgress",
|
|
45
46
|
11: "ManualEntryInProgress",
|
|
47
|
+
12: "PayOnAccountInProgress",
|
|
46
48
|
};
|
|
47
49
|
exports.TENDER_AUTH_SESSION = "TenderAuthSession";
|
|
48
50
|
class TenderAuthorizationSession {
|
|
@@ -177,6 +179,9 @@ class TenderAuthorizationSession {
|
|
|
177
179
|
get inBalanceInquiryInProgress() {
|
|
178
180
|
return this._state === TenderAuthorizationState.BalanceInquiryInProgress;
|
|
179
181
|
}
|
|
182
|
+
get inPayOnAccountInProgress() {
|
|
183
|
+
return this._state === TenderAuthorizationState.PayOnAccountInProgress;
|
|
184
|
+
}
|
|
180
185
|
get inGiftCardIssueInProgress() {
|
|
181
186
|
return this._state === TenderAuthorizationState.GiftCardIssueInProgress;
|
|
182
187
|
}
|
|
@@ -211,7 +216,8 @@ class TenderAuthorizationSession {
|
|
|
211
216
|
this.inProgress ||
|
|
212
217
|
this.inGiftCardRefundInProgress ||
|
|
213
218
|
this.inTokenRetrievalInProgress ||
|
|
214
|
-
this.inTenderVoidInProgress
|
|
219
|
+
this.inTenderVoidInProgress ||
|
|
220
|
+
this.inPayOnAccountInProgress);
|
|
215
221
|
}
|
|
216
222
|
startAuthorization(lineNumber, tenderAuthCategory) {
|
|
217
223
|
logger.traceEntry("startAuthorization");
|
|
@@ -246,6 +252,12 @@ class TenderAuthorizationSession {
|
|
|
246
252
|
? this
|
|
247
253
|
: new TenderAuthorizationSession(TenderAuthorizationState.BalanceInquiryInProgress, lineNumber, undefined, undefined);
|
|
248
254
|
}
|
|
255
|
+
startPayOnAccount(lineNumber) {
|
|
256
|
+
logger.traceEntry("startPayOnAccount");
|
|
257
|
+
return this.inPayOnAccountInProgress
|
|
258
|
+
? this
|
|
259
|
+
: new TenderAuthorizationSession(TenderAuthorizationState.PayOnAccountInProgress, lineNumber, undefined, undefined);
|
|
260
|
+
}
|
|
249
261
|
startGiftCardIssue(lineNumber) {
|
|
250
262
|
logger.traceEntry("startGiftCardIssue");
|
|
251
263
|
return this.inGiftCardIssueInProgress
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeviceIdentity, ITransaction, ITransactionLine, ITransactionLineFactory, IUser } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
+
import { IFiscalSignature } from "@aptos-scp/scp-types-commerce-transaction";
|
|
2
3
|
import { ITransactionReferenceFormatter } from "../service";
|
|
3
4
|
import { RetailTransaction } from "./RetailTransaction";
|
|
4
|
-
import { IFiscalSignature } from "@aptos-scp/scp-types-commerce-transaction";
|
|
5
5
|
import { IFiscalError } from "./MerchandiseTransaction";
|
|
6
6
|
export declare const TENDER_CONTROL_TRANSACTION_TYPE = "TenderControlTransaction";
|
|
7
7
|
export declare class TenderControlTransaction extends RetailTransaction {
|
|
@@ -20,7 +20,9 @@ export declare class TenderControlTransaction extends RetailTransaction {
|
|
|
20
20
|
get accountingCurrency(): string;
|
|
21
21
|
get referenceNumber(): string;
|
|
22
22
|
get isTenderExchangeTransaction(): boolean;
|
|
23
|
+
get isAccountPaymentTransaction(): boolean;
|
|
23
24
|
get isCompleteTenderExchangeTransaction(): boolean;
|
|
25
|
+
get isCompleteAccountPaymentTransaction(): boolean;
|
|
24
26
|
get transactionStateValues(): Readonly<Map<string, any>>;
|
|
25
27
|
get fiscalTransactionNumber(): string;
|
|
26
28
|
get fiscalSignature(): IFiscalSignature;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const scp_component_store_selling_core_1 = require("@aptos-scp/scp-component-store-selling-core");
|
|
4
|
+
const scp_types_commerce_transaction_1 = require("@aptos-scp/scp-types-commerce-transaction");
|
|
4
5
|
const config_1 = require("../../config");
|
|
5
6
|
const RetailTransaction_1 = require("./RetailTransaction");
|
|
6
7
|
const tender_1 = require("./tender");
|
|
@@ -68,17 +69,27 @@ class TenderControlTransaction extends RetailTransaction_1.RetailTransaction {
|
|
|
68
69
|
get isTenderExchangeTransaction() {
|
|
69
70
|
return !!(this.lines && this.lines.find(tender_1.isStartTenderExchangeLine));
|
|
70
71
|
}
|
|
72
|
+
get isAccountPaymentTransaction() {
|
|
73
|
+
var _a;
|
|
74
|
+
return !!((_a = this.lines) === null || _a === void 0 ? void 0 : _a.some((line) => tender_1.isTenderAuthorizationStatusLine(line) && line.status === scp_types_commerce_transaction_1.TenderAuthorizationStatus.PayOnAccountStarted));
|
|
75
|
+
}
|
|
71
76
|
get isCompleteTenderExchangeTransaction() {
|
|
72
77
|
return (this.isTenderExchangeTransaction &&
|
|
73
78
|
!!(this.lines.find((line) => tender_1.isTenderExchangeLine && line.lineType === tender_1.TENDER_EXCHANGE_IN_LINE_TYPE) &&
|
|
74
79
|
this.lines.find((line) => tender_1.isTenderExchangeLine && line.lineType === tender_1.TENDER_EXCHANGE_OUT_LINE_TYPE)));
|
|
75
80
|
}
|
|
81
|
+
get isCompleteAccountPaymentTransaction() {
|
|
82
|
+
return (this.isAccountPaymentTransaction &&
|
|
83
|
+
!!(this.lines.find((line) => tender_1.isTenderExchangeLine && line.lineType === tender_1.TENDER_EXCHANGE_IN_LINE_TYPE) &&
|
|
84
|
+
this.lines.find((line) => tender_1.isTenderExchangeLine && line.lineType === tender_1.TENDER_EXCHANGE_OUT_LINE_TYPE)));
|
|
85
|
+
}
|
|
76
86
|
get transactionStateValues() {
|
|
77
87
|
return new Map([
|
|
78
88
|
...super.transactionStateValues.entries(),
|
|
79
89
|
["transaction.referenceNumber", this._referenceNumber],
|
|
80
90
|
["transaction.accountingCurrency", this._accountingCurrency],
|
|
81
91
|
["transaction.isTenderExchangeTransaction", this.isTenderExchangeTransaction],
|
|
92
|
+
["transaction.isAccountPaymentTransaction", this.isAccountPaymentTransaction],
|
|
82
93
|
["transaction.fiscalError", this._fiscalError],
|
|
83
94
|
]);
|
|
84
95
|
}
|
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.58.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,8 +61,8 @@
|
|
|
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": "^
|
|
65
|
-
"@aptos-scp/scp-types-commerce-transaction": "^1.
|
|
64
|
+
"@aptos-scp/scp-types-commerce-devices": "^5.1.0",
|
|
65
|
+
"@aptos-scp/scp-types-commerce-transaction": "^1.77.0",
|
|
66
66
|
"@aptos-scp/scp-types-customer": "^3.7.0",
|
|
67
67
|
"@aptos-scp/scp-types-einvoice": "^1.17.0",
|
|
68
68
|
"@aptos-scp/scp-types-inventory": "^2.0.0",
|
|
@@ -83,8 +83,8 @@
|
|
|
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": "^
|
|
87
|
-
"@aptos-scp/scp-types-commerce-transaction": "^1.
|
|
86
|
+
"@aptos-scp/scp-types-commerce-devices": "^5.1.0",
|
|
87
|
+
"@aptos-scp/scp-types-commerce-transaction": "^1.77.0",
|
|
88
88
|
"@aptos-scp/scp-types-core": "^1.0.5",
|
|
89
89
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|
|
90
90
|
"@aptos-scp/scp-types-currency-conversion": "^1.2.0",
|