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:
Carlos R. L. Rodrigues
2024-04-26 10:20:42 +00:00
committed by GitHub
parent aef222278b
commit 4b57c5d286
10 changed files with 202 additions and 21 deletions
@@ -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",
}),
}),
])
)