tripstorekrabi-shared 1.13.39 → 1.13.40
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/package.json +1 -1
- package/price.js +1 -1
- package/product.js +2 -2
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -33,7 +33,7 @@ export function calculateProductOperatorPrice(booking, pricing) {
|
|
|
33
33
|
return calculateProductPrice(booking, pricing, { paymentMode: OPERATOR_PAYMENT_MODE });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
function calculateProductPrice(booking, pricing, options = { paymentMode: SELLING_PAYMENT_MODE }) {
|
|
37
37
|
function calculateRetailPrice(commissionRate, price) {
|
|
38
38
|
return Math.floor(
|
|
39
39
|
(price * 100) /
|
package/product.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { calculateProductSellingPrice, countMinPeople } from "./price.js";
|
|
2
2
|
|
|
3
3
|
const MATCH_HTML_REGEXP = /(<([^>]+)>)/ig;
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ export function buildIndex(id, product) {
|
|
|
12
12
|
heroPhoto: product.heroPhoto,
|
|
13
13
|
operator: product.operator.default.name,
|
|
14
14
|
url: product.url,
|
|
15
|
-
price:
|
|
15
|
+
price: calculateProductSellingPrice({ adults: countMinPeople(product.pricing), children: 0, infants: 0 }, product.pricing) / countMinPeople(product.pricing),
|
|
16
16
|
priceType: product.pricing.type,
|
|
17
17
|
availability: product.availability
|
|
18
18
|
};
|