@aptos-scp/scp-component-store-selling-features-domain-model 2.10.5 → 2.10.6
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.
|
@@ -154,7 +154,8 @@ export declare class StoreItem implements ISourceIndication, IStoreItemDescripto
|
|
|
154
154
|
isEmployeeDiscountAllowed(): boolean;
|
|
155
155
|
private static extractRetailLocationSpecificItemData;
|
|
156
156
|
private static calculatePermanentPrice;
|
|
157
|
-
private static
|
|
157
|
+
private static calculateBasePermanentPriceAtLevel;
|
|
158
|
+
private static calculatePermanentPriceChangeAtLevel;
|
|
158
159
|
private static calculateTemporaryPrice;
|
|
159
160
|
private static calculateTemporaryPriceAtLevel;
|
|
160
161
|
private static temporaryPriceEffectiveDateTime;
|
|
@@ -490,7 +490,7 @@ class StoreItem {
|
|
|
490
490
|
return { storeGroupItem, retailStoreItem };
|
|
491
491
|
}
|
|
492
492
|
static calculatePermanentPrice(itemToConvert, storeGroupItem, retailStoreItem, accountingCurrency) {
|
|
493
|
-
let permanentPrice = StoreItem.
|
|
493
|
+
let permanentPrice = StoreItem.calculatePermanentPriceChangeAtLevel(retailStoreItem, accountingCurrency);
|
|
494
494
|
if (permanentPrice) {
|
|
495
495
|
return {
|
|
496
496
|
price: permanentPrice.price,
|
|
@@ -500,7 +500,7 @@ class StoreItem {
|
|
|
500
500
|
},
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
|
-
permanentPrice = StoreItem.
|
|
503
|
+
permanentPrice = StoreItem.calculatePermanentPriceChangeAtLevel(storeGroupItem, accountingCurrency);
|
|
504
504
|
if (permanentPrice) {
|
|
505
505
|
return {
|
|
506
506
|
price: permanentPrice.price,
|
|
@@ -510,7 +510,37 @@ class StoreItem {
|
|
|
510
510
|
},
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
permanentPrice = StoreItem.
|
|
513
|
+
permanentPrice = StoreItem.calculatePermanentPriceChangeAtLevel(itemToConvert, accountingCurrency);
|
|
514
|
+
if (permanentPrice) {
|
|
515
|
+
return {
|
|
516
|
+
price: permanentPrice.price,
|
|
517
|
+
source: {
|
|
518
|
+
organizationScope: scp_component_store_items_1.OrganizationScope.AllRetailLocations,
|
|
519
|
+
changeScope: permanentPrice.changeScope,
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
permanentPrice = StoreItem.calculateBasePermanentPriceAtLevel(retailStoreItem, accountingCurrency);
|
|
524
|
+
if (permanentPrice) {
|
|
525
|
+
return {
|
|
526
|
+
price: permanentPrice.price,
|
|
527
|
+
source: {
|
|
528
|
+
organizationScope: scp_component_store_items_1.OrganizationScope.OneRetailLocation,
|
|
529
|
+
changeScope: permanentPrice.changeScope,
|
|
530
|
+
},
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
permanentPrice = StoreItem.calculateBasePermanentPriceAtLevel(storeGroupItem, accountingCurrency);
|
|
534
|
+
if (permanentPrice) {
|
|
535
|
+
return {
|
|
536
|
+
price: permanentPrice.price,
|
|
537
|
+
source: {
|
|
538
|
+
organizationScope: scp_component_store_items_1.OrganizationScope.RetailLocationsGroup,
|
|
539
|
+
changeScope: permanentPrice.changeScope,
|
|
540
|
+
},
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
permanentPrice = StoreItem.calculateBasePermanentPriceAtLevel(itemToConvert, accountingCurrency);
|
|
514
544
|
if (permanentPrice) {
|
|
515
545
|
return {
|
|
516
546
|
price: permanentPrice.price,
|
|
@@ -521,8 +551,19 @@ class StoreItem {
|
|
|
521
551
|
};
|
|
522
552
|
}
|
|
523
553
|
}
|
|
524
|
-
static
|
|
525
|
-
var _a
|
|
554
|
+
static calculateBasePermanentPriceAtLevel(item, accountingCurrency) {
|
|
555
|
+
var _a;
|
|
556
|
+
if (accountingCurrency && item) {
|
|
557
|
+
const price2 = item.permanentPrice;
|
|
558
|
+
if (((_a = price2) === null || _a === void 0 ? void 0 : _a.currency) === accountingCurrency) {
|
|
559
|
+
const price = StoreItem.convertStoreItemComponentIPriceToPrice(price2);
|
|
560
|
+
return { price, changeScope: scp_component_store_items_1.PriceChangeLevelType.Item };
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return undefined;
|
|
564
|
+
}
|
|
565
|
+
static calculatePermanentPriceChangeAtLevel(item, accountingCurrency) {
|
|
566
|
+
var _a;
|
|
526
567
|
if (accountingCurrency && item) {
|
|
527
568
|
if (item.effectivePricing) {
|
|
528
569
|
const price1 = item.effectivePricing.permanentPrice;
|
|
@@ -531,11 +572,6 @@ class StoreItem {
|
|
|
531
572
|
return { price, changeScope: item.effectivePricing.permanentPriceSource };
|
|
532
573
|
}
|
|
533
574
|
}
|
|
534
|
-
const price2 = item.permanentPrice;
|
|
535
|
-
if (((_b = price2) === null || _b === void 0 ? void 0 : _b.currency) === accountingCurrency) {
|
|
536
|
-
const price = StoreItem.convertStoreItemComponentIPriceToPrice(price2);
|
|
537
|
-
return { price, changeScope: scp_component_store_items_1.PriceChangeLevelType.Item };
|
|
538
|
-
}
|
|
539
575
|
}
|
|
540
576
|
return undefined;
|
|
541
577
|
}
|
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.10.
|
|
3
|
+
"version": "2.10.6",
|
|
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",
|