@aptos-scp/scp-component-store-selling-features-domain-model 2.19.3 → 2.20.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/UIBusinessEventTypes.d.ts +1 -0
- package/lib/domain/UIBusinessEventTypes.js +1 -0
- package/lib/domain/model/Constants.d.ts +2 -0
- package/lib/domain/model/Constants.js +2 -0
- package/lib/domain/model/TenderType.d.ts +1 -1
- package/lib/domain/model/TenderType.js +2 -2
- package/lib/domain/model/discounts/RewardCardDiscountLineDecorator.d.ts +1 -0
- package/lib/domain/model/discounts/RewardCardDiscountLineDecorator.js +2 -2
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.d.ts +3 -1
- package/lib/domain/model/tender/TenderAuthorizationStatusLine.js +10 -4
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ export declare const REWARD_CARD_DISCOUNT_EVENT: string;
|
|
|
79
79
|
export declare const RESET_REWARD_CARD_BALANCE_INQUIRY_EVENT: string;
|
|
80
80
|
export declare const APPLY_REWARD_CARD_EVENT: string;
|
|
81
81
|
export declare const VOID_REWARD_CARD_EVENT: string;
|
|
82
|
+
export declare const REMOVE_REWARD_CARD_AUTHORIZATION_EVENT: string;
|
|
82
83
|
export declare const APPLY_EMPLOYEE_CUSTOMER_DISCOUNT_EVENT = "ApplyEmployeeCustomerDiscount";
|
|
83
84
|
export declare const MODIFY_EMPLOYEE_MANUAL_DISCOUNT_EVENT: string;
|
|
84
85
|
export declare const MODIFY_ITEM_MANUAL_DISCOUNT_EVENT: string;
|
|
@@ -82,6 +82,7 @@ exports.REWARD_CARD_DISCOUNT_EVENT = "RewardCardDiscount";
|
|
|
82
82
|
exports.RESET_REWARD_CARD_BALANCE_INQUIRY_EVENT = "ResetRewardCardBalanceInquiryDiscount";
|
|
83
83
|
exports.APPLY_REWARD_CARD_EVENT = "ApplyRewardCard";
|
|
84
84
|
exports.VOID_REWARD_CARD_EVENT = "VoidRewardCard";
|
|
85
|
+
exports.REMOVE_REWARD_CARD_AUTHORIZATION_EVENT = "RemoveRewardCardAuthorization";
|
|
85
86
|
exports.APPLY_EMPLOYEE_CUSTOMER_DISCOUNT_EVENT = "ApplyEmployeeCustomerDiscount";
|
|
86
87
|
exports.MODIFY_EMPLOYEE_MANUAL_DISCOUNT_EVENT = "ModifyEmployeeManualDiscount";
|
|
87
88
|
exports.MODIFY_ITEM_MANUAL_DISCOUNT_EVENT = "ModifyItemManualDiscount";
|
|
@@ -101,6 +101,7 @@ export declare enum UiInputKey {
|
|
|
101
101
|
ASSIGN_TO_TRANSACTION = "input_assignToTransaction",
|
|
102
102
|
AUTHORIZATION_DEVICE_ID = "input_authorizationDeviceId",
|
|
103
103
|
AMOUNT_DUE = "input_amountDue",
|
|
104
|
+
AUTO_APPLIED = "input_autoApplied",
|
|
104
105
|
BUSINESS_DAY_DATE = "input_businessDayDate",
|
|
105
106
|
SAME_AS_BILLTO = "input_sameAsBillTo",
|
|
106
107
|
BILLING = "input_billing",
|
|
@@ -630,6 +631,7 @@ export declare enum CollectedDataKey {
|
|
|
630
631
|
RewardPrintedNumberLabel = "rewardPrintedNumberLabel",
|
|
631
632
|
AutoPopulateCardNumberFromCustomer = "autoPopulateCardNumberFromCustomer",
|
|
632
633
|
RewardCardName = "rewardCardName",
|
|
634
|
+
RewardCardAutoApplied = "RewardCardAutoApplied",
|
|
633
635
|
IsCompetitivePriceDiscount = "isCompetitivePriceDiscount",
|
|
634
636
|
NextTransactionNumber = "nextTransactionNumber",
|
|
635
637
|
Offline = "offline",
|
|
@@ -102,6 +102,7 @@ var UiInputKey;
|
|
|
102
102
|
UiInputKey["ASSIGN_TO_TRANSACTION"] = "input_assignToTransaction";
|
|
103
103
|
UiInputKey["AUTHORIZATION_DEVICE_ID"] = "input_authorizationDeviceId";
|
|
104
104
|
UiInputKey["AMOUNT_DUE"] = "input_amountDue";
|
|
105
|
+
UiInputKey["AUTO_APPLIED"] = "input_autoApplied";
|
|
105
106
|
UiInputKey["BUSINESS_DAY_DATE"] = "input_businessDayDate";
|
|
106
107
|
UiInputKey["SAME_AS_BILLTO"] = "input_sameAsBillTo";
|
|
107
108
|
UiInputKey["BILLING"] = "input_billing";
|
|
@@ -637,6 +638,7 @@ var CollectedDataKey;
|
|
|
637
638
|
CollectedDataKey["RewardPrintedNumberLabel"] = "rewardPrintedNumberLabel";
|
|
638
639
|
CollectedDataKey["AutoPopulateCardNumberFromCustomer"] = "autoPopulateCardNumberFromCustomer";
|
|
639
640
|
CollectedDataKey["RewardCardName"] = "rewardCardName";
|
|
641
|
+
CollectedDataKey["RewardCardAutoApplied"] = "RewardCardAutoApplied";
|
|
640
642
|
CollectedDataKey["IsCompetitivePriceDiscount"] = "isCompetitivePriceDiscount";
|
|
641
643
|
CollectedDataKey["NextTransactionNumber"] = "nextTransactionNumber";
|
|
642
644
|
CollectedDataKey["Offline"] = "offline";
|
|
@@ -164,7 +164,7 @@ export declare class TenderType {
|
|
|
164
164
|
export declare function combineOriginalUnreferencedAndMappedTenders(tender: IOriginalTender, unreferencedAndMappedTenders: IOriginalTender[]): void;
|
|
165
165
|
export declare function getConfiguredTender(originalTenderId: string, configurationManager: IConfigurationManager): any;
|
|
166
166
|
export declare function getAllRefundableCardTypes(tenderTypeBehavior: any): string[];
|
|
167
|
-
export declare function getMappedCardTypeNames(
|
|
167
|
+
export declare function getMappedCardTypeNames(tenderConfig: any, refundCardTypes: any): string[];
|
|
168
168
|
export declare function getActiveTendersByConfiguredPaymentRestrictions(activeTenderTypes: TenderType[], saleItemTypes: string[], diContainer: Container, orderTypes?: string[], productAttributeTypes?: string[]): TenderType[];
|
|
169
169
|
export declare function getRefundableTendersByPaymentRestrictions(originalRefundableTenders: IOriginalTender[], saleItemTypes: string[], diContainer: Container, orderTypes?: string[], productAttributeTypes?: string[]): IOriginalTender[];
|
|
170
170
|
export declare function getSaleItemTypes(transaction: MerchandiseTransaction): string[];
|
|
@@ -794,7 +794,7 @@ function getConfiguredMappedTenders(originalTender, configurationManager, transa
|
|
|
794
794
|
if (!_.isEmpty(cardTypeExceptionsForOriginalTender)) {
|
|
795
795
|
refundTenderTypes = cardTypeExceptionsForOriginalTender.refundTenderTypes;
|
|
796
796
|
refundCardTypes = cardTypeExceptionsForOriginalTender.refundCardTypes;
|
|
797
|
-
const mappedCardTypeNames = getMappedCardTypeNames(
|
|
797
|
+
const mappedCardTypeNames = getMappedCardTypeNames(tenderConfig, refundCardTypes);
|
|
798
798
|
excludeCardTypes = mappedCardTypeNames;
|
|
799
799
|
addCardTypeTendersToMappedTenders(mappedCardTypeNames, tenderDefinitions, mappedTenders, originalTender, transactionId, originalTransactions);
|
|
800
800
|
}
|
|
@@ -878,7 +878,7 @@ function getMappedTenderTypeNames(originalTender, tenderConfig, originalTransact
|
|
|
878
878
|
isOriginalTenderAmountAllowed(originalTender, mappedRefundTenderType, originalTransactions, refundDue));
|
|
879
879
|
}));
|
|
880
880
|
}
|
|
881
|
-
function getMappedCardTypeNames(
|
|
881
|
+
function getMappedCardTypeNames(tenderConfig, refundCardTypes) {
|
|
882
882
|
return (refundCardTypes &&
|
|
883
883
|
Object.keys(refundCardTypes).filter((cardType) => {
|
|
884
884
|
const mappedRefundCardType = refundCardTypes[cardType];
|
|
@@ -5,6 +5,7 @@ import { TenderType } from "../TenderType";
|
|
|
5
5
|
import { BaseManualDiscountLineDecorator } from "./BaseManualDiscountLineDecorator";
|
|
6
6
|
import { IRewardCardDiscountLine } from "./IRewardCardDiscountLine";
|
|
7
7
|
import { ManualDiscountLevel } from "../configuration";
|
|
8
|
+
export declare const REWARD_CARD_DISCOUNT_ANNOTATION_SOURCE_TYPE: string;
|
|
8
9
|
export declare const DECORATOR_TYPE_REWARD_CARD_DISCOUNT: string;
|
|
9
10
|
export declare function isRewardCardDiscountDecorator(transactionLine: ITransactionLine): transactionLine is RewardCardDiscountLineDecorator;
|
|
10
11
|
export declare class RewardCardDiscountLineDecorator extends BaseManualDiscountLineDecorator implements IRewardCardDiscountLine {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const scp_component_business_core_1 = require("@aptos-scp/scp-component-business-core");
|
|
4
4
|
const TenderType_1 = require("../TenderType");
|
|
5
5
|
const BaseManualDiscountLineDecorator_1 = require("./BaseManualDiscountLineDecorator");
|
|
6
|
-
|
|
6
|
+
exports.REWARD_CARD_DISCOUNT_ANNOTATION_SOURCE_TYPE = "REWARD_CARD_DISCOUNT";
|
|
7
7
|
exports.DECORATOR_TYPE_REWARD_CARD_DISCOUNT = "REWARD_CARD_DISCOUNT_DECORATOR";
|
|
8
8
|
function isRewardCardDiscountDecorator(transactionLine) {
|
|
9
9
|
return (transactionLine.lineDecoratorType ===
|
|
@@ -12,7 +12,7 @@ function isRewardCardDiscountDecorator(transactionLine) {
|
|
|
12
12
|
exports.isRewardCardDiscountDecorator = isRewardCardDiscountDecorator;
|
|
13
13
|
class RewardCardDiscountLineDecorator extends BaseManualDiscountLineDecorator_1.BaseManualDiscountLineDecorator {
|
|
14
14
|
constructor(manualDiscountLine, annotationSourceLineNumber, authResponse, tenderAmount, tenderType, authorizationDeviceId) {
|
|
15
|
-
super(exports.DECORATOR_TYPE_REWARD_CARD_DISCOUNT, manualDiscountLine, undefined,
|
|
15
|
+
super(exports.DECORATOR_TYPE_REWARD_CARD_DISCOUNT, manualDiscountLine, undefined, exports.REWARD_CARD_DISCOUNT_ANNOTATION_SOURCE_TYPE, annotationSourceLineNumber);
|
|
16
16
|
this._authResponse = authResponse;
|
|
17
17
|
this._tenderAmount = tenderAmount;
|
|
18
18
|
this._tenderType = tenderType;
|
|
@@ -36,6 +36,7 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
|
|
|
36
36
|
private readonly _isChangeProcessing;
|
|
37
37
|
private _payByLinkCustomer;
|
|
38
38
|
private _storeLanguage;
|
|
39
|
+
private _isRewardCardAutoApplied;
|
|
39
40
|
static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): TenderAuthorizationStatusLine;
|
|
40
41
|
static createFromJsonObject(transactionLineJsonObj: any): TenderAuthorizationStatusLine;
|
|
41
42
|
get couldAffectPricing(): boolean;
|
|
@@ -69,7 +70,8 @@ export declare class TenderAuthorizationStatusLine extends BaseTransactionLine i
|
|
|
69
70
|
get isTenderAuthorizationFallback(): boolean;
|
|
70
71
|
get payByLinkCustomer(): IPayByLinkCustomer;
|
|
71
72
|
get storeLanguage(): string;
|
|
72
|
-
|
|
73
|
+
get isRewardCardAutoApplied(): boolean;
|
|
74
|
+
protected constructor(lineNumber: number, lineType: string, status: TenderAuthorizationStatus, tenderAmount: Money, amountDue: Money, authResponse: IAuthorizationResponse, failureReasonCode: TenderAuthFailureReasonCode, authorizationDeviceId: string, transactionLineReference: ITransactionLineReferenceType, forcedAuthorizationApproval: boolean, cardNumber: string, giftCardPin: string, valueCertificateNumber: string, offlineAuthorizationCode: string, offlineApprovalCode: string, tenderAuthCategory: TenderAuthCategory, tenderType: TenderType, tenderTypeName: string, entryMethod: EntryMethod, tenderReversalFailed: boolean, originalTenderLineReferences: IOriginalTransactionRefundReference[], actionType: ActionType, mappedRefundTenderTypeName: string, mappedRefundCardTypeName: string, excludedRefundCardTypeNames: string[], subType: TenderSubType, isChangeProcessing: boolean, isTenderAuthorizationFallback: boolean, payByLinkCustomer: IPayByLinkCustomer, storeLanguage: string, isRewardCardAutoApplied: boolean);
|
|
73
75
|
protected newTransactionLine(): TenderAuthorizationStatusLine;
|
|
74
76
|
}
|
|
75
77
|
export declare function isTenderAuthorizationStatusLine(transactionLine: ITransactionLine): transactionLine is TenderAuthorizationStatusLine;
|
|
@@ -9,7 +9,7 @@ const Constants_1 = require("../Constants");
|
|
|
9
9
|
const TenderType_1 = require("../TenderType");
|
|
10
10
|
exports.TENDER_AUTH_STATUS_LINE_TYPE = "TenderAuthorizationStatus";
|
|
11
11
|
class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
12
|
-
constructor(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage) {
|
|
12
|
+
constructor(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage, isRewardCardAutoApplied) {
|
|
13
13
|
super(lineNumber, lineType);
|
|
14
14
|
this._status = status;
|
|
15
15
|
this._tenderAmount = tenderAmount;
|
|
@@ -39,6 +39,7 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
39
39
|
this._isTenderAuthorizationFallback = isTenderAuthorizationFallback;
|
|
40
40
|
this._payByLinkCustomer = payByLinkCustomer;
|
|
41
41
|
this._storeLanguage = storeLanguage;
|
|
42
|
+
this._isRewardCardAutoApplied = isRewardCardAutoApplied;
|
|
42
43
|
}
|
|
43
44
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
44
45
|
var _a;
|
|
@@ -73,7 +74,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
73
74
|
const isTenderAuthorizationFallback = collectedData.get(Constants_1.CollectedDataKey.IsTenderFallback);
|
|
74
75
|
const payByLinkCustomer = collectedData.get(Constants_1.CollectedDataKey.PayByLinkCustomer);
|
|
75
76
|
const storeLanguage = collectedData.get(Constants_1.CollectedDataKey.PrimaryLanguage);
|
|
76
|
-
|
|
77
|
+
const isRewardCardAutoApplied = collectedData.get(Constants_1.CollectedDataKey.RewardCardAutoApplied);
|
|
78
|
+
return new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeNames, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage, isRewardCardAutoApplied);
|
|
77
79
|
}
|
|
78
80
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
79
81
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
@@ -123,7 +125,8 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
123
125
|
const failureReasonCode = scp_types_commerce_transaction_1.TenderAuthFailureReasonCode[transactionLineJsonObj._failureReasonCode];
|
|
124
126
|
const payByLinkCustomer = transactionLineJsonObj._payByLinkCustomer;
|
|
125
127
|
const storeLanguage = transactionLineJsonObj._storeLanguage;
|
|
126
|
-
const
|
|
128
|
+
const isRewardCardAutoApplied = transactionLineJsonObj._isRewardCardAutoApplied;
|
|
129
|
+
const tenderAuthorizationStatusLine = new TenderAuthorizationStatusLine(lineNumber, lineType, status, tenderAmount, amountDue, authResponse, failureReasonCode, authorizationDeviceId, transactionLineReference, forcedAuthorizationApproval, cardNumber, giftCardPin, valueCertificateNumber, offlineAuthorizationCode, offlineApprovalCode, tenderAuthCategory, tenderType, tenderTypeName, entryMethod, tenderReversalFailed, originalTenderLineReferences, actionType, mappedRefundTenderTypeName, mappedRefundCardTypeName, excludedRefundCardTypeNames, subType, isChangeProcessing, isTenderAuthorizationFallback, payByLinkCustomer, storeLanguage, isRewardCardAutoApplied);
|
|
127
130
|
tenderAuthorizationStatusLine.loadFromJsonObject(transactionLineJsonObj);
|
|
128
131
|
return tenderAuthorizationStatusLine;
|
|
129
132
|
}
|
|
@@ -220,8 +223,11 @@ class TenderAuthorizationStatusLine extends BaseTransactionLine_1.BaseTransactio
|
|
|
220
223
|
get storeLanguage() {
|
|
221
224
|
return this._storeLanguage;
|
|
222
225
|
}
|
|
226
|
+
get isRewardCardAutoApplied() {
|
|
227
|
+
return this._isRewardCardAutoApplied;
|
|
228
|
+
}
|
|
223
229
|
newTransactionLine() {
|
|
224
|
-
return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.amountDue, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._mappedRefundCardTypeName, this._excludedRefundCardTypeNames, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback, this._payByLinkCustomer, this._storeLanguage);
|
|
230
|
+
return new TenderAuthorizationStatusLine(this.lineNumber, this.lineType, this.status, this.tenderAmount, this.amountDue, this.authResponse, this.failureReasonCode, this.authorizationDeviceId, this.transactionLineReference, this.forcedAuthorizationApproval, this.cardNumber, this.giftCardPin, this._valueCertificateNumber, this.offlineAuthorizationCode, this.offlineApprovalCode, this.tenderAuthCategory, this._tenderType, this.tenderTypeName, this._entryMethod, this._tenderReversalFailed, this._originalTenderLineReferences, this._actionType, this._mappedRefundTenderTypeName, this._mappedRefundCardTypeName, this._excludedRefundCardTypeNames, this._subType, this._isChangeProcessing, this._isTenderAuthorizationFallback, this._payByLinkCustomer, this._storeLanguage, this._isRewardCardAutoApplied);
|
|
225
231
|
}
|
|
226
232
|
}
|
|
227
233
|
exports.TenderAuthorizationStatusLine = TenderAuthorizationStatusLine;
|
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.20.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",
|