Skip to content

Commit

Permalink
feat: Add productVariantId,orderId to OrderLine api, orderId column t…
Browse files Browse the repository at this point in the history
…o OrderLine entity
  • Loading branch information
mschipperheyn committed Dec 23, 2024
1 parent 17c7d21 commit f6a1db0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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

0 comments on commit f6a1db0

Please sign in to comment.