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

SplitOrder not persisting shippingLines in SellerOrder #2859

Closed
buisine opened this issue May 21, 2024 · 1 comment
Closed

SplitOrder not persisting shippingLines in SellerOrder #2859

buisine opened this issue May 21, 2024 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@buisine
Copy link

buisine commented May 21, 2024

Describe the bug
SplitOrder strategy works well on execution, but the shippingLines data is not persisted.

To Reproduce
Steps to reproduce the behavior:
easier way : Make a multi seller order, and then look at the aggregateOrder and the sellerOrder.

Expected behavior
To have shipping lines persisted and then returned by Api in SellerOrder, ( admin, emails )

Environment (please complete the following information):

  • @vendure/core version: 2.1.6
  • Nodejs version 20.9.0
  • Database (mysql/postgres etc): MariaDB 22.04

Additional context
Some hydration not happening somewhere ?
some logs from splitOrderStrategy execution :

This is showing a shipping line in the splitOrder function return.

[server] splitOrder ~ [...partialOrders.values()][0].shippingLines: [
[server]   ShippingLine {
[server]     createdAt: 2024-05-14T09:42:52.572Z,
[server]     updatedAt: 2024-05-14T09:42:52.000Z,
[server]     listPriceIncludesTax: false,
[server]     adjustments: [],
[server]     taxLines: [ [Object] ],
[server]     id: 172,
[server]     shippingMethodId: 45,
[server]     listPrice: 200,
[server]     price: [Getter],
[server]     priceWithTax: [Getter],
[server]     discountedPrice: [Getter],
[server]     discountedPriceWithTax: [Getter],
[server]     taxRate: [Getter],
[server]     discounts: [Getter]
[server]   }
[server] ]

Full Array returned by SplitOrder looklike this :


[server] splitOrder ~ [...partialOrders.values()]: [
[server]   {
[server]     channelId: 33,
[server]     shippingLines: [ [ShippingLine] ],
[server]     lines: [ [OrderLine] ],
[server]     state: 'ArrangingPayment'
[server]   },
[server]   {
[server]     channelId: 5,
[server]     shippingLines: [ [ShippingLine] ],
[server]     lines: [ [OrderLine] ],
[server]     state: 'ArrangingPayment'
[server]   }
[server] ]
@buisine buisine added the type: bug 🐛 Something isn't working label May 21, 2024
@buisine
Copy link
Author

buisine commented May 21, 2024

in order.service ?
missing some lines relation ?

    getSellerOrders(ctx: RequestContext, order: Order): Promise<Order[]> {
        return this.connection.getRepository(ctx, Order).find({
            where: {
                aggregateOrderId: order.id,
            },
            relations: ['channels'],
        });
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants