@aptos-scp/scp-component-store-selling-features-domain-model 1.34.0 → 1.35.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.
@@ -13,6 +13,7 @@ export declare abstract class BasePriceChangeLineDecorator extends BaseLineDecor
13
13
  get extendedAmountIncludingTax(): Money;
14
14
  get couldAffectPricing(): boolean;
15
15
  get unitPrice(): Price;
16
+ get superseded(): boolean;
16
17
  get preventsTransactionVoid(): boolean;
17
18
  get allowVoid(): boolean;
18
19
  protected constructor(lineDecoratorType: string, decoratedTransactionLine: ItemPriceChangeLine, annotationDescription: string, annotationSourceType: string, annotationSourceLineNumber?: number);
@@ -32,6 +32,9 @@ class BasePriceChangeLineDecorator extends BaseLineDecorator_1.BaseLineDecorator
32
32
  get unitPrice() {
33
33
  return this.decoratedTransactionLine.unitPrice;
34
34
  }
35
+ get superseded() {
36
+ return this.decoratedTransactionLine.superseded;
37
+ }
35
38
  get preventsTransactionVoid() {
36
39
  return false;
37
40
  }
@@ -12,6 +12,7 @@ export declare class ItemPriceChangeLine extends BaseTransactionLine implements
12
12
  private _reasonDescription;
13
13
  private _supervisorOverrideLineReference;
14
14
  private _copiedFromLineNumber;
15
+ private _superseded;
15
16
  /**
16
17
  * The create method is called by the transaction line factory to create an instance and initialize it from the
17
18
  * data collected during the qualification process.
@@ -37,7 +38,8 @@ export declare class ItemPriceChangeLine extends BaseTransactionLine implements
37
38
  get allowVoid(): boolean;
38
39
  get copiedFromLineNumber(): number;
39
40
  copyLineWithNewLineNumber(newLineNumber: number, linePropertyOverrides?: Readonly<Map<string, any>>): ItemPriceChangeLine;
40
- protected constructor(changeLineNumber: number, price: Price, reasonCode: string, reasonListType: string, reasonDescription: string, lineNumber: number, lineType: string, supervisorOverrideLineReference: ITransactionLineReferenceType, extendedAmount?: Money, extendedAmountExcludingTax?: Money, extendedAmountIncludingTax?: Money, copiedFromLineNumber?: number);
41
+ get superseded(): boolean;
42
+ protected constructor(changeLineNumber: number, price: Price, reasonCode: string, reasonListType: string, reasonDescription: string, lineNumber: number, lineType: string, supervisorOverrideLineReference: ITransactionLineReferenceType, extendedAmount?: Money, extendedAmountExcludingTax?: Money, extendedAmountIncludingTax?: Money, copiedFromLineNumber?: number, superseded?: boolean);
41
43
  protected clone(): BaseTransactionLine;
42
44
  protected newTransactionLine(): BaseTransactionLine;
43
45
  }
@@ -9,7 +9,7 @@ exports.CHANGE_ITEM_PRICE_LINE_TYPE = "ChangeItemPrice";
9
9
  class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
10
10
  // The constructor is only used by the create methods, which should be used instead of the constructor to create an
11
11
  // instance.
12
- constructor(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber) {
12
+ constructor(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber, superseded) {
13
13
  super(lineNumber, lineType, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax);
14
14
  this._changeLineNumber = changeLineNumber;
15
15
  this._price = price;
@@ -18,6 +18,7 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
18
18
  this._reasonDescription = reasonDescription;
19
19
  this._supervisorOverrideLineReference = supervisorOverrideLineReference;
20
20
  this._copiedFromLineNumber = copiedFromLineNumber;
21
+ this._superseded = superseded;
21
22
  }
22
23
  /**
23
24
  * The create method is called by the transaction line factory to create an instance and initialize it from the
@@ -55,7 +56,9 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
55
56
  const reasonListType = transactionLineJsonObj._reasonListType;
56
57
  const reasonDescription = transactionLineJsonObj._reasonDescription;
57
58
  const supervisorOverrideLineReference = transactionLineJsonObj._supervisorOverrideLineReference;
58
- const itemPriceChangeLine = new ItemPriceChangeLine(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax);
59
+ const copiedFromLineNumber = transactionLineJsonObj._copiedFromLineNumber;
60
+ const superseded = transactionLineJsonObj._superseded;
61
+ const itemPriceChangeLine = new ItemPriceChangeLine(changeLineNumber, price, reasonCode, reasonListType, reasonDescription, lineNumber, lineType, supervisorOverrideLineReference, extendedAmount, extendedAmountExcludingTax, extendedAmountIncludingTax, copiedFromLineNumber, superseded);
59
62
  itemPriceChangeLine.loadFromJsonObject(transactionLineJsonObj);
60
63
  return itemPriceChangeLine;
61
64
  }
@@ -100,6 +103,9 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
100
103
  clonedItem._copiedFromLineNumber = (_b = linePropertyOverrides) === null || _b === void 0 ? void 0 : _b.get(Constants_1.LinePropertyOverrides.CopiedFromLineNumber);
101
104
  return clonedItem.updateLineNumber(newLineNumber);
102
105
  }
106
+ get superseded() {
107
+ return this._superseded;
108
+ }
103
109
  clone() {
104
110
  const newTransactionLine = super.clone();
105
111
  // These are handled by the constructor called by newTransactionLine().
@@ -120,7 +126,7 @@ class ItemPriceChangeLine extends BaseTransactionLine_1.BaseTransactionLine {
120
126
  }
121
127
  */
122
128
  newTransactionLine() {
123
- return new ItemPriceChangeLine(this._changeLineNumber, this._price, this._reasonCode, this._reasonListType, this._reasonDescription, this.lineNumber, this.lineType, this._supervisorOverrideLineReference, this.extendedAmount, this.extendedAmountExcludingTax, this.extendedAmountIncludingTax, this._copiedFromLineNumber);
129
+ return new ItemPriceChangeLine(this._changeLineNumber, this._price, this._reasonCode, this._reasonListType, this._reasonDescription, this.lineNumber, this.lineType, this._supervisorOverrideLineReference, this.extendedAmount, this.extendedAmountExcludingTax, this.extendedAmountIncludingTax, this._copiedFromLineNumber, this._superseded);
124
130
  }
125
131
  }
126
132
  exports.ItemPriceChangeLine = ItemPriceChangeLine;
@@ -0,0 +1,11 @@
1
+ import { ITransactionLine, ITransactionLineFactory } from "@aptos-scp/scp-component-store-selling-core";
2
+ import { BasePriceChangeLineDecorator } from "./BasePriceChangeLineDecorator";
3
+ import { ItemPriceChangeLine } from "./ItemPriceChangeLine";
4
+ export declare const DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE: string;
5
+ export declare class SupersededPriceChangeLineDecorator extends BasePriceChangeLineDecorator {
6
+ static createFromJsonObject(transactionLineJsonObj: any, transactionLineFactory: ITransactionLineFactory): SupersededPriceChangeLineDecorator;
7
+ constructor(priceChangeLine: ItemPriceChangeLine, annotationSourceType: string, annotationSourceLineNumber: number);
8
+ get superseded(): boolean;
9
+ protected newTransactionLine(): SupersededPriceChangeLineDecorator;
10
+ }
11
+ export declare function isSupersededPriceChangeLineDecorator(transactionLine: ITransactionLine): transactionLine is SupersededPriceChangeLineDecorator;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const BaseLineDecorator_1 = require("../BaseLineDecorator");
4
+ const BasePriceChangeLineDecorator_1 = require("./BasePriceChangeLineDecorator");
5
+ exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE = "SUPERSEDED_PRICE_CHANGE_LINE_DECORATOR";
6
+ class SupersededPriceChangeLineDecorator extends BasePriceChangeLineDecorator_1.BasePriceChangeLineDecorator {
7
+ static createFromJsonObject(transactionLineJsonObj, transactionLineFactory) {
8
+ const decoratedTransactionLineJsonObj = BaseLineDecorator_1.BaseLineDecorator.getDecoratedTransactionLineJsonObjectFromJsonObject(transactionLineJsonObj);
9
+ const decoratedPriceChangeLine = transactionLineFactory.createTransactionLineFromJsonObj(decoratedTransactionLineJsonObj);
10
+ const annotationSourceType = BaseLineDecorator_1.BaseLineDecorator.getAnnotationSourceTypeFromJsonObject(transactionLineJsonObj);
11
+ const annotationSourceLineNumber = BaseLineDecorator_1.BaseLineDecorator.getAnnotationSourceLineNumberFromJsonObject(transactionLineJsonObj);
12
+ const supersededPriceChangeLineDecorator = new SupersededPriceChangeLineDecorator(decoratedPriceChangeLine, annotationSourceType, annotationSourceLineNumber);
13
+ return supersededPriceChangeLineDecorator;
14
+ }
15
+ constructor(priceChangeLine, annotationSourceType, annotationSourceLineNumber) {
16
+ super(exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE, priceChangeLine, undefined, annotationSourceType, annotationSourceLineNumber);
17
+ }
18
+ get superseded() {
19
+ return true;
20
+ }
21
+ newTransactionLine() {
22
+ return new SupersededPriceChangeLineDecorator(this.decoratedTransactionLine, this.annotationSourceType, this.annotationSourceLineNumber);
23
+ }
24
+ }
25
+ exports.SupersededPriceChangeLineDecorator = SupersededPriceChangeLineDecorator;
26
+ function isSupersededPriceChangeLineDecorator(transactionLine) {
27
+ return (transactionLine.lineDecoratorType ===
28
+ exports.DECORATOR_TYPE_SUPERSEDED_PRICE_CHANGE_LINE);
29
+ }
30
+ exports.isSupersededPriceChangeLineDecorator = isSupersededPriceChangeLineDecorator;
31
+ //# sourceMappingURL=SupersededPriceChangeLineDecorator.js.map
@@ -35,3 +35,4 @@ export * from "./ItemLineNonFinancialRewardDecorator";
35
35
  export * from "./IAllLinePricingAdjustments";
36
36
  export * from "./ISerializedPriceCalculationResultsWithSource";
37
37
  export * from "./ItemLineExtensibilityFormDataDecorator";
38
+ export * from "./SupersededPriceChangeLineDecorator";
@@ -38,4 +38,5 @@ __export(require("./ItemLineTaxOverrideDecorator"));
38
38
  __export(require("./ItemLineNonFinancialRewardDecorator"));
39
39
  __export(require("./IAllLinePricingAdjustments"));
40
40
  __export(require("./ItemLineExtensibilityFormDataDecorator"));
41
+ __export(require("./SupersededPriceChangeLineDecorator"));
41
42
  //# sourceMappingURL=index.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": "1.34.0",
3
+ "version": "1.35.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",