feat: adjust server-side vendor prices according to syndicate standings #2076

Merged
Sainan merged 4 commits from vendor-syndicate-factor into main 2025-05-16 20:01:20 -07:00
Showing only changes of commit 9dd53adcdd - Show all commits

View File

@ -164,15 +164,15 @@ export const applyStandingToVendorManifest = (
if (offer.RegularPrice) { if (offer.RegularPrice) {
offer.RegularPriceBeforeDiscount = offer.RegularPrice; offer.RegularPriceBeforeDiscount = offer.RegularPrice;
offer.RegularPrice = [ offer.RegularPrice = [
offer.RegularPriceBeforeDiscount[0] * factor, Math.trunc(offer.RegularPriceBeforeDiscount[0] * factor),
offer.RegularPriceBeforeDiscount[1] * factor Math.trunc(offer.RegularPriceBeforeDiscount[1] * factor)
]; ];
} }
if (offer.ItemPrices) { if (offer.ItemPrices) {
offer.ItemPricesBeforeDiscount = offer.ItemPrices; offer.ItemPricesBeforeDiscount = offer.ItemPrices;
offer.ItemPrices = []; offer.ItemPrices = [];
for (const item of offer.ItemPricesBeforeDiscount) { for (const item of offer.ItemPricesBeforeDiscount) {
offer.ItemPrices.push({ ...item, ItemCount: item.ItemCount * factor }); offer.ItemPrices.push({ ...item, ItemCount: Math.trunc(item.ItemCount * factor) });
} }
} }
} }