Open pixelwiese opened 3 days ago
@pixelwiese, perhaps you can use the AdminOrder
type from @medusajs/framework/types
?
@olivermrbl
I imported import { Modules } from "@medusajs/framework/utils"
and this is the code i am using for retrieving the order:
const order = await orderModuleService.retrieveOrder(orderId, { relations: ["summary", "summary.totals", "items", "items.tax_lines", "billing_address", "shipping_address", "shipping_methods", "shipping_methods.tax_lines"], select: ["total", "created_at"] })
also tried it with the "display_id"
in select, but not sure if this is needed.
What exactly is your issue? Is it that the type doesn't have display_id
or the returned result?
The Type does not have it and throws an error when i build the Backend. However display_id is returned.
Just realized I misunderstood your last comment. How would I use AdminOrder, I couldn't find it in the documentation.
Until we add display_id
to the OrderDTO
, you can use the following:
import { AdminOrder } from "@medusajs/framework/types"
Add
display_id
to typeAdminOrder
in@medusajs/framework/types
Original Issue:
Bug report
Describe the bug
When i try to build the backend i get the error
Property 'display_id' does not exist on type 'OrderDTO'.
The property is accessed in a subscriber. I checked the reference and could not see it there either. But in development i can still access the property and use it. It is also visible in the order json in the app.
System information
Medusa version (including plugins): 2.0.0 Node.js version: 20.10.0 Database: postgres Operating system: Mac Browser (if relevant): Chrome
Steps to reproduce the behavior
Expected behavior
The display_id should be in the OrderDTO and throw no error.