kupos-ui-components-lib 9.6.2 → 9.6.3
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/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +189 -133
- package/dist/components/ServiceItem/ServiceItemDesktop.js +2 -2
- package/dist/components/ServiceItem/ServiceItemMobile.js +1 -1
- package/dist/components/ServiceItem/types.d.ts +2 -0
- package/dist/styles.css +0 -15
- package/dist/ui/SeatSection/SeatSection.d.ts +2 -1
- package/dist/ui/SeatSection/SeatSection.js +16 -6
- package/dist/ui/mobileweb/SeatSectionMobile.js +1 -4
- package/dist/utils/CommonService.js +4 -2
- package/package.json +1 -1
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +322 -255
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +7 -0
- package/src/components/ServiceItem/ServiceItemMobile.tsx +2 -2
- package/src/components/ServiceItem/types.ts +2 -0
- package/src/ui/SeatSection/SeatSection.tsx +21 -6
- package/src/ui/mobileweb/SeatSectionMobile.tsx +3 -2
- package/src/utils/CommonService.ts +7 -2
|
@@ -282,12 +282,14 @@ const commonService = {
|
|
|
282
282
|
return { originalPrice: price, discountedPrice: price };
|
|
283
283
|
}
|
|
284
284
|
const { discount_type, discount_value, max_discount } = serviceItem;
|
|
285
|
+
const fixedDiscount = discount_type === "fixed" && discount_value != null ? discount_value : 0;
|
|
285
286
|
const percentageDiscount = discount_type === "percentage" && discount_value != null
|
|
286
287
|
? (price * discount_value) / 100
|
|
287
288
|
: 0;
|
|
289
|
+
const rawDiscount = fixedDiscount || percentageDiscount;
|
|
288
290
|
const finalDiscount = max_discount != null && max_discount > 0
|
|
289
|
-
? Math.min(
|
|
290
|
-
:
|
|
291
|
+
? Math.min(rawDiscount, max_discount)
|
|
292
|
+
: rawDiscount;
|
|
291
293
|
const discountedPrice = Math.max(0, price - finalDiscount);
|
|
292
294
|
return { originalPrice: price, discountedPrice };
|
|
293
295
|
},
|