feat(modules-sdk): remote query context filter (#7153)
What: - Remote query now handles `context` keywork in the arguments to forward it as a filter to the method `list` - Pricing module `list` method returning `calculated_price` if requested as a field
This commit is contained in:
@@ -71,6 +71,10 @@ medusaIntegrationTestRunner({
|
||||
amount: 3000,
|
||||
currency_code: "usd",
|
||||
},
|
||||
{
|
||||
amount: 5000,
|
||||
currency_code: "eur",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
@@ -91,6 +95,17 @@ medusaIntegrationTestRunner({
|
||||
price_set_link: {
|
||||
fields: ["id", "price_set_id", "shipping_option_id"],
|
||||
},
|
||||
prices: {
|
||||
fields: ["amount", "currency_code"],
|
||||
},
|
||||
calculated_price: {
|
||||
fields: ["calculated_amount", "currency_code"],
|
||||
__args: {
|
||||
context: {
|
||||
currency_code: "eur",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -103,6 +118,20 @@ medusaIntegrationTestRunner({
|
||||
price_set_id: priceSet.id,
|
||||
shipping_option_id: shippingOption.id,
|
||||
}),
|
||||
prices: [
|
||||
expect.objectContaining({
|
||||
amount: 5000,
|
||||
currency_code: "eur",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: 3000,
|
||||
currency_code: "usd",
|
||||
}),
|
||||
],
|
||||
calculated_price: expect.objectContaining({
|
||||
calculated_amount: 5000,
|
||||
currency_code: "eur",
|
||||
}),
|
||||
}),
|
||||
])
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user