Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'display_id' does not exist on type 'OrderDTO'. #9768

Open
pixelwiese opened this issue Oct 24, 2024 · 5 comments
Open

Property 'display_id' does not exist on type 'OrderDTO'. #9768

pixelwiese opened this issue Oct 24, 2024 · 5 comments

Comments

@pixelwiese
Copy link

pixelwiese commented Oct 24, 2024

Add display_id to type AdminOrder 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

  1. Try to retrieve an Order and access the display_id
  2. run build
  3. see the error

Expected behavior

The display_id should be in the OrderDTO and throw no error.

@olivermrbl
Copy link
Contributor

@pixelwiese, perhaps you can use the AdminOrder type from @medusajs/framework/types?

@pixelwiese
Copy link
Author

@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.

@olivermrbl
Copy link
Contributor

What exactly is your issue? Is it that the type doesn't have display_id or the returned result?

@pixelwiese
Copy link
Author

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.

@olivermrbl
Copy link
Contributor

Until we add display_id to the OrderDTO, you can use the following:

import { AdminOrder } from "@medusajs/framework/types"

@linear linear bot added type: chore and removed version: 2.0 labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants