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

Add productVariantId,orderId to OrderLine api, orderId column to OrderLine #3291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/api/schema/common/order.type.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ type OrderLine implements Node {
createdAt: DateTime!
updatedAt: DateTime!
productVariant: ProductVariant!
productVariantId: ID!
featuredAsset: Asset
"The price of a single unit, excluding tax and discounts"
unitPrice: Money!
Expand Down Expand Up @@ -184,6 +185,7 @@ type OrderLine implements Node {
discounts: [Discount!]!
taxLines: [TaxLine!]!
order: Order!
orderId: ID!
fulfillmentLines: [FulfillmentLine!]
}

Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/entity/order-line/order-line.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export class OrderLine extends VendureEntity implements HasCustomFields {
@ManyToOne(type => Order, order => order.lines, { onDelete: 'CASCADE' })
order: Order;

@EntityId()
orderId: ID;

@OneToMany(type => OrderLineReference, lineRef => lineRef.orderLine)
linesReferences: OrderLineReference[];

Expand Down
Loading