Files
medusa-store/packages/modules/pricing
Riqwan Thamir 324b4ab438 feat(pricing, types): add price rule operators to price calculations (#10350)
what:

- adds price rule operators when doing price calculations
- rules now accepts a key where the value can be an array of objects `({ operator: string, value: number })`
  - validation for available types of operator and value to be a number
```
await service.createPriceSets({
  prices: [
    {
      amount: 50,
      currency_code: "usd",
      rules: {
        region_id: "de",
        cart_total: [
          { operator: "gte", value: 400 },
          { operator: "lte", value: 500 },
        ]
      },
    },
  ]
})
```
- price calculations will now account for the operators - lte, gte, lt, gt when the price context is a number

RESOLVES CMRC-747
2024-11-28 20:48:00 +00:00
..
2024-11-27 15:40:07 +01:00
2024-11-27 15:40:07 +01:00

Pricing Module

The Pricing Module gives you access MoneyAmounts, Currency and PriceList through a standalone package that can be installed and run in Next.js functions and other Node.js compatible runtimes.