@aptos-scp/scp-component-store-selling-features-domain-model 1.17.0 → 1.18.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.
@@ -273,6 +273,9 @@ export declare enum UiInputKey {
273
273
  SUSPEND_TRANSACTION_RESUME_TOKEN = "input_suspendResumeToken",
274
274
  SUBSCRIPTION_PAYMENT_TENDER_LINE = "input_subscriptionInputTenderLine",
275
275
  TAX_CUSTOMER = "input_taxCustomer",
276
+ /**
277
+ * @deprecated TAX_EXEMPT_CERTIFICATE_ID will be removed in future releases, use TAX_EXEMPT_CERTIFICATE instead
278
+ */
276
279
  TAX_EXEMPT_CERTIFICATE_ID = "input_taxExemptCertificateId",
277
280
  TAX_EXEMPT_CERTIFICATE = "input_taxExemptCertificate",
278
281
  TAX_EXEMPT_LINE_NUMBER = "input_taxExemptLineNumber",
@@ -448,6 +451,9 @@ export declare enum CollectedDataKey {
448
451
  CashDrawerStatus = "CashDrawerStatus",
449
452
  CashDrawerStatusChangeSuccess = "cashDrawerStatusChangeSuccess",
450
453
  CashDrawerRequestType = "cashDrawerRequestType",
454
+ /**
455
+ * @deprecated CertificateId will be removed in future releases, use Certificate instead
456
+ */
451
457
  CertificateId = "CertificateId",
452
458
  Certificate = "Certificate",
453
459
  CustomFeeType = "CustomFeeType",
@@ -276,6 +276,9 @@ var UiInputKey;
276
276
  UiInputKey["SUSPEND_TRANSACTION_RESUME_TOKEN"] = "input_suspendResumeToken";
277
277
  UiInputKey["SUBSCRIPTION_PAYMENT_TENDER_LINE"] = "input_subscriptionInputTenderLine";
278
278
  UiInputKey["TAX_CUSTOMER"] = "input_taxCustomer";
279
+ /**
280
+ * @deprecated TAX_EXEMPT_CERTIFICATE_ID will be removed in future releases, use TAX_EXEMPT_CERTIFICATE instead
281
+ */
279
282
  UiInputKey["TAX_EXEMPT_CERTIFICATE_ID"] = "input_taxExemptCertificateId";
280
283
  UiInputKey["TAX_EXEMPT_CERTIFICATE"] = "input_taxExemptCertificate";
281
284
  UiInputKey["TAX_EXEMPT_LINE_NUMBER"] = "input_taxExemptLineNumber";
@@ -457,6 +460,9 @@ var CollectedDataKey;
457
460
  CollectedDataKey["CashDrawerStatus"] = "CashDrawerStatus";
458
461
  CollectedDataKey["CashDrawerStatusChangeSuccess"] = "cashDrawerStatusChangeSuccess";
459
462
  CollectedDataKey["CashDrawerRequestType"] = "cashDrawerRequestType";
463
+ /**
464
+ * @deprecated CertificateId will be removed in future releases, use Certificate instead
465
+ */
460
466
  CollectedDataKey["CertificateId"] = "CertificateId";
461
467
  CollectedDataKey["Certificate"] = "Certificate";
462
468
  CollectedDataKey["CustomFeeType"] = "CustomFeeType";
@@ -2,6 +2,7 @@ import { Money } from "@aptos-scp/scp-component-business-core";
2
2
  import { DeviceIdentity, ITransaction, ITransactionLine, ITransactionLineFactory, IUser } from "@aptos-scp/scp-component-store-selling-core";
3
3
  import { IBaseTransactionTaxCalculationResults } from "@aptos-scp/scp-component-taxation";
4
4
  import { IFiscalSignature, ITaxByTaxAuthority, ITaxByTaxRule, ITaxOverride, MerchandiseTransactionReservationStatus, MerchandiseTransactionTradeType, TaxCalculationSystem } from "@aptos-scp/scp-types-commerce-transaction";
5
+ import { PotentialPromotion } from "@aptos-scp/scp-types-pricing";
5
6
  import { GiftReceiptMode } from "./Constants";
6
7
  import { Coupon } from "./Coupon";
7
8
  import { Customer } from "./Customer";
@@ -118,6 +119,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
118
119
  private _transactionReferenceFormatter;
119
120
  private _totalsBeforeVoid;
120
121
  private _unusedCoupons?;
122
+ private _potentialPromotions?;
121
123
  private _employeeCustomer;
122
124
  private _governmentIssuedIds;
123
125
  private _invoiceNumber?;
@@ -157,7 +159,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
157
159
  private _transactionTotalExcludingPreviouslyCollected;
158
160
  private _transactionSubTotalExcludingPreviouslyCollectedExcludingTax;
159
161
  static createFromJsonObj(transactionJsonObj: any, transactionLineFactory: ITransactionLineFactory, transactionReferenceFormatter: ITransactionReferenceFormatter): MerchandiseTransaction;
160
- constructor(deviceIdentity: DeviceIdentity, businessDayDate: string, transactionNumber: number, accountingCurrency: string, transactionReferenceFormatter: ITransactionReferenceFormatter, governmentIssuedIds?: GovernmentBusinessId[], performingUser?: IUser, transactionId?: string, giftReceiptMode?: GiftReceiptMode, giftReceipt?: boolean, totalsBeforeVoid?: TotalsBeforeVoid, unusedCoupons?: Coupon[], employeeCustomer?: IEmployee, invoiceNumber?: string, invoiceSequenceNumber?: number, taxLotteryNumber?: string, order?: Order, invoiceSequenceNumberGenerator?: string, taxLotteryCustomerCode?: string, taxScanCodeData?: string, fiscalSignature?: IFiscalSignature, requiresVoid?: boolean, eInvoiceReference?: string, prepaidTendersToApply?: IPrepaidTenderToApply[], digestValue?: string);
162
+ constructor(deviceIdentity: DeviceIdentity, businessDayDate: string, transactionNumber: number, accountingCurrency: string, transactionReferenceFormatter: ITransactionReferenceFormatter, governmentIssuedIds?: GovernmentBusinessId[], performingUser?: IUser, transactionId?: string, giftReceiptMode?: GiftReceiptMode, giftReceipt?: boolean, totalsBeforeVoid?: TotalsBeforeVoid, unusedCoupons?: Coupon[], employeeCustomer?: IEmployee, invoiceNumber?: string, invoiceSequenceNumber?: number, taxLotteryNumber?: string, order?: Order, invoiceSequenceNumberGenerator?: string, taxLotteryCustomerCode?: string, taxScanCodeData?: string, fiscalSignature?: IFiscalSignature, requiresVoid?: boolean, eInvoiceReference?: string, prepaidTendersToApply?: IPrepaidTenderToApply[], digestValue?: string, potentialPromotions?: PotentialPromotion[]);
161
163
  clone(): ITransaction;
162
164
  addLine(line: ITransactionLine): ITransaction;
163
165
  createOrUpdateOrder(order: Order): ITransaction;
@@ -231,6 +233,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
231
233
  get employeeCustomer(): IEmployee;
232
234
  get referenceNumber(): string;
233
235
  get unusedCoupons(): Coupon[];
236
+ get potentialPromotions(): PotentialPromotion[];
234
237
  get governmentIssuedIds(): GovernmentBusinessId[];
235
238
  get invoiceNumber(): string;
236
239
  get orderReferenceNumber(): string;
@@ -267,6 +270,7 @@ export declare class MerchandiseTransaction extends RetailTransaction implements
267
270
  get digestValue(): string;
268
271
  updateUnusedCoupons(unusedCoupons: Coupon[]): ITransaction;
269
272
  updateGovernmentIssuedIds(governmentIssuedIds: GovernmentBusinessId[]): ITransaction;
273
+ updatePotentialPromotions(potentialPromotions: PotentialPromotion[]): ITransaction;
270
274
  assignCustomer(customer: Customer): ITransaction;
271
275
  assignTaxCustomer(taxCustomer: TaxCustomerLine): ITransaction;
272
276
  assignTradeType(transactionTradeType: MerchandiseTransactionTradeType): ITransaction;
@@ -24,7 +24,7 @@ exports.isMerchandiseTransaction = (transaction) => {
24
24
  Ensure that any new property needs to added here as well toJSON methods as well.
25
25
  */
26
26
  class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
27
- constructor(deviceIdentity, businessDayDate, transactionNumber, accountingCurrency, transactionReferenceFormatter, governmentIssuedIds, performingUser, transactionId, giftReceiptMode, giftReceipt, totalsBeforeVoid, unusedCoupons, employeeCustomer, invoiceNumber, invoiceSequenceNumber, taxLotteryNumber, order, invoiceSequenceNumberGenerator, taxLotteryCustomerCode, taxScanCodeData, fiscalSignature, requiresVoid, eInvoiceReference, prepaidTendersToApply, digestValue) {
27
+ constructor(deviceIdentity, businessDayDate, transactionNumber, accountingCurrency, transactionReferenceFormatter, governmentIssuedIds, performingUser, transactionId, giftReceiptMode, giftReceipt, totalsBeforeVoid, unusedCoupons, employeeCustomer, invoiceNumber, invoiceSequenceNumber, taxLotteryNumber, order, invoiceSequenceNumberGenerator, taxLotteryCustomerCode, taxScanCodeData, fiscalSignature, requiresVoid, eInvoiceReference, prepaidTendersToApply, digestValue, potentialPromotions) {
28
28
  super(deviceIdentity, businessDayDate, transactionNumber, exports.MERCHANDISE_TRANSACTION_TYPE, performingUser, transactionId);
29
29
  this._accountingCurrency = accountingCurrency;
30
30
  this._transactionTotalDeliveryFee = new scp_component_business_core_1.Money(0, accountingCurrency);
@@ -73,6 +73,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
73
73
  this._giftReceipt = giftReceipt;
74
74
  this._totalsBeforeVoid = totalsBeforeVoid;
75
75
  this._unusedCoupons = unusedCoupons;
76
+ this._potentialPromotions = potentialPromotions;
76
77
  this._employeeCustomer = employeeCustomer;
77
78
  this._governmentIssuedIds = governmentIssuedIds;
78
79
  this._invoiceNumber = invoiceNumber;
@@ -112,6 +113,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
112
113
  const giftReceipt = transactionJsonObj._giftReceipt;
113
114
  const totalsBeforeVoid = transactionJsonObj._totalsBeforeVoid;
114
115
  const unusedCoupons = transactionJsonObj._unusedCoupons;
116
+ const potentialPromotions = transactionJsonObj._potentialPromotions;
115
117
  const employeeCustomer = Employee_1.Employee.createFromJsonObject(transactionJsonObj._employeeCustomer);
116
118
  const gbns = transactionJsonObj._governmentIssuedIds;
117
119
  const invoiceNumber = transactionJsonObj._invoiceNumber;
@@ -124,7 +126,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
124
126
  const eInvoiceReference = transactionJsonObj._eInvoiceReference;
125
127
  const digestValue = transactionJsonObj._digestValue;
126
128
  const prepaidTendersToApply = transactionJsonObj._prepaidTendersToApply;
127
- const merchandiseTransaction = new MerchandiseTransaction(deviceIdentity, businessDayDate, transactionNumber, accountingCurrency, transactionReferenceFormatter, gbns, performingUser, transactionId, giftReceiptMode, giftReceipt, totalsBeforeVoid, unusedCoupons, employeeCustomer, invoiceNumber, invoiceSequenceNumber, taxLotteryNumber, order, invoiceSequenceNumberGenerator, taxLotteryCustomerCode, taxScanCodeData, undefined, undefined, eInvoiceReference, prepaidTendersToApply, digestValue);
129
+ const merchandiseTransaction = new MerchandiseTransaction(deviceIdentity, businessDayDate, transactionNumber, accountingCurrency, transactionReferenceFormatter, gbns, performingUser, transactionId, giftReceiptMode, giftReceipt, totalsBeforeVoid, unusedCoupons, employeeCustomer, invoiceNumber, invoiceSequenceNumber, taxLotteryNumber, order, invoiceSequenceNumberGenerator, taxLotteryCustomerCode, taxScanCodeData, undefined, undefined, eInvoiceReference, prepaidTendersToApply, digestValue, potentialPromotions);
128
130
  merchandiseTransaction.loadFromJsonObject(transactionJsonObj, transactionLineFactory);
129
131
  return merchandiseTransaction;
130
132
  }
@@ -185,6 +187,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
185
187
  transaction._salesperson = this._salesperson;
186
188
  transaction._totalsBeforeVoid = this._totalsBeforeVoid;
187
189
  transaction._unusedCoupons = this._unusedCoupons;
190
+ transaction._potentialPromotions = this._potentialPromotions;
188
191
  transaction._employeeCustomer = this._employeeCustomer;
189
192
  transaction._governmentIssuedIds = this._governmentIssuedIds;
190
193
  transaction._invoiceNumber = this._invoiceNumber;
@@ -452,6 +455,9 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
452
455
  get unusedCoupons() {
453
456
  return this._unusedCoupons;
454
457
  }
458
+ get potentialPromotions() {
459
+ return this._potentialPromotions;
460
+ }
455
461
  get governmentIssuedIds() {
456
462
  return this._governmentIssuedIds;
457
463
  }
@@ -566,6 +572,11 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
566
572
  newTransaction._governmentIssuedIds = governmentIssuedIds;
567
573
  return newTransaction;
568
574
  }
575
+ updatePotentialPromotions(potentialPromotions) {
576
+ const newTransaction = this.clone();
577
+ newTransaction._potentialPromotions = potentialPromotions;
578
+ return newTransaction;
579
+ }
569
580
  assignCustomer(customer) {
570
581
  const newTransaction = this.clone();
571
582
  newTransaction._customer = customer;
@@ -853,6 +864,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
853
864
  ["transaction.salesperson", this._salesperson],
854
865
  ["transaction.totalsBeforeVoid", this._totalsBeforeVoid],
855
866
  ["transaction.unusedCoupons", this._unusedCoupons],
867
+ ["transaction.potentialPromotions", this._potentialPromotions],
856
868
  ["transaction.transactionLevelSavings", this._transactionLevelSavings],
857
869
  [
858
870
  "transaction.subTotalExcludingTransactionDiscounts",
@@ -977,6 +989,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
977
989
  _salesperson: this.salesperson,
978
990
  _totalsBeforeVoid: this.transactionTotalsBeforeVoid,
979
991
  _unusedCoupons: this.unusedCoupons,
992
+ _potentialPromotions: this.potentialPromotions,
980
993
  _transactionSubTotalExcludingTransactionDiscounts: this.transactionSubTotalExcludingTransactionDiscounts,
981
994
  _transactionLevelSavings: this.transactionLevelSavings,
982
995
  _governmentIssuedIds: this._governmentIssuedIds,
@@ -1119,6 +1132,7 @@ class MerchandiseTransaction extends RetailTransaction_1.RetailTransaction {
1119
1132
  this._giftReceipt = transactionJsonObj._giftReceipt;
1120
1133
  this._salesperson = Employee_1.Employee.createFromJsonObject(transactionJsonObj._salesperson);
1121
1134
  this._unusedCoupons = transactionJsonObj._unusedCoupons;
1135
+ this._potentialPromotions = transactionJsonObj._potentialPromotions;
1122
1136
  this._employeeCustomer = Employee_1.Employee.createFromJsonObject(transactionJsonObj._employeeCustomer);
1123
1137
  this._transactionSubTotalExcludingTransactionDiscounts =
1124
1138
  transactionJsonObj._transactionSubTotalExcludingTransactionDiscounts &&
@@ -1,11 +1,13 @@
1
1
  import { IPricingMetadataPersistanceObject, ISerializedLinePricingAdjustment, ISerializedSubline, ISerializedSublinePricingAdjustment, ISublinePricingAdjustment, RewardIssue } from "@aptos-scp/scp-component-pricing";
2
2
  import { ISerializedNonFinancialReward } from "@aptos-scp/scp-component-pricing/lib/interfaces/ILineNonFinancialReward";
3
3
  import { ICompetitivePriceInformation, ILoyaltyInformation, ISupervisorOverrideInformation, SourceIndicator } from "@aptos-scp/scp-types-commerce-transaction";
4
+ import { PotentialPromotion } from "@aptos-scp/scp-types-pricing";
4
5
  export interface ISerializedPriceCalculationResultsWithSource {
5
6
  readonly lineAdjustments: ISerializedLinePricingAdjustmentWithSource[];
6
7
  readonly sublines?: ISerializedSublineWithSource[];
7
8
  readonly issues: RewardIssue[];
8
9
  readonly nonFinancialRewards?: ISerializedNonFinancialRewardWithSource[];
10
+ readonly potentialPromotions?: PotentialPromotion[];
9
11
  metadata?: IPricingMetadataPersistanceObject;
10
12
  }
11
13
  export interface ISerializedLinePricingAdjustmentWithSource extends ISerializedLinePricingAdjustment {
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.17.0",
3
+ "version": "1.18.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",
@@ -94,7 +94,7 @@
94
94
  "@aptos-scp/scp-types-inventory": "^2.0.0",
95
95
  "@aptos-scp/scp-types-loyalty-memberships": "^2.3.0",
96
96
  "@aptos-scp/scp-types-orders": "^4.11.0",
97
- "@aptos-scp/scp-types-pricing": "^4.23.0",
97
+ "@aptos-scp/scp-types-pricing": "^4.24.0",
98
98
  "@aptos-scp/scp-types-ss-transaction-history": "^1.6.0",
99
99
  "@aptos-scp/scp-types-store-items": "^1.23.0",
100
100
  "@aptos-scp/scp-types-terminal-settings": "^1.3.0",