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

Remove "Cannot create allocations for active order" Exception #2563

Closed
ReichPhilipp opened this issue Dec 2, 2023 · 0 comments
Closed

Remove "Cannot create allocations for active order" Exception #2563

ReichPhilipp opened this issue Dec 2, 2023 · 0 comments

Comments

@ReichPhilipp
Copy link

ReichPhilipp commented Dec 2, 2023

Is your feature request related to a problem? Please describe.
If you want to change the allocation strategy in this way:

shouldAllocateStock(ctx: RequestContext, fromState: OrderState, toState: OrderState, order: Order): boolean | Promise<boolean> {
    // custom
    if (fromState === "AddingItems" && toState === "ArrangingPayment") {
      return true;
    }
    // default
    return fromState === "ArrangingPayment" && (toState === "PaymentAuthorized" || toState === "PaymentSettled");
  }
}

The vendure core stock-movement.service.ts (Line 140f) will raise an error, because the order is not inactive. We can setup only inactive orders. We shortly discussed this behaviour in the discord channel.

Looks like that this is a relic, from stock movement refractoring.

Describe the solution you'd like
Remove this check?

@ReichPhilipp ReichPhilipp changed the title Remove "Cannot create allocations fot active order" Exception Remove "Cannot create allocations for active order" Exception Dec 2, 2023
@michaelbromley michaelbromley moved this to 🏗 In progress in Vendure OS Roadmap Dec 11, 2023
@michaelbromley michaelbromley moved this from 🏗 In progress to ✅ Done in Vendure OS Roadmap Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

1 participant