@aptos-scp/scp-component-store-selling-features-domain-model 2.44.1 → 2.45.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/item/BaseItemLineDecorator.d.ts +1 -0
- package/lib/domain/model/item/BaseItemLineDecorator.js +3 -0
- package/lib/domain/model/item/IItemLine.d.ts +4 -0
- package/lib/domain/model/item/ItemLine.d.ts +2 -0
- package/lib/domain/model/item/ItemLine.js +12 -3
- package/lib/domain/model/item/ItemLineOriginalAdjustmentDecorator.js +5 -1
- package/lib/domain/model/tender/RewardCardTenderLine.d.ts +1 -0
- package/lib/domain/model/tender/RewardCardTenderLine.js +1 -0
- package/lib/domain/model/tender/lineTypes.d.ts +2 -2
- package/lib/domain/model/tender/lineTypes.js +5 -3
- package/package.json +3 -3
|
@@ -79,6 +79,7 @@ export declare const ADD_EMPLOYEE_CUSTOMER_EVENT: string;
|
|
|
79
79
|
export declare const REWARD_CARD_EVENT: string;
|
|
80
80
|
export declare const REWARD_CARD_DISCOUNT_EVENT: string;
|
|
81
81
|
export declare const REWARD_CARD_TENDER_EVENT: string;
|
|
82
|
+
export declare const REWARD_CARD_TENDER_REFUND_EVENT: string;
|
|
82
83
|
export declare const RESET_REWARD_CARD_BALANCE_INQUIRY_EVENT: string;
|
|
83
84
|
export declare const START_REWARD_CARD_BALANCE_INQUIRY_EVENT: string;
|
|
84
85
|
export declare const APPLY_REWARD_CARD_EVENT: string;
|
|
@@ -82,6 +82,7 @@ exports.ADD_EMPLOYEE_CUSTOMER_EVENT = "AddEmployeeCustomer";
|
|
|
82
82
|
exports.REWARD_CARD_EVENT = "RewardCard";
|
|
83
83
|
exports.REWARD_CARD_DISCOUNT_EVENT = "RewardCardDiscount";
|
|
84
84
|
exports.REWARD_CARD_TENDER_EVENT = "RewardCardTender";
|
|
85
|
+
exports.REWARD_CARD_TENDER_REFUND_EVENT = "RewardCardTenderRefund";
|
|
85
86
|
exports.RESET_REWARD_CARD_BALANCE_INQUIRY_EVENT = "ResetRewardCardBalanceInquiryDiscount";
|
|
86
87
|
exports.START_REWARD_CARD_BALANCE_INQUIRY_EVENT = "StartRewardCardBalanceInquiry";
|
|
87
88
|
exports.APPLY_REWARD_CARD_EVENT = "ApplyRewardCard";
|
|
@@ -687,6 +687,8 @@ export declare enum CollectedDataKey {
|
|
|
687
687
|
OriginalEmployeeCustomer = "originalEmployeeCustomer",
|
|
688
688
|
OriginalPriceOverride = "originalPriceOverride",
|
|
689
689
|
OriginalComments = "originalComments",
|
|
690
|
+
OriginalRewardCardTenders = "originalRewardCardTenders",
|
|
691
|
+
OriginalPriceCalculatedOnUnitPrice = "originalPriceCalculatedOnUnitPrice",
|
|
690
692
|
TaxIndicatorOnReceipt = "taxIndicatorOnReceipt",
|
|
691
693
|
OriginalLoyaltyInformation = "originalLoyaltyInformation",
|
|
692
694
|
OriginalCompetitivePriceInformation = "originalCompetitivePriceInformation",
|
|
@@ -694,6 +694,8 @@ var CollectedDataKey;
|
|
|
694
694
|
CollectedDataKey["OriginalEmployeeCustomer"] = "originalEmployeeCustomer";
|
|
695
695
|
CollectedDataKey["OriginalPriceOverride"] = "originalPriceOverride";
|
|
696
696
|
CollectedDataKey["OriginalComments"] = "originalComments";
|
|
697
|
+
CollectedDataKey["OriginalRewardCardTenders"] = "originalRewardCardTenders";
|
|
698
|
+
CollectedDataKey["OriginalPriceCalculatedOnUnitPrice"] = "originalPriceCalculatedOnUnitPrice";
|
|
697
699
|
CollectedDataKey["TaxIndicatorOnReceipt"] = "taxIndicatorOnReceipt";
|
|
698
700
|
CollectedDataKey["OriginalLoyaltyInformation"] = "originalLoyaltyInformation";
|
|
699
701
|
CollectedDataKey["OriginalCompetitivePriceInformation"] = "originalCompetitivePriceInformation";
|
|
@@ -102,6 +102,7 @@ export declare abstract class BaseItemLineDecorator extends BaseLineDecorator<II
|
|
|
102
102
|
get originalTransactionPerformingUser(): IUser;
|
|
103
103
|
get originalCustomer(): Customer;
|
|
104
104
|
get originalAdjustments(): ISublinePricingAdjustmentWithSource[];
|
|
105
|
+
get originalRewardCardTenders(): IRewardCardTender[];
|
|
105
106
|
get originalTransactionSalesperson(): IEmployee;
|
|
106
107
|
get originalEmployeeCustomer(): IEmployee;
|
|
107
108
|
get originalDiscountReason(): IPriceChange;
|
|
@@ -255,6 +255,9 @@ class BaseItemLineDecorator extends BaseLineDecorator_1.BaseLineDecorator {
|
|
|
255
255
|
get originalAdjustments() {
|
|
256
256
|
return this.decoratedTransactionLine.originalAdjustments;
|
|
257
257
|
}
|
|
258
|
+
get originalRewardCardTenders() {
|
|
259
|
+
return this.decoratedTransactionLine.originalRewardCardTenders;
|
|
260
|
+
}
|
|
258
261
|
get originalTransactionSalesperson() {
|
|
259
262
|
return this.decoratedTransactionLine.originalTransactionSalesperson;
|
|
260
263
|
}
|
|
@@ -148,6 +148,10 @@ export interface IItemLine extends ITransactionLine, IVoidableLine, IPriceProvid
|
|
|
148
148
|
* canonical transaction.
|
|
149
149
|
*/
|
|
150
150
|
readonly originalAdjustments?: ISublinePricingAdjustmentWithSource[];
|
|
151
|
+
/**
|
|
152
|
+
* For items returned via returnWithTransaction, the reward card tenders from the original transaction.
|
|
153
|
+
*/
|
|
154
|
+
readonly originalRewardCardTenders?: IRewardCardTender[];
|
|
151
155
|
/**
|
|
152
156
|
* For items returned via returnWithTransaction, the original salesperson from the original transaction
|
|
153
157
|
*/
|
|
@@ -113,6 +113,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
|
|
|
113
113
|
private _originalSaleLoyaltyTransactionKeys?;
|
|
114
114
|
private _originalDiscountReason?;
|
|
115
115
|
private _originalAdjustments?;
|
|
116
|
+
private _originalRewardCardTenders?;
|
|
116
117
|
private _taxIndicatorOnReceipt?;
|
|
117
118
|
private _rewardCardTenders?;
|
|
118
119
|
private _preOrder?;
|
|
@@ -243,6 +244,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
|
|
|
243
244
|
get taxIndicatorOnReceipt(): string;
|
|
244
245
|
get originalTaxOverride(): ITaxOverrideDetails;
|
|
245
246
|
get originalAdjustments(): ISublinePricingAdjustmentWithSource[];
|
|
247
|
+
get originalRewardCardTenders(): IRewardCardTender[];
|
|
246
248
|
get eligibleForSubscription(): boolean;
|
|
247
249
|
get eligibleForSendSale(): boolean;
|
|
248
250
|
get reservedQuantity(): number;
|
|
@@ -39,7 +39,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
39
39
|
// tslint:disable-next-line:cyclomatic-complexity
|
|
40
40
|
// eslint-disable-next-line complexity
|
|
41
41
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43
43
|
let accountingCurrency = collectedData.get("accountingCurrency");
|
|
44
44
|
const additionalItemInfo = collectedData.get("additionalItemInfo");
|
|
45
45
|
const authResponse = collectedData.get(Constants_1.CollectedDataKey.TenderAuthResponse);
|
|
@@ -176,6 +176,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
176
176
|
const originalCompetitivePriceInformation = collectedData.get(Constants_1.CollectedDataKey.OriginalCompetitivePriceInformation);
|
|
177
177
|
const originalSupervisorOverrideInformation = collectedData.get(Constants_1.CollectedDataKey.OriginalSupervisorOverrideInformation);
|
|
178
178
|
const originalTaxOverride = collectedData.get(Constants_1.CollectedDataKey.OriginalTaxOverride);
|
|
179
|
+
const originalRewardCardTenders = collectedData.get(Constants_1.CollectedDataKey.OriginalRewardCardTenders);
|
|
179
180
|
if (originalExtendedPrice &&
|
|
180
181
|
(!sublineFromExternalItem || sublineFromExternalItem.quantity === itemLine._quantity.amount)) {
|
|
181
182
|
itemLine = itemLine.updateExtendedAmount(originalExtendedPrice);
|
|
@@ -217,6 +218,9 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
217
218
|
itemLine._taxOverride = originalTaxOverride.taxOverride;
|
|
218
219
|
itemLine._preTaxOverrideDetails = originalTaxOverride.preTaxOverrideDetails;
|
|
219
220
|
}
|
|
221
|
+
if (((_h = originalRewardCardTenders) === null || _h === void 0 ? void 0 : _h.length) > 0) {
|
|
222
|
+
itemLine._originalRewardCardTenders = originalRewardCardTenders;
|
|
223
|
+
}
|
|
220
224
|
}
|
|
221
225
|
if (lineType === exports.ITEM_SALE_LINE_TYPE || lineType === exports.ITEM_CANCEL_LINE_TYPE) {
|
|
222
226
|
const originalPriceOverride = collectedData.get(Constants_1.CollectedDataKey.OriginalPriceOverride);
|
|
@@ -248,11 +252,11 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
248
252
|
itemLine._originalAdjustments = originalAdjustments;
|
|
249
253
|
}
|
|
250
254
|
const originalRedemptionLoyaltyTransactionKeys = collectedData.get(Constants_1.CollectedDataKey.OriginalRedemptionLoyaltyTransactionKeys);
|
|
251
|
-
if (((
|
|
255
|
+
if (((_j = originalRedemptionLoyaltyTransactionKeys) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
|
252
256
|
itemLine._originalRedemptionLoyaltyTransactionKeys = originalRedemptionLoyaltyTransactionKeys;
|
|
253
257
|
}
|
|
254
258
|
const originalSaleLoyaltyTransactionKeys = collectedData.get(Constants_1.CollectedDataKey.OriginalSaleLoyaltyTransactionKeys);
|
|
255
|
-
if (((
|
|
259
|
+
if (((_k = originalSaleLoyaltyTransactionKeys) === null || _k === void 0 ? void 0 : _k.length) > 0) {
|
|
256
260
|
itemLine._originalSaleLoyaltyTransactionKeys = originalSaleLoyaltyTransactionKeys;
|
|
257
261
|
}
|
|
258
262
|
const originalTransactionLineReference = collectedData.get(Constants_1.CollectedDataKey.OriginalTransactionLineReference);
|
|
@@ -633,6 +637,9 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
633
637
|
get originalAdjustments() {
|
|
634
638
|
return this._originalAdjustments;
|
|
635
639
|
}
|
|
640
|
+
get originalRewardCardTenders() {
|
|
641
|
+
return this._originalRewardCardTenders;
|
|
642
|
+
}
|
|
636
643
|
get eligibleForSubscription() {
|
|
637
644
|
return this._eligibleForSubscription;
|
|
638
645
|
}
|
|
@@ -970,6 +977,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
970
977
|
newItemLine._originalRedemptionLoyaltyTransactionKeys = this._originalRedemptionLoyaltyTransactionKeys;
|
|
971
978
|
newItemLine._originalSaleLoyaltyTransactionKeys = this._originalSaleLoyaltyTransactionKeys;
|
|
972
979
|
newItemLine._originalAdjustments = this._originalAdjustments;
|
|
980
|
+
newItemLine._originalRewardCardTenders = this._originalRewardCardTenders;
|
|
973
981
|
newItemLine._rewardCardTenders = this._rewardCardTenders;
|
|
974
982
|
return newItemLine;
|
|
975
983
|
}
|
|
@@ -1118,6 +1126,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
1118
1126
|
this._originalSaleLoyaltyTransactionKeys = transactionLineJsonObj._originalSaleLoyaltyTransactionKeys;
|
|
1119
1127
|
this._originalDiscountReason = transactionLineJsonObj.originalDiscountReason;
|
|
1120
1128
|
this._originalAdjustments = transactionLineJsonObj._originalAdjustments;
|
|
1129
|
+
this._originalRewardCardTenders = transactionLineJsonObj._originalRewardCardTenders;
|
|
1121
1130
|
this._rewardCardTenders = transactionLineJsonObj._rewardCardTenders;
|
|
1122
1131
|
}
|
|
1123
1132
|
newTransactionLine() {
|
|
@@ -34,12 +34,16 @@ class ItemLineOriginalAdjustmentDecorator extends BaseItemLineDecorator_1.BaseIt
|
|
|
34
34
|
? scp_component_business_core_1.Money.fromIMoney(adjustment.extendedAmountBeforeAdjustment)
|
|
35
35
|
: undefined;
|
|
36
36
|
const lineSavings = adjustment.lineSavings ? scp_component_business_core_1.Money.fromIMoney(adjustment.lineSavings) : undefined;
|
|
37
|
+
const priceCalculatedOnUnitPrice = adjustment.priceCalculatedOnUnitPrice
|
|
38
|
+
? scp_component_business_core_1.Price.fromIPrice(adjustment.priceCalculatedOnUnitPrice)
|
|
39
|
+
: undefined;
|
|
37
40
|
return Object.assign(Object.assign({}, adjustment), { replacementUnitPrice,
|
|
38
41
|
replacementAmount,
|
|
39
42
|
discountAmount,
|
|
40
43
|
extendedAmount,
|
|
41
44
|
extendedAmountBeforeAdjustment,
|
|
42
|
-
lineSavings
|
|
45
|
+
lineSavings,
|
|
46
|
+
priceCalculatedOnUnitPrice });
|
|
43
47
|
});
|
|
44
48
|
return new ItemLineOriginalAdjustmentDecorator(originalAdjustments, decoratedItemLine, annotationDescription, annotationSourceType);
|
|
45
49
|
}
|
|
@@ -4,6 +4,7 @@ import { BaseTransactionLine } from "../BaseTransactionLine";
|
|
|
4
4
|
import { VoidSource } from "../Constants";
|
|
5
5
|
import { IVoidableLine } from "../VoidInterfaces";
|
|
6
6
|
export declare const REWARD_CARD_TENDER_LINE_TYPE = "RewardCardTender";
|
|
7
|
+
export declare const REWARD_CARD_TENDER_REFUND_LINE_TYPE = "RewardCardTenderRefund";
|
|
7
8
|
export declare class RewardCardTenderLine extends BaseTransactionLine implements IVoidableLine {
|
|
8
9
|
private _cardNumber;
|
|
9
10
|
private _customerNumber;
|
|
@@ -4,6 +4,7 @@ const scp_component_business_core_1 = require("@aptos-scp/scp-component-business
|
|
|
4
4
|
const BaseTransactionLine_1 = require("../BaseTransactionLine");
|
|
5
5
|
const Constants_1 = require("../Constants");
|
|
6
6
|
exports.REWARD_CARD_TENDER_LINE_TYPE = "RewardCardTender";
|
|
7
|
+
exports.REWARD_CARD_TENDER_REFUND_LINE_TYPE = "RewardCardTenderRefund";
|
|
7
8
|
class RewardCardTenderLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
8
9
|
constructor(lineNumber, lineType, cardNumber, customerNumber, balanceAmount, appliedAmount, pin, tenderId) {
|
|
9
10
|
var _a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ITransactionLine } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
|
-
import { RewardCardTenderLine
|
|
3
|
-
export { REWARD_CARD_TENDER_LINE_TYPE };
|
|
2
|
+
import { RewardCardTenderLine } from "./RewardCardTenderLine";
|
|
4
3
|
export declare function isRewardCardTenderLine(transactionLine: ITransactionLine): transactionLine is RewardCardTenderLine;
|
|
4
|
+
export declare function isRewardCardTenderRefundLine(transactionLine: ITransactionLine): transactionLine is RewardCardTenderLine;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const RewardCardTenderLine_1 = require("./RewardCardTenderLine");
|
|
4
|
-
exports.REWARD_CARD_TENDER_LINE_TYPE = RewardCardTenderLine_1.REWARD_CARD_TENDER_LINE_TYPE;
|
|
5
4
|
function isRewardCardTenderLine(transactionLine) {
|
|
6
|
-
return
|
|
7
|
-
transactionLine.lineType === RewardCardTenderLine_1.REWARD_CARD_TENDER_LINE_TYPE);
|
|
5
|
+
return transactionLine && transactionLine.lineType === RewardCardTenderLine_1.REWARD_CARD_TENDER_LINE_TYPE;
|
|
8
6
|
}
|
|
9
7
|
exports.isRewardCardTenderLine = isRewardCardTenderLine;
|
|
8
|
+
function isRewardCardTenderRefundLine(transactionLine) {
|
|
9
|
+
return transactionLine && transactionLine.lineType === RewardCardTenderLine_1.REWARD_CARD_TENDER_REFUND_LINE_TYPE;
|
|
10
|
+
}
|
|
11
|
+
exports.isRewardCardTenderRefundLine = isRewardCardTenderRefundLine;
|
|
10
12
|
//# sourceMappingURL=lineTypes.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": "2.
|
|
3
|
+
"version": "2.45.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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@aptos-scp/scp-types-client-registration": "^1.4.0",
|
|
65
65
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|
|
66
66
|
"@aptos-scp/scp-types-commerce-devices": "^6.10.0",
|
|
67
|
-
"@aptos-scp/scp-types-commerce-transaction": "^1.
|
|
67
|
+
"@aptos-scp/scp-types-commerce-transaction": "^1.93.0",
|
|
68
68
|
"@aptos-scp/scp-types-customer": "^3.7.0",
|
|
69
69
|
"@aptos-scp/scp-types-einvoice": "^1.17.0",
|
|
70
70
|
"@aptos-scp/scp-types-inventory": "^2.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@aptos-scp/scp-component-user": "^1.4.0",
|
|
87
87
|
"@aptos-scp/scp-types-client-registration": "^1.4.0",
|
|
88
88
|
"@aptos-scp/scp-types-commerce-devices": "^6.10.0",
|
|
89
|
-
"@aptos-scp/scp-types-commerce-transaction": "^1.
|
|
89
|
+
"@aptos-scp/scp-types-commerce-transaction": "^1.93.0",
|
|
90
90
|
"@aptos-scp/scp-types-core": "^1.0.5",
|
|
91
91
|
"@aptos-scp/scp-types-core-config": "^2.2.1",
|
|
92
92
|
"@aptos-scp/scp-types-currency-conversion": "^1.2.0",
|