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
This commit is contained in:
1 parent
805fe4b1db
commit
324b4ab438
8 files changed
+462
-33
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/pricing": patch
|
||||
"@medusajs/types": patch
|
||||
---
|
||||
|
||||
feat(pricing, types): add price rule operators to price calculations
|
||||
Reference in new issue
Block a user