Skip to content

Commit 8a28484

Browse files
committed
fix: price group logic for external events Ref: LINK-2403
1 parent 4ef79a4 commit 8a28484

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/domain/event/utils.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,16 @@ export const getEventBasePayload = (
608608
isFree: false,
609609
...(featureFlagUtils.isFeatureEnabled('WEB_STORE_INTEGRATION')
610610
? {
611-
offerPriceGroups: offer.offerPriceGroups.map((pg) => ({
612-
id: pg.id ?? undefined,
613-
price: pg.price,
614-
priceGroup: Number(pg.priceGroup),
615-
vatPercentage: offersVatPercentage,
616-
})),
611+
offerPriceGroups: offer.offerPriceGroups
612+
.filter(
613+
(pg) => Boolean(pg.price) && Boolean(offersVatPercentage)
614+
)
615+
.map((pg) => ({
616+
id: pg.id ?? undefined,
617+
price: pg.price,
618+
priceGroup: Number(pg.priceGroup),
619+
vatPercentage: offersVatPercentage,
620+
})),
617621
}
618622
: /* istanbul ignore next */
619623
{}),

0 commit comments

Comments
 (0)