fix(core-flows, dashboard): adjust stock levels when doing partial fulfilments (#9736)
* fix: correctly update stock location when partial fulfillemnt is created * fix: update test * fix: count reserved quantity of the item as available quantity for fulfillment * fix: refresh reservations when order fulfillment is created * feat: add check for reservation quantity * feat: add a test case
This commit is contained in:
1 parent
a0034a0fef
commit
1889180319
6 files changed
+205
-18
No files matched your search
@@ -22,7 +22,7 @@ export async function createOrderSeeder({
|
||||
container: MedusaContainer
|
||||
productOverride?: AdminProduct
|
||||
stockChannelOverride?: AdminStockLocation
|
||||
additionalProducts?: AdminProduct[]
|
||||
additionalProducts?: { variant_id: string; quantity: number }[]
|
||||
inventoryItemOverride?: AdminInventoryItem
|
||||
}) {
|
||||
const publishableKey = await generatePublishableKey(container)
|
||||
@@ -195,10 +195,7 @@ export async function createOrderSeeder({
|
||||
sales_channel_id: salesChannel.id,
|
||||
items: [
|
||||
{ quantity: 1, variant_id: product.variants[0].id },
|
||||
...(additionalProducts || []).map((p) => ({
|
||||
quantity: 1,
|
||||
variant_id: p.variants?.[0]?.id,
|
||||
})),
|
||||
...(additionalProducts || []),
|
||||
],
|
||||
},
|
||||
storeHeaders
|
||||
|
||||
Reference in new issue
Block a user