feat(core-flows,medusa,utils,types): adds delivered_quantity to order (#9130)

what:

- adds delivered_quantity to order


https://github.com/user-attachments/assets/709b1727-08ed-4a88-ae29-38f13540e301
This commit is contained in:
Riqwan Thamir
2024-09-16 11:59:01 +02:00
committed by GitHub
parent 950cf9af79
commit 3e97a64b21
41 changed files with 794 additions and 25 deletions

View File

@@ -397,6 +397,13 @@ moduleIntegrationTestRunner<IOrderModuleService>({
quantity: 4,
},
},
{
action: ChangeActionType.DELIVER_ITEM,
details: {
reference_id: createdOrder.items![1].id,
quantity: 1,
},
},
],
})
@@ -421,6 +428,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
expect.objectContaining({
quantity: 4,
fulfilled_quantity: 1,
delivered_quantity: 1,
})
)
@@ -499,6 +507,30 @@ moduleIntegrationTestRunner<IOrderModuleService>({
fulfilled_quantity: 2,
})
)
const orderChange5 = await service.createOrderChange({
order_id: createdOrder.id,
actions: [
{
action: ChangeActionType.DELIVER_ITEM,
details: {
reference_id: createdOrder.items![1].id,
quantity: 5,
},
},
],
})
await expect(
service.confirmOrderChange({
id: orderChange5.id,
})
).rejects.toThrow(
`Cannot deliver more items than what was fulfilled for item ${
createdOrder.items![1].id
}`
)
await service.deleteOrderChanges([orderChange5.id])
})
it("should create an order change, add actions to it, confirm the changes, revert all the changes and restore the changes again.", async function () {