docs: update order module's conceptual guides (#7893)

* fixes + add return document

* update order conceptual guides

* resolve todo

* re-generate files map
This commit is contained in:
Shahed Nasser
2024-07-09 18:14:30 +03:00
committed by GitHub
parent d46f9fda21
commit 3e4a96a31c
13 changed files with 297 additions and 338 deletions
@@ -18,7 +18,13 @@ The [LineItemAdjustment data model](/references/order/models/LineItemAdjustment)
![A diagram showcasing the relation between an order, its items and shipping methods, and their adjustment lines](https://res.cloudinary.com/dza7lstvk/image/upload/v1712306017/Medusa%20Resources/order-adjustments_myflir.jpg)
The `amount` property of the adjustment line indicates the amount to be discounted from the original amount. Also, the ID of the applied promotion can be stored in the `promotion_id` property of the adjustment line.
The `amount` property of the adjustment line indicates the amount to be discounted from the original amount.
<Note title="Tip">
The ID of the applied promotion is stored in the `promotion_id` property of the adjustment line.
</Note>
---
@@ -55,7 +61,7 @@ import {
const order = await orderModuleService.retrieveOrder("ord_123", {
relations: [
"items.item.adjustments",
"shipping_methods.adjustments",
"shipping_methods.shipping_method.adjustments",
],
})
// retrieve the line item adjustments
@@ -95,6 +101,8 @@ const actions = await promotionModuleService.computeActions(
{
items: lineItemAdjustments,
shipping_methods: shippingMethodAdjustments,
// TODO infer from cart or region
currency_code: "usd"
}
)
```