@aptos-scp/scp-component-store-selling-features-domain-model 2.24.0-patch.2 → 2.24.0-patch.7
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/README.md +1 -0
- package/lib/domain/model/Constants.d.ts +3 -1
- package/lib/domain/model/Constants.js +2 -0
- package/lib/domain/model/PaymentFunctionSession.d.ts +23 -0
- package/lib/domain/model/PaymentFunctionSession.js +51 -0
- package/lib/domain/model/TenderType.d.ts +2 -0
- package/lib/domain/model/TenderType.js +13 -3
- package/lib/domain/model/index.d.ts +1 -0
- package/lib/domain/model/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -703,6 +703,7 @@ export declare enum CollectedDataKey {
|
|
|
703
703
|
PaymentAccountHolderMismatchAction = "paymentAccountHolderMismatchAction",
|
|
704
704
|
PaymentAccountHolderValidationLineReference = "paymentAccountHolderValidationLineReference",
|
|
705
705
|
PaymentAccountLookupLineReference = "paymentAccountLookupLineReference",
|
|
706
|
+
PaymentFunction = "paymentFunction",
|
|
706
707
|
PaidOutReference = "paidOutReference",
|
|
707
708
|
PhoneNumber = "phoneNumber",
|
|
708
709
|
Percent = "percentage",
|
|
@@ -1101,7 +1102,8 @@ export declare enum PaymentFunction {
|
|
|
1101
1102
|
AccountSummaryDisplay = "AccountSummaryDisplay",
|
|
1102
1103
|
CustomerInput = "CustomerInput",
|
|
1103
1104
|
DonationPrompt = "DonationPrompt",
|
|
1104
|
-
TenderAuthorization = "TenderAuthorization"
|
|
1105
|
+
TenderAuthorization = "TenderAuthorization",
|
|
1106
|
+
OptInConfirmation = "OptInConfirmation"
|
|
1105
1107
|
}
|
|
1106
1108
|
export declare const DELIVERY_CONTACT_UPDATED_EVENT: string;
|
|
1107
1109
|
export declare const DELIVERY_ITEM_UPDATED_EVENT: string;
|
|
@@ -710,6 +710,7 @@ var CollectedDataKey;
|
|
|
710
710
|
CollectedDataKey["PaymentAccountHolderMismatchAction"] = "paymentAccountHolderMismatchAction";
|
|
711
711
|
CollectedDataKey["PaymentAccountHolderValidationLineReference"] = "paymentAccountHolderValidationLineReference";
|
|
712
712
|
CollectedDataKey["PaymentAccountLookupLineReference"] = "paymentAccountLookupLineReference";
|
|
713
|
+
CollectedDataKey["PaymentFunction"] = "paymentFunction";
|
|
713
714
|
CollectedDataKey["PaidOutReference"] = "paidOutReference";
|
|
714
715
|
CollectedDataKey["PhoneNumber"] = "phoneNumber";
|
|
715
716
|
CollectedDataKey["Percent"] = "percentage";
|
|
@@ -1109,6 +1110,7 @@ var PaymentFunction;
|
|
|
1109
1110
|
PaymentFunction["CustomerInput"] = "CustomerInput";
|
|
1110
1111
|
PaymentFunction["DonationPrompt"] = "DonationPrompt";
|
|
1111
1112
|
PaymentFunction["TenderAuthorization"] = "TenderAuthorization";
|
|
1113
|
+
PaymentFunction["OptInConfirmation"] = "OptInConfirmation";
|
|
1112
1114
|
})(PaymentFunction = exports.PaymentFunction || (exports.PaymentFunction = {}));
|
|
1113
1115
|
exports.DELIVERY_CONTACT_UPDATED_EVENT = "Delivery.ContactUpdated";
|
|
1114
1116
|
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
|
|
@@ -95,6 +95,7 @@ export declare class TenderType {
|
|
|
95
95
|
private _eligibleForTaxLottery?;
|
|
96
96
|
private _cashoutThreshold?;
|
|
97
97
|
static getActiveConfiguredTenders(container: Container, accountingCurrency: string): TenderType[];
|
|
98
|
+
static getAllConfiguredTenders(container: Container, accountingCurrency: string): TenderType[];
|
|
98
99
|
static getActiveRefundConfiguredTenders(container: Container, accountingCurrency: string, withTransaction: boolean, withOfflineTransaction: boolean): TenderType[];
|
|
99
100
|
static getActiveSuggestedRefundTenders(container: Container, accountingCurrency: string, withMappedTender?: boolean): TenderType[];
|
|
100
101
|
static getActiveConfiguredTenderGroups(container: Container, accountingCurrency: string, activeTenders: TenderType[]): ITenderGroup[];
|
|
@@ -152,6 +153,7 @@ export declare class TenderType {
|
|
|
152
153
|
get subscriptionEntryMethods(): EntryMethod[];
|
|
153
154
|
get cashoutThreshold(): Money;
|
|
154
155
|
private static getActiveTenders;
|
|
156
|
+
private static mapTenderDefinitionToTenderType;
|
|
155
157
|
private static filterActiveTenderIds;
|
|
156
158
|
private static tenderAuthCategoryIsActive;
|
|
157
159
|
private static tenderTypeIsActive;
|
|
@@ -72,6 +72,13 @@ class TenderType {
|
|
|
72
72
|
static getActiveConfiguredTenders(container, accountingCurrency) {
|
|
73
73
|
return TenderType.getActiveTenders(container, accountingCurrency, false, false, false, false);
|
|
74
74
|
}
|
|
75
|
+
static getAllConfiguredTenders(container, accountingCurrency) {
|
|
76
|
+
const configurationManager = container.get(scp_component_store_selling_core_1.DI_TYPES.IConfigurationManager);
|
|
77
|
+
const configuredTenders = configurationManager.getTendersValues().tenderDefinitions;
|
|
78
|
+
return configuredTenders
|
|
79
|
+
.filter((configuredTender) => configuredTender != null)
|
|
80
|
+
.map((configuredTender) => TenderType.mapTenderDefinitionToTenderType(configuredTender, accountingCurrency));
|
|
81
|
+
}
|
|
75
82
|
static getActiveRefundConfiguredTenders(container, accountingCurrency, withTransaction, withOfflineTransaction) {
|
|
76
83
|
return TenderType.getActiveTenders(container, accountingCurrency, true, withTransaction, false, false, withOfflineTransaction);
|
|
77
84
|
}
|
|
@@ -519,12 +526,15 @@ class TenderType {
|
|
|
519
526
|
const configuredTenders = configurationManager.getTendersValues().tenderDefinitions;
|
|
520
527
|
const activeTenders = configuredTenders
|
|
521
528
|
.filter((configuredTender) => tenderIsActive(configuredTender, isRefund, withTransaction, withReference, withMappedTender, withOfflineTransaction, accountingCurrency))
|
|
522
|
-
.map((configuredTender) =>
|
|
529
|
+
.map((configuredTender) => TenderType.mapTenderDefinitionToTenderType(configuredTender, accountingCurrency));
|
|
530
|
+
return activeTenders;
|
|
531
|
+
}
|
|
532
|
+
static mapTenderDefinitionToTenderType(configuredTender, accountingCurrency) {
|
|
533
|
+
return new TenderType(configuredTender.tenderId, configuredTender.tenderName, configuredTender.tenderType, Constants_1.TenderAuthCategory[configuredTender.tenderAuthCategory], configuredTender.additionalTenderAuthCategories, scp_types_commerce_devices_1.CardType[configuredTender.cardType], TenderSignatureCapturePolicy[configuredTender.signatureCapturePolicy], configuredTender.hasOwnProperty("signatureCaptureFloorLimit")
|
|
523
534
|
? new scp_component_business_core_1.Money(configuredTender.signatureCaptureFloorLimit, accountingCurrency)
|
|
524
535
|
: undefined, configuredTender.printDeclineTenderDetails, configuredTender.printDeclineTenderReceipt, configuredTender.printStoreTenderReceipt, configuredTender.allowPostVoid, configuredTender.allowCallForAuthorization !== false, configuredTender.allowRefund, configuredTender.pluralTenderName, configuredTender.fiscalCode, configuredTender.fiscalType, configuredTender.tenderLabel, configuredTender.actions, configuredTender.overTenderRule && Constants_1.OverTenderRule[configuredTender.overTenderRule], configuredTender.subType, configuredTender.customCardType, configuredTender.promptOnPartialApproval, configuredTender.pinRules, configuredTender.subscriptionEntryMethods, configuredTender.changeBehavior, configuredTender.isForeignTender, configuredTender.currencyCode, configuredTender.eligibleForTaxLottery, configuredTender.printVoidTenderDetails, configuredTender.printVoidTenderReceipt, configuredTender.hasOwnProperty("cashoutThreshold")
|
|
525
536
|
? new scp_component_business_core_1.Money(configuredTender.cashoutThreshold, accountingCurrency)
|
|
526
|
-
: undefined, TenderSignatureCapturePolicy[configuredTender.signatureCapturePolicyForCallForAuth])
|
|
527
|
-
return activeTenders;
|
|
537
|
+
: undefined, TenderSignatureCapturePolicy[configuredTender.signatureCapturePolicyForCallForAuth]);
|
|
528
538
|
}
|
|
529
539
|
static filterActiveTenderIds(tenderIds, configuredTenders, isRefund, withTransaction, withOfflineTransaction, accountingCurrency) {
|
|
530
540
|
return (tenderIds &&
|
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.24.0-patch.
|
|
3
|
+
"version": "2.24.0-patch.7",
|
|
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",
|