@aptos-scp/scp-component-store-selling-features-domain-model 1.10.2 → 1.11.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 +8 -1
- package/lib/domain/model/Constants.js +7 -0
- package/lib/domain/model/fee/BaseFeeLineDecorator.d.ts +1 -0
- package/lib/domain/model/fee/BaseFeeLineDecorator.js +4 -0
- package/lib/domain/model/fee/FeeLine.d.ts +7 -0
- package/lib/domain/model/fee/FeeLine.js +67 -4
- package/lib/domain/model/fee/IFeeLine.d.ts +2 -0
- package/lib/domain/model/item/BaseItemLineDecorator.d.ts +1 -0
- package/lib/domain/model/item/BaseItemLineDecorator.js +4 -0
- package/lib/domain/model/item/IItemLine.d.ts +2 -0
- package/lib/domain/model/item/ItemLine.d.ts +3 -0
- package/lib/domain/model/item/ItemLine.js +14 -0
- package/package.json +1 -1
|
@@ -496,8 +496,12 @@ export declare enum CollectedDataKey {
|
|
|
496
496
|
FeeDepartmentGroup = "feeDepartmentGroup",
|
|
497
497
|
FeeDescription = "feeDescription",
|
|
498
498
|
FeeExternalId = "feeExternalId",
|
|
499
|
+
FeeExtendedAmount = "feeExtendedAmount",
|
|
500
|
+
FeeExtendedAmountExcludingTax = "FeeExtendedAmountExcludingTax",
|
|
501
|
+
FeeExtendedAmountIncludingTax = "FeeExtendedAmountIncludingTax",
|
|
499
502
|
FeeId = "feeId",
|
|
500
503
|
FeeLongDescription = "feeLongDescription",
|
|
504
|
+
FeeSublines = "FeeSublines",
|
|
501
505
|
FeeQuantity = "feeQuantity",
|
|
502
506
|
PrevFeeQuantity = "prevFeeQuantity",
|
|
503
507
|
FeeLineReference = "feeLineReference",
|
|
@@ -596,6 +600,7 @@ export declare enum CollectedDataKey {
|
|
|
596
600
|
OriginalEmployeeCustomer = "originalEmployeeCustomer",
|
|
597
601
|
OriginalPriceOverride = "originalPriceOverride",
|
|
598
602
|
OriginalComments = "originalComments",
|
|
603
|
+
TaxIndicatorOnReceipt = "taxIndicatorOnReceipt",
|
|
599
604
|
OriginalLoyaltyInformation = "originalLoyaltyInformation",
|
|
600
605
|
OriginalCompetitivePriceInformation = "originalCompetitivePriceInformation",
|
|
601
606
|
OriginalSupervisorOverrideInformation = "originalSupervisorOverrideInformation",
|
|
@@ -680,6 +685,7 @@ export declare enum CollectedDataKey {
|
|
|
680
685
|
TaxExemptType = "taxExemptType",
|
|
681
686
|
TaxGroupId = "taxGroupId",
|
|
682
687
|
TaxOverrideType = "taxOverrideType",
|
|
688
|
+
TaxByAuthority = "taxByAuthority",
|
|
683
689
|
TenderAdjustmentType = "TenderAdjustmentType",
|
|
684
690
|
TenderAmount = "TenderAmount",
|
|
685
691
|
TenderAmountOriginal = "TenderAmountOriginal",
|
|
@@ -896,7 +902,8 @@ export declare enum CollectedDataKey {
|
|
|
896
902
|
MembershipTypeName = "membershipTypeName",
|
|
897
903
|
MembershipTypeDescription = "membershipTypeDescription",
|
|
898
904
|
IsPermanentMembershipDiscount = "isPermanentMembershipDiscount",
|
|
899
|
-
TerminalForceClosed = "TerminalForceClosed"
|
|
905
|
+
TerminalForceClosed = "TerminalForceClosed",
|
|
906
|
+
TotalLineTax = "totalLineTax"
|
|
900
907
|
}
|
|
901
908
|
export declare enum ItemLookupType {
|
|
902
909
|
ProductInquiryDetail = "ProductInquiryDetail",
|
|
@@ -505,8 +505,12 @@ var CollectedDataKey;
|
|
|
505
505
|
CollectedDataKey["FeeDepartmentGroup"] = "feeDepartmentGroup";
|
|
506
506
|
CollectedDataKey["FeeDescription"] = "feeDescription";
|
|
507
507
|
CollectedDataKey["FeeExternalId"] = "feeExternalId";
|
|
508
|
+
CollectedDataKey["FeeExtendedAmount"] = "feeExtendedAmount";
|
|
509
|
+
CollectedDataKey["FeeExtendedAmountExcludingTax"] = "FeeExtendedAmountExcludingTax";
|
|
510
|
+
CollectedDataKey["FeeExtendedAmountIncludingTax"] = "FeeExtendedAmountIncludingTax";
|
|
508
511
|
CollectedDataKey["FeeId"] = "feeId";
|
|
509
512
|
CollectedDataKey["FeeLongDescription"] = "feeLongDescription";
|
|
513
|
+
CollectedDataKey["FeeSublines"] = "FeeSublines";
|
|
510
514
|
CollectedDataKey["FeeQuantity"] = "feeQuantity";
|
|
511
515
|
CollectedDataKey["PrevFeeQuantity"] = "prevFeeQuantity";
|
|
512
516
|
CollectedDataKey["FeeLineReference"] = "feeLineReference";
|
|
@@ -605,6 +609,7 @@ var CollectedDataKey;
|
|
|
605
609
|
CollectedDataKey["OriginalEmployeeCustomer"] = "originalEmployeeCustomer";
|
|
606
610
|
CollectedDataKey["OriginalPriceOverride"] = "originalPriceOverride";
|
|
607
611
|
CollectedDataKey["OriginalComments"] = "originalComments";
|
|
612
|
+
CollectedDataKey["TaxIndicatorOnReceipt"] = "taxIndicatorOnReceipt";
|
|
608
613
|
CollectedDataKey["OriginalLoyaltyInformation"] = "originalLoyaltyInformation";
|
|
609
614
|
CollectedDataKey["OriginalCompetitivePriceInformation"] = "originalCompetitivePriceInformation";
|
|
610
615
|
CollectedDataKey["OriginalSupervisorOverrideInformation"] = "originalSupervisorOverrideInformation";
|
|
@@ -689,6 +694,7 @@ var CollectedDataKey;
|
|
|
689
694
|
CollectedDataKey["TaxExemptType"] = "taxExemptType";
|
|
690
695
|
CollectedDataKey["TaxGroupId"] = "taxGroupId";
|
|
691
696
|
CollectedDataKey["TaxOverrideType"] = "taxOverrideType";
|
|
697
|
+
CollectedDataKey["TaxByAuthority"] = "taxByAuthority";
|
|
692
698
|
CollectedDataKey["TenderAdjustmentType"] = "TenderAdjustmentType";
|
|
693
699
|
CollectedDataKey["TenderAmount"] = "TenderAmount";
|
|
694
700
|
CollectedDataKey["TenderAmountOriginal"] = "TenderAmountOriginal";
|
|
@@ -906,6 +912,7 @@ var CollectedDataKey;
|
|
|
906
912
|
CollectedDataKey["MembershipTypeDescription"] = "membershipTypeDescription";
|
|
907
913
|
CollectedDataKey["IsPermanentMembershipDiscount"] = "isPermanentMembershipDiscount";
|
|
908
914
|
CollectedDataKey["TerminalForceClosed"] = "TerminalForceClosed";
|
|
915
|
+
CollectedDataKey["TotalLineTax"] = "totalLineTax";
|
|
909
916
|
})(CollectedDataKey = exports.CollectedDataKey || (exports.CollectedDataKey = {}));
|
|
910
917
|
var ItemLookupType;
|
|
911
918
|
(function (ItemLookupType) {
|
|
@@ -14,6 +14,7 @@ export declare abstract class BaseFeeLineDecorator extends BaseLineDecorator<IFe
|
|
|
14
14
|
setTaxationSourceIndicator(calculationSource: SourceIndicator, dataSource: SourceIndicator): IFeeLine;
|
|
15
15
|
setTaxExemptInformation(taxExemptLine: TransactionTaxExemptLine, preTaxExemptDetails: IAppliedTax[]): IFeeLine;
|
|
16
16
|
setTaxOverrideInformation(taxOverrideLine: TaxOverrideLine, preTaxOverrideDetails: ITaxByTaxRule[]): IFeeLine;
|
|
17
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): IFeeLine;
|
|
17
18
|
get quantity(): Quantity;
|
|
18
19
|
get unitPrice(): Price;
|
|
19
20
|
get feeType(): FeeType;
|
|
@@ -35,6 +35,10 @@ class BaseFeeLineDecorator extends BaseLineDecorator_1.BaseLineDecorator {
|
|
|
35
35
|
const feeLine = this.decoratedTransactionLine.setTaxOverrideInformation(taxOverrideLine, preTaxOverrideDetails);
|
|
36
36
|
return this.updateDecoratedTransactionLine(feeLine);
|
|
37
37
|
}
|
|
38
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt) {
|
|
39
|
+
let feeLine = this.decoratedTransactionLine.setTaxIndicatorOnReceipt(taxIndicatorOnReceipt);
|
|
40
|
+
return this.updateDecoratedTransactionLine(feeLine);
|
|
41
|
+
}
|
|
38
42
|
get quantity() {
|
|
39
43
|
return this.decoratedTransactionLine.quantity;
|
|
40
44
|
}
|
|
@@ -57,6 +57,8 @@ export declare class FeeLine extends BaseTransactionLine implements IFeeLine, IC
|
|
|
57
57
|
private _sublineIndexFromReturnCanonicalTransaction?;
|
|
58
58
|
private _lineNumberFromReturnTransaction?;
|
|
59
59
|
private _originalTaxOverride?;
|
|
60
|
+
private _taxIndicatorOnReceipt?;
|
|
61
|
+
static isPickupFulfilmentTransaction?: boolean;
|
|
60
62
|
/**
|
|
61
63
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
62
64
|
* data collected during the qualification process.
|
|
@@ -78,6 +80,7 @@ export declare class FeeLine extends BaseTransactionLine implements IFeeLine, IC
|
|
|
78
80
|
get feesByFulfillmentGroup(): IFulfillmentGroupFee[];
|
|
79
81
|
get fulfillmentGroupIds(): string[];
|
|
80
82
|
get originalTaxOverride(): ITaxOverrideDetails;
|
|
83
|
+
get taxIndicatorOnReceipt(): string;
|
|
81
84
|
get feeType(): FeeType;
|
|
82
85
|
get feeId(): string;
|
|
83
86
|
get couldAffectPricing(): boolean;
|
|
@@ -142,6 +145,9 @@ export declare class FeeLine extends BaseTransactionLine implements IFeeLine, IC
|
|
|
142
145
|
static feeTypeFromJsonObject(transactionLineJsonObj: any): FeeType;
|
|
143
146
|
static feeTypeFromCollectedData(collectedData: Readonly<Map<string, any>>): FeeType;
|
|
144
147
|
static taxGroupIdFromJsonObject(transactionLineJsonObj: any): string;
|
|
148
|
+
static getExtendedAmountFromCollectedData(collectedData: Readonly<Map<string, any>>): Money;
|
|
149
|
+
static getExtendedAmountExcludingTaxFromCollectedData(collectedData: Readonly<Map<string, any>>): Money;
|
|
150
|
+
static getExtendedAmountIncludingTaxFromCollectedData(collectedData: Readonly<Map<string, any>>): Money;
|
|
145
151
|
copyLineWithNewLineNumber(newLineNumber: number): FeeLine;
|
|
146
152
|
/**
|
|
147
153
|
* This method should be implemented only in decorator and not in the Fee line.
|
|
@@ -151,6 +157,7 @@ export declare class FeeLine extends BaseTransactionLine implements IFeeLine, IC
|
|
|
151
157
|
setItemLineReference(itemLineReference: ISameTransactionLineReference): IFeeLine;
|
|
152
158
|
setPricingSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IFeeLine;
|
|
153
159
|
setTaxationSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IFeeLine;
|
|
160
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): FeeLine;
|
|
154
161
|
setTaxExemptInformation(taxExemptLine: ItemTaxExemptLine | TransactionTaxExemptLine, preTaxExemptDetails: IAppliedTax[]): IFeeLine;
|
|
155
162
|
setTaxOverrideInformation(taxOverrideLine: TaxOverrideLine, preTaxOverrideDetails: ITaxByTaxRule[]): IFeeLine;
|
|
156
163
|
setTransactionLineTaxes(transactionLineTaxes: ITransactionLineTaxes, extendedAmount?: Money): IFeeLine;
|
|
@@ -5,6 +5,7 @@ const scp_types_commerce_transaction_1 = require("@aptos-scp/scp-types-commerce-
|
|
|
5
5
|
const BaseTransactionLine_1 = require("../BaseTransactionLine");
|
|
6
6
|
const Constants_1 = require("../Constants");
|
|
7
7
|
const ItemLine_1 = require("../item/ItemLine");
|
|
8
|
+
const UIBusinessEventTypes_1 = require("../../UIBusinessEventTypes");
|
|
8
9
|
exports.TRANSACTION_FEE_LINE_TYPE = "TransactionFee";
|
|
9
10
|
exports.TRANSACTION_FEE_REFUND_LINE_TYPE = "TransactionFeeRefund";
|
|
10
11
|
exports.ITEM_FEE_LINE_TYPE = "ItemFee";
|
|
@@ -47,8 +48,12 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
47
48
|
* @return {FeeLine}
|
|
48
49
|
*/
|
|
49
50
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
51
|
+
this.isPickupFulfilmentTransaction = uiBusinessEvent.type === UIBusinessEventTypes_1.ORDER_ITEM_PICKUP_EVENT;
|
|
52
|
+
const extendedAmount = this.getExtendedAmountFromCollectedData(collectedData);
|
|
53
|
+
const extendedAmountExcludingTax = this.getExtendedAmountExcludingTaxFromCollectedData(collectedData);
|
|
54
|
+
const extendedAmountIncludingTax = this.getExtendedAmountIncludingTaxFromCollectedData(collectedData);
|
|
50
55
|
const feeType = this.feeTypeFromCollectedData(collectedData);
|
|
51
|
-
let feeLine = new FeeLine(lineNumber, lineType, feeType);
|
|
56
|
+
let feeLine = new FeeLine(lineNumber, lineType, feeType, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax);
|
|
52
57
|
feeLine.loadFromCollectedData(collectedData);
|
|
53
58
|
return feeLine;
|
|
54
59
|
}
|
|
@@ -81,6 +86,9 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
81
86
|
get originalTaxOverride() {
|
|
82
87
|
return this._originalTaxOverride;
|
|
83
88
|
}
|
|
89
|
+
get taxIndicatorOnReceipt() {
|
|
90
|
+
return this._taxIndicatorOnReceipt;
|
|
91
|
+
}
|
|
84
92
|
get feeType() {
|
|
85
93
|
return this._feeType;
|
|
86
94
|
}
|
|
@@ -88,10 +96,16 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
88
96
|
return this._feeId;
|
|
89
97
|
}
|
|
90
98
|
get couldAffectPricing() {
|
|
99
|
+
if (FeeLine.isPickupFulfilmentTransaction) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
91
102
|
return true;
|
|
92
103
|
}
|
|
93
104
|
get couldAffectTaxation() {
|
|
94
|
-
if (
|
|
105
|
+
if (FeeLine.isPickupFulfilmentTransaction) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
else if (this._sublineFromOriginalItemFee !== undefined) {
|
|
95
109
|
return true;
|
|
96
110
|
}
|
|
97
111
|
return this.couldAffectPricing;
|
|
@@ -248,6 +262,26 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
248
262
|
static taxGroupIdFromJsonObject(transactionLineJsonObj) {
|
|
249
263
|
return transactionLineJsonObj._taxGroupId;
|
|
250
264
|
}
|
|
265
|
+
static getExtendedAmountFromCollectedData(collectedData) {
|
|
266
|
+
if (collectedData.has(Constants_1.CollectedDataKey.FeeExtendedAmount) && FeeLine.isPickupFulfilmentTransaction) {
|
|
267
|
+
return collectedData.get(Constants_1.CollectedDataKey.FeeExtendedAmount);
|
|
268
|
+
}
|
|
269
|
+
undefined;
|
|
270
|
+
}
|
|
271
|
+
static getExtendedAmountExcludingTaxFromCollectedData(collectedData) {
|
|
272
|
+
if (collectedData.has(Constants_1.CollectedDataKey.FeeExtendedAmountExcludingTax) &&
|
|
273
|
+
FeeLine.isPickupFulfilmentTransaction) {
|
|
274
|
+
return collectedData.get(Constants_1.CollectedDataKey.FeeExtendedAmountExcludingTax);
|
|
275
|
+
}
|
|
276
|
+
undefined;
|
|
277
|
+
}
|
|
278
|
+
static getExtendedAmountIncludingTaxFromCollectedData(collectedData) {
|
|
279
|
+
if (collectedData.has(Constants_1.CollectedDataKey.FeeExtendedAmountIncludingTax) &&
|
|
280
|
+
FeeLine.isPickupFulfilmentTransaction) {
|
|
281
|
+
return collectedData.get(Constants_1.CollectedDataKey.FeeExtendedAmountIncludingTax);
|
|
282
|
+
}
|
|
283
|
+
undefined;
|
|
284
|
+
}
|
|
251
285
|
copyLineWithNewLineNumber(newLineNumber) {
|
|
252
286
|
const clonedItem = this.clone();
|
|
253
287
|
return clonedItem.updateLineNumber(newLineNumber);
|
|
@@ -257,6 +291,11 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
257
291
|
* @param sublines fee's sublines
|
|
258
292
|
*/
|
|
259
293
|
setSublines(sublines) {
|
|
294
|
+
if (FeeLine.isPickupFulfilmentTransaction) {
|
|
295
|
+
const newLine = this.clone();
|
|
296
|
+
newLine._sublines = sublines;
|
|
297
|
+
return newLine;
|
|
298
|
+
}
|
|
260
299
|
throw new Error("Method not implemented.");
|
|
261
300
|
}
|
|
262
301
|
setItemLineReference(itemLineReference) {
|
|
@@ -289,6 +328,11 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
289
328
|
}
|
|
290
329
|
return newLine;
|
|
291
330
|
}
|
|
331
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt) {
|
|
332
|
+
const newLine = this.clone();
|
|
333
|
+
newLine._taxIndicatorOnReceipt = taxIndicatorOnReceipt;
|
|
334
|
+
return newLine;
|
|
335
|
+
}
|
|
292
336
|
setTaxExemptInformation(taxExemptLine, preTaxExemptDetails) {
|
|
293
337
|
var _a;
|
|
294
338
|
const newLine = this.clone();
|
|
@@ -388,6 +432,7 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
388
432
|
this._sublineIndexFromReturnCanonicalTransaction;
|
|
389
433
|
newTransactionFeeLine._lineNumberFromReturnTransaction = this._lineNumberFromReturnTransaction;
|
|
390
434
|
newTransactionFeeLine._originalTaxOverride = this._originalTaxOverride;
|
|
435
|
+
newTransactionFeeLine._taxIndicatorOnReceipt = this._taxIndicatorOnReceipt;
|
|
391
436
|
return newTransactionFeeLine;
|
|
392
437
|
}
|
|
393
438
|
newTransactionLine() {
|
|
@@ -448,6 +493,7 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
448
493
|
this._sublineIndexFromReturnCanonicalTransaction =
|
|
449
494
|
transactionLineJsonObj._sublineIndexFromReturnCanonicalTransaction;
|
|
450
495
|
this._originalTaxOverride = transactionLineJsonObj._originalTaxOverride;
|
|
496
|
+
this._taxIndicatorOnReceipt = transactionLineJsonObj._taxIndicatorOnReceipt;
|
|
451
497
|
this.loadTaxInformation(transactionLineJsonObj);
|
|
452
498
|
if (!this._fulfillmentGroupIds && transactionLineJsonObj._fulfillmentGroupIds) {
|
|
453
499
|
this._fulfillmentGroupIds = transactionLineJsonObj._fulfillmentGroupIds;
|
|
@@ -554,6 +600,17 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
554
600
|
if (collectedData.has(Constants_1.CollectedDataKey.LineNumberFromReturnTransaction)) {
|
|
555
601
|
this._lineNumberFromReturnTransaction = collectedData.get(Constants_1.CollectedDataKey.LineNumberFromReturnTransaction);
|
|
556
602
|
}
|
|
603
|
+
if (FeeLine.isPickupFulfilmentTransaction) {
|
|
604
|
+
if (!this._totalLineTax && collectedData.has(Constants_1.CollectedDataKey.TotalLineTax)) {
|
|
605
|
+
this._totalLineTax = collectedData.get(Constants_1.CollectedDataKey.TotalLineTax);
|
|
606
|
+
}
|
|
607
|
+
if (!this._quantity && collectedData.has(Constants_1.CollectedDataKey.FeeQuantity)) {
|
|
608
|
+
this._quantity = collectedData.get(Constants_1.CollectedDataKey.FeeQuantity);
|
|
609
|
+
}
|
|
610
|
+
if (!this.taxByAuthority && collectedData.has(Constants_1.CollectedDataKey.TaxByAuthority)) {
|
|
611
|
+
this._taxByAuthority = collectedData.get(Constants_1.CollectedDataKey.TaxByAuthority);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
557
614
|
if (collectedData.has(Constants_1.CollectedDataKey.OriginalTaxOverride)) {
|
|
558
615
|
const originalTaxOverride = collectedData.get(Constants_1.CollectedDataKey.OriginalTaxOverride);
|
|
559
616
|
if (originalTaxOverride) {
|
|
@@ -562,11 +619,17 @@ class FeeLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
562
619
|
this._preTaxOverrideDetails = originalTaxOverride.preTaxOverrideDetails;
|
|
563
620
|
}
|
|
564
621
|
}
|
|
622
|
+
if (collectedData.has(Constants_1.CollectedDataKey.TaxIndicatorOnReceipt)) {
|
|
623
|
+
this._taxIndicatorOnReceipt = collectedData.get(Constants_1.CollectedDataKey.TaxIndicatorOnReceipt);
|
|
624
|
+
}
|
|
565
625
|
if (collectedData.has(Constants_1.CollectedDataKey.SublineIndexFromReturnItem)) {
|
|
566
626
|
this._sublineIndexFromReturnCanonicalTransaction = collectedData.get(Constants_1.CollectedDataKey.SublineIndexFromReturnItem);
|
|
567
627
|
}
|
|
568
|
-
|
|
569
|
-
|
|
628
|
+
if (collectedData.has(Constants_1.CollectedDataKey.FeeSublines) && FeeLine.isPickupFulfilmentTransaction) {
|
|
629
|
+
this._sublines = collectedData.get(Constants_1.CollectedDataKey.FeeSublines);
|
|
630
|
+
}
|
|
631
|
+
else if (this._itemLineReference && this._quantity) {
|
|
632
|
+
// initial value for sublines, will be replaced when taxes are calculated
|
|
570
633
|
this._sublines = [
|
|
571
634
|
{
|
|
572
635
|
quantity: this._quantity.amount,
|
|
@@ -65,12 +65,14 @@ export interface IFeeLine extends ITransactionLine, IVoidableLine {
|
|
|
65
65
|
*/
|
|
66
66
|
readonly lineNumberFromReturnTransaction?: number;
|
|
67
67
|
readonly unitAmountBeforeOverride?: Money;
|
|
68
|
+
readonly taxIndicatorOnReceipt?: string;
|
|
68
69
|
setTransactionLineTaxes(transactionLineTaxes: ITransactionLineTaxes, extendedAmount?: Money): IFeeLine;
|
|
69
70
|
setSublines(sublines: IFeeSubline[]): IFeeLine;
|
|
70
71
|
setTaxExemptInformation(taxExemptLine: ItemTaxExemptLine | TransactionTaxExemptLine, preTaxExemptDetails: IAppliedTax[]): IFeeLine;
|
|
71
72
|
setTaxOverrideInformation(taxOverrideLine: TaxOverrideLine, preTaxOverrideDetails: ITaxByTaxRule[]): IFeeLine;
|
|
72
73
|
setTaxationSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IFeeLine;
|
|
73
74
|
setPricingSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IFeeLine;
|
|
75
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): IFeeLine;
|
|
74
76
|
}
|
|
75
77
|
/**
|
|
76
78
|
* @deprecated This will no longer be used in the future. Use the direct line instead. DSS-17031
|
|
@@ -143,6 +143,7 @@ export declare abstract class BaseItemLineDecorator extends BaseLineDecorator<II
|
|
|
143
143
|
setSupervisorOverrideLineReference(supervisorOverrideLineReference: ITransactionLineReferenceType): IItemLine;
|
|
144
144
|
setSecurityAuthorizationStatus(value: SecurityAuthorizationStatusType): IItemLine;
|
|
145
145
|
setExtendedRegularAmount(amount?: Money): IItemLine;
|
|
146
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): IItemLine;
|
|
146
147
|
protected constructor(lineSavings: Money, lineDecoratorType: string, decoratedTransactionLine: IItemLine, annotationDescription: string, annotationSourceType: string, annotationSourceLineNumber?: number);
|
|
147
148
|
protected clone(): BaseItemLineDecorator;
|
|
148
149
|
}
|
|
@@ -390,6 +390,10 @@ class BaseItemLineDecorator extends BaseLineDecorator_1.BaseLineDecorator {
|
|
|
390
390
|
let itemLine = this.decoratedTransactionLine.setExtendedRegularAmount(amount);
|
|
391
391
|
return this.updateDecoratedTransactionLine(itemLine);
|
|
392
392
|
}
|
|
393
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt) {
|
|
394
|
+
let itemLine = this.decoratedTransactionLine.setTaxIndicatorOnReceipt(taxIndicatorOnReceipt);
|
|
395
|
+
return this.updateDecoratedTransactionLine(itemLine);
|
|
396
|
+
}
|
|
393
397
|
clone() {
|
|
394
398
|
const newBaseItemLineDecorator = super.clone();
|
|
395
399
|
newBaseItemLineDecorator._lineSavings = this._lineSavings;
|
|
@@ -178,6 +178,7 @@ export interface IItemLine extends ITransactionLine, IVoidableLine, IPriceProvid
|
|
|
178
178
|
* For items returned via returnWithTransaction, the comments from the original transaction.
|
|
179
179
|
*/
|
|
180
180
|
readonly originalComments?: string[];
|
|
181
|
+
readonly taxIndicatorOnReceipt?: string;
|
|
181
182
|
/**
|
|
182
183
|
* For items returned via returnWithTransaction, the price override from the original transaction.
|
|
183
184
|
*/
|
|
@@ -261,6 +262,7 @@ export interface IItemLine extends ITransactionLine, IVoidableLine, IPriceProvid
|
|
|
261
262
|
setPricingSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IItemLine;
|
|
262
263
|
setTaxationSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): IItemLine;
|
|
263
264
|
setExtendedRegularAmount(amount?: Money): IItemLine;
|
|
265
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): IItemLine;
|
|
264
266
|
}
|
|
265
267
|
export interface ITransactionLineTaxes {
|
|
266
268
|
taxByAuthority: IAppliedTax[];
|
|
@@ -108,6 +108,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
|
|
|
108
108
|
private _originalRedemptionLoyaltyTransactionKeys?;
|
|
109
109
|
private _originalSaleLoyaltyTransactionKeys?;
|
|
110
110
|
private _originalDiscountReason?;
|
|
111
|
+
private _taxIndicatorOnReceipt?;
|
|
111
112
|
/**
|
|
112
113
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
113
114
|
* data collected during the qualification process.
|
|
@@ -228,6 +229,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
|
|
|
228
229
|
get originalCompetitivePriceInformation(): IOriginalCompetitivePriceInformation;
|
|
229
230
|
get originalSupervisorOverrideInformation(): IOriginalSupervisorOverrideInformation[];
|
|
230
231
|
get originalComments(): string[];
|
|
232
|
+
get taxIndicatorOnReceipt(): string;
|
|
231
233
|
get originalTaxOverride(): ITaxOverrideDetails;
|
|
232
234
|
get originalAdjustments(): ISublinePricingAdjustmentWithSource[];
|
|
233
235
|
get eligibleForSubscription(): boolean;
|
|
@@ -266,6 +268,7 @@ export declare class ItemLine extends BaseTransactionLine implements IItemLine,
|
|
|
266
268
|
updateExtendedAmountIncludingTax(amount: Money): ITransactionLine;
|
|
267
269
|
updateUnitPrice(price: Price, unitPriceSourceIndicator?: UnitPriceSourceIndicator): ItemLine;
|
|
268
270
|
setPricingSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): ItemLine;
|
|
271
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt: string): ItemLine;
|
|
269
272
|
setTaxationSourceIndicator(calculationSourceIndicator?: SourceIndicator, dataSourceIndicator?: SourceIndicator): ItemLine;
|
|
270
273
|
setTransactionLineTaxes(transactionLineTaxes: ITransactionLineTaxes, extendedAmount?: Money): IItemLine;
|
|
271
274
|
setSublines(sublines: IItemSubline[]): IItemLine;
|
|
@@ -158,6 +158,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
158
158
|
const originalExtendedPrice = collectedData.get(Constants_1.CollectedDataKey.OriginalExtendedAmount);
|
|
159
159
|
const originalPriceOverride = collectedData.get(Constants_1.CollectedDataKey.OriginalPriceOverride);
|
|
160
160
|
const originalComments = collectedData.get(Constants_1.CollectedDataKey.OriginalComments);
|
|
161
|
+
const taxIndicatorOnReceipt = collectedData.get(Constants_1.CollectedDataKey.TaxIndicatorOnReceipt);
|
|
161
162
|
const originalLoyaltyInformation = collectedData.get(Constants_1.CollectedDataKey.OriginalLoyaltyInformation);
|
|
162
163
|
const originalCompetitivePriceInformation = collectedData.get(Constants_1.CollectedDataKey.OriginalCompetitivePriceInformation);
|
|
163
164
|
const originalSupervisorOverrideInformation = collectedData.get(Constants_1.CollectedDataKey.OriginalSupervisorOverrideInformation);
|
|
@@ -186,6 +187,9 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
186
187
|
if (originalComments) {
|
|
187
188
|
itemLine._originalComments = originalComments;
|
|
188
189
|
}
|
|
190
|
+
if (taxIndicatorOnReceipt) {
|
|
191
|
+
itemLine._taxIndicatorOnReceipt = taxIndicatorOnReceipt;
|
|
192
|
+
}
|
|
189
193
|
if (((_d = originalLoyaltyInformation) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
190
194
|
itemLine._originalLoyaltyInformation = originalLoyaltyInformation;
|
|
191
195
|
}
|
|
@@ -581,6 +585,9 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
581
585
|
get originalComments() {
|
|
582
586
|
return this._originalComments;
|
|
583
587
|
}
|
|
588
|
+
get taxIndicatorOnReceipt() {
|
|
589
|
+
return this._taxIndicatorOnReceipt;
|
|
590
|
+
}
|
|
584
591
|
get originalTaxOverride() {
|
|
585
592
|
return this._originalTaxOverride;
|
|
586
593
|
}
|
|
@@ -719,6 +726,11 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
719
726
|
}
|
|
720
727
|
return newLine;
|
|
721
728
|
}
|
|
729
|
+
setTaxIndicatorOnReceipt(taxIndicatorOnReceipt) {
|
|
730
|
+
const newLine = this.clone();
|
|
731
|
+
newLine._taxIndicatorOnReceipt = taxIndicatorOnReceipt;
|
|
732
|
+
return newLine;
|
|
733
|
+
}
|
|
722
734
|
setTaxationSourceIndicator(calculationSourceIndicator, dataSourceIndicator) {
|
|
723
735
|
const newLine = this.clone();
|
|
724
736
|
if (calculationSourceIndicator) {
|
|
@@ -894,6 +906,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
894
906
|
newItemLine._originalCompetitivePriceInformation = this._originalCompetitivePriceInformation;
|
|
895
907
|
newItemLine._originalSupervisorOverrideInformation = this._originalSupervisorOverrideInformation;
|
|
896
908
|
newItemLine._originalComments = this._originalComments;
|
|
909
|
+
newItemLine._taxIndicatorOnReceipt = this._taxIndicatorOnReceipt;
|
|
897
910
|
newItemLine._originalTaxOverride = this._originalTaxOverride;
|
|
898
911
|
newItemLine._prepaidAmount = this._prepaidAmount;
|
|
899
912
|
newItemLine._prepaidTaxAmount = this._prepaidTaxAmount;
|
|
@@ -976,6 +989,7 @@ class ItemLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
976
989
|
this._originalSupervisorOverrideInformation =
|
|
977
990
|
transactionLineJsonObj._originalSupervisorOverrideInformation;
|
|
978
991
|
this._originalComments = transactionLineJsonObj._originalComments;
|
|
992
|
+
this._taxIndicatorOnReceipt = transactionLineJsonObj._taxIndicatorOnReceipt;
|
|
979
993
|
this._originalTaxOverride = transactionLineJsonObj._originalTaxOverride;
|
|
980
994
|
this._lineNumberFromReturnCanonicalTransaction =
|
|
981
995
|
transactionLineJsonObj._lineNumberFromReturnCanonicalTransaction;
|
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.11.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",
|