fix(promotion, types): non discountable items check (#12644)

* fix(promotions): check if item is discountable

* fix: return earl yonly if non discountable

* fix: update test

* chore: add integration test
This commit is contained in:
Frane Polić
2025-06-12 10:23:06 +02:00
committed by GitHub
parent 6be5750fe8
commit bd6d9777c5
5 changed files with 175 additions and 1 deletions
@@ -201,7 +201,15 @@ function getValidItemsForPromotion(
}
return items.filter((item) => {
if (!item || !("subtotal" in item) || MathBN.lte(item.subtotal, 0)) {
if (!item) {
return false
}
if ("is_discountable" in item && !item.is_discountable) {
return false
}
if (!("subtotal" in item) || MathBN.lte(item.subtotal, 0)) {
return false
}