You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First of all, the OrderMergeStrategies described in the documentation (https://www.vendure.io/docs/typescript-api/orders/merge-strategies/) are not exported and thus not usable in the config.
Secondly, the strategies do not work as intended. The OrderMerger returns something of this type: type MergeResult = { order?: Order; linesToInsert?: Array<{ productVariantId: ID; quantity: number }>; orderToDelete?: Order; };
It only gives functionality to insert extra OrderLines, but not remove any. On top of that, only the quantity property is merged, while other customFields might require merging as well.
Expected behavior
OrderMergeStrategy should have more control over the resulting Order:
Remove OrderLines
Merge CustomFields
Environment (please complete the following information):
@vendure/core version: 0.18.2
The text was updated successfully, but these errors were encountered:
In this case, the OrderLines are not equivalent and merging would result in a new OrderLine being added to the existing Order, with { foo: 'quux' } as the custom fields.
If, however, the guest OrderLine had the same customFields value ({ foo: 'bar' }), then the merge would result in no additional OrderLine, but potentially a modification of the quantity of the existing OrderLine.
Relates to #669. The old implementation was not able to correctly handle OrderLine removal nor
correctly account for custom fields.
BREAKING CHANGE: The signature of the `OrderMergeStrategy.merge()` method has changed. If you have
implemented a custom OrderMergeStrategy, you'll need to update it to return the expected type.
Describe the bug
First of all, the OrderMergeStrategies described in the documentation (https://www.vendure.io/docs/typescript-api/orders/merge-strategies/) are not exported and thus not usable in the config.
Secondly, the strategies do not work as intended. The OrderMerger returns something of this type:
type MergeResult = { order?: Order; linesToInsert?: Array<{ productVariantId: ID; quantity: number }>; orderToDelete?: Order; };
It only gives functionality to insert extra OrderLines, but not remove any. On top of that, only the quantity property is merged, while other customFields might require merging as well.
Expected behavior
OrderMergeStrategy should have more control over the resulting Order:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: