@aptos-scp/scp-component-store-selling-features-domain-model 2.29.3 → 2.30.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.
@@ -185,6 +185,8 @@ export interface ICustomerProperties extends ICreateUpdateCustomerProperties {
185
185
  customerType?: CustomerType;
186
186
  loyaltyMembershipLookupIndicator?: boolean;
187
187
  hasLoyaltyMemberships?: boolean;
188
+ loyaltyMemberships?: ICustomerLoyaltyMembership[];
189
+ hiddenLoyaltyMemberships?: ICustomerLoyaltyMembership[];
188
190
  extensibilityData?: ExtensibilityDataSet[];
189
191
  tags?: IServiceCustomerTag[];
190
192
  emails?: ICustomerEmailProperties[];
@@ -282,6 +284,10 @@ export interface ICustomerReferenceData {
282
284
  languagesList?: ICustomerAttributeOptions[];
283
285
  genderList?: ICustomerAttributeOptions[];
284
286
  }
287
+ export interface IFilteredLoyaltyMemberships {
288
+ loyaltyMemberships?: ICustomerLoyaltyMembership[];
289
+ hiddenLoyaltyMemberships?: ICustomerLoyaltyMembership[];
290
+ }
285
291
  export declare class Customer implements ICustomerProperties {
286
292
  firstName: string;
287
293
  lastName: string;
@@ -343,8 +349,9 @@ export declare class Customer implements ICustomerProperties {
343
349
  loyaltyMembershipLookupIndicator?: boolean;
344
350
  hasLoyaltyMemberships?: boolean;
345
351
  loyaltyMemberships?: ICustomerLoyaltyMembership[];
346
- pendingLoyaltyMemberships?: ICustomerLoyaltyMembership[];
347
352
  availableLoyaltyPlans?: LoyaltyPlan[];
353
+ hiddenLoyaltyMemberships?: ICustomerLoyaltyMembership[];
354
+ pendingLoyaltyMemberships?: ICustomerLoyaltyMembership[];
348
355
  allowPromptForLoyaltyEnrollment?: boolean;
349
356
  earliestNextLoyaltyEnrollmentPromptDate?: string;
350
357
  attributes?: IServiceCustomerAttribute[];
@@ -6,6 +6,8 @@ export interface IStoreLoyaltyPlans {
6
6
  retailLocationId: string;
7
7
  createDate: Date;
8
8
  loyaltyPlans: LoyaltyPlan[];
9
+ hiddenLoyaltyPlans?: LoyaltyPlan[];
10
+ allLoyaltyPlans?: LoyaltyPlan[];
9
11
  }
10
12
  export interface ICustomerLoyaltyMembership extends CustomerMembership {
11
13
  loyaltyPlan: LoyaltyPlan;
@@ -741,8 +741,19 @@ function getOriginalTenderRefundableAmount(originalTender, refundDue, originalTr
741
741
  const originalTran = (_b = originalTransactionDetails) === null || _b === void 0 ? void 0 : _b.find((origTran) => origTran.originalTransactionId === originalTenderReferenceTranId);
742
742
  if (refundDue) {
743
743
  const returnTotalAmount = getReturnOrCancelTotalAmount(originalTran);
744
+ const originalTenderId = originalTender.isMappedTender
745
+ ? originalTender.mappedOriginTenderId
746
+ : originalTender.tenderId;
747
+ // originalTranTenderAdjustmentTotal is the aggregate of all adjustments that were applied to
748
+ // the tender in the source transaction
749
+ const originalTranTenderAdjustmentTotal = originalTran.originalTenders.reduce((adjustmentTotal, tender) => tender.tenderId === originalTenderId && tender.adjustmentAmount instanceof scp_component_business_core_1.Money
750
+ ? adjustmentTotal.plus(tender.adjustmentAmount)
751
+ : adjustmentTotal, new scp_component_business_core_1.Money(0, refundDue.currency));
752
+ // adjust the raw refundableAmount of origTranRef to factor in the total adjustments
753
+ // applied to the tender
754
+ const adjustedOriginalTranRefRefundableAmount = adjustAmount(origTranRef.refundableAmount, originalTranTenderAdjustmentTotal);
744
755
  // If transaction was partially returned, tranRef.refundableAmount will have the full original tender amount, default to the partial return total amount
745
- const originalTenderAmount = getLowestRefundDue(undefined, returnTotalAmount, origTranRef.refundableAmount);
756
+ const originalTenderAmount = getLowestRefundDue(undefined, returnTotalAmount, adjustedOriginalTranRefRefundableAmount);
746
757
  // Mapped tenders will only use their transaction references for refund amount calculation, if they have been fully tendered,
747
758
  // they will not have transaction references, do not subtract refunded amount
748
759
  const currentTranRefundableAmount = calculateRefundableAmount(originalTenderAmount, originalTender.isMappedTender ? undefined : originalTender.refundedAmount, returnTotalAmount, refundDue);
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.29.3",
3
+ "version": "2.30.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",