From de595a239e76d4fecdc61962720a5360df809dcc Mon Sep 17 00:00:00 2001 From: Rinat Abdullin Date: Tue, 6 Dec 2022 13:52:33 +0100 Subject: [PATCH] Update specs to rely on globally unique counter --- specs/bundle.txt | 370 +++++++++++++++++++++++------------------------ 1 file changed, 185 insertions(+), 185 deletions(-) diff --git a/specs/bundle.txt b/specs/bundle.txt index 7e50d49..3e3dae0 100644 --- a/specs/bundle.txt +++ b/specs/bundle.txt @@ -6,25 +6,25 @@ WHEN: THEN: AddProductsResp uids:"00000000-0000-0000-0000-000000000001" EVENTS: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"one" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"one" ========================================== add new products ------------------------------------------ GIVEN: WHEN: - AddProductsReq skus:"one" skus:"two" + AddProductsReq skus:"one" skus:"two" THEN: - AddProductsResp uids:"00000000-0000-0000-0000-000000000001" uids:"00000000-0000-0000-0000-000000000002" + AddProductsResp uids:"00000000-0000-0000-0000-000000000001" uids:"00000000-0000-0000-0000-000000000002" EVENTS: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"one" - ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"two" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"one" + ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"two" ========================================== can't add product with duplicate skus ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" WHEN: AddProductsReq skus:"cola" ERROR: @@ -35,7 +35,7 @@ can't add multiple product with duplicate skus ------------------------------------------ GIVEN: WHEN: - AddProductsReq skus:"one" skus:"one" + AddProductsReq skus:"one" skus:"one" ERROR: AlreadyExists: already exists @@ -46,42 +46,42 @@ GIVEN: WHEN: AddLocationsReq locs:{name:"Shelf"} THEN: - AddLocationsResp locs:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000001"} + AddLocationsResp locs:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000001"} EVENTS: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" ========================================== add locations to an existing one ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH" WHEN: - AddLocationsReq locs:{name:"S1"} locs:{name:"S2"} parent:"00000000-0000-0000-0000-000000000001" + AddLocationsReq locs:{name:"S1"} locs:{name:"S2"} parent:"00000000-0000-0000-0000-000000000001" THEN: - AddLocationsResp locs:{name:"S1" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001"} locs:{name:"S2" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"} + AddLocationsResp locs:{name:"S1" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001"} locs:{name:"S2" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"} EVENTS: - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"S1" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"S2" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"S1" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"S2" parent:"00000000-0000-0000-0000-000000000001" ========================================== add nested locations to an existing one ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" WHEN: - AddLocationsReq locs:{name:"Shelf" locs:{name:"Box"}} parent:"00000000-0000-0000-0000-000000000001" + AddLocationsReq locs:{name:"Shelf" locs:{name:"Box"}} parent:"00000000-0000-0000-0000-000000000001" THEN: - AddLocationsResp locs:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001" locs:{name:"Box" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000002"}} + AddLocationsResp locs:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001" locs:{name:"Box" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000002"}} EVENTS: - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Box" parent:"00000000-0000-0000-0000-000000000002" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Box" parent:"00000000-0000-0000-0000-000000000002" ========================================== add location with wrong parent ------------------------------------------ GIVEN: WHEN: - AddLocationsReq locs:{name:"L"} parent:"00000000-0000-0000-0000-00000000002a" + AddLocationsReq locs:{name:"L"} parent:"00000000-0000-0000-0000-00000000002a" ERROR: NotFound: location not found @@ -99,7 +99,7 @@ insert duplicate location name in a batch ------------------------------------------ GIVEN: WHEN: - AddLocationsReq locs:{name:"W"} locs:{name:"W"} + AddLocationsReq locs:{name:"W"} locs:{name:"W"} ERROR: AlreadyExists: already exists @@ -107,7 +107,7 @@ ERROR: add location with duplicate name ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"W" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"W" WHEN: AddLocationsReq locs:{name:"W"} ERROR: @@ -117,49 +117,49 @@ ERROR: duplicates are OK, if they don't share a parent ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WHS1" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Inbox" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"WHS2" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WHS1" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Inbox" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"WHS2" WHEN: - AddLocationsReq locs:{name:"Inbox"} parent:"00000000-0000-0000-0000-000000000003" + AddLocationsReq locs:{name:"Inbox"} parent:"00000000-0000-0000-0000-000000000003" THEN: - AddLocationsResp locs:{name:"Inbox" uid:"00000000-0000-0000-0000-000000000004" parent:"00000000-0000-0000-0000-000000000003"} + AddLocationsResp locs:{name:"Inbox" uid:"00000000-0000-0000-0000-000000000004" parent:"00000000-0000-0000-0000-000000000003"} EVENTS: - LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Inbox" parent:"00000000-0000-0000-0000-000000000003" + LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Inbox" parent:"00000000-0000-0000-0000-000000000003" ========================================== query one specific location ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf1" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf1" WHEN: ListLocationsReq location:"00000000-0000-0000-0000-000000000001" THEN: - ListLocationsResp locs:{name:"Shelf1" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000"} + ListLocationsResp locs:{name:"Shelf1" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000"} ========================================== query all locations in a tree ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf1" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf2" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf1" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf2" parent:"00000000-0000-0000-0000-000000000001" WHEN: ListLocationsReq location:"00000000-0000-0000-0000-000000000001" THEN: - ListLocationsResp locs:{name:"WH" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000" chidren:{name:"Shelf1" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001"} chidren:{name:"Shelf2" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"}} + ListLocationsResp locs:{name:"WH" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000" chidren:{name:"Shelf1" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000001"} chidren:{name:"Shelf2" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"}} ========================================== query locations from another root ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH1" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WH2" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH1" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WH2" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" WHEN: ListLocationsReq location:"00000000-0000-0000-0000-000000000002" THEN: - ListLocationsResp locs:{name:"WH2" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000000"} + ListLocationsResp locs:{name:"WH2" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000000"} ========================================== query locations from non-existent location @@ -174,35 +174,35 @@ ERROR: query all locations ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH1" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WH2" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WH1" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WH2" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" WHEN: ListLocationsReq THEN: - ListLocationsResp locs:{name:"WH1" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000" chidren:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"}} locs:{name:"WH2" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000000"} + ListLocationsResp locs:{name:"WH1" uid:"00000000-0000-0000-0000-000000000001" parent:"00000000-0000-0000-0000-000000000000" chidren:{name:"Shelf" uid:"00000000-0000-0000-0000-000000000003" parent:"00000000-0000-0000-0000-000000000001"}} locs:{name:"WH2" uid:"00000000-0000-0000-0000-000000000002" parent:"00000000-0000-0000-0000-000000000000"} ========================================== move locations ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" WHEN: - MoveLocationReq uid:"00000000-0000-0000-0000-000000000002" newParent:"00000000-0000-0000-0000-000000000001" + MoveLocationReq uid:"00000000-0000-0000-0000-000000000002" newParent:"00000000-0000-0000-0000-000000000001" THEN: MoveLocationResp EVENTS: - LocationMoved uid:"00000000-0000-0000-0000-000000000002" oldParent:"00000000-0000-0000-0000-000000000000" newParent:"00000000-0000-0000-0000-000000000001" + LocationMoved uid:"00000000-0000-0000-0000-000000000002" oldParent:"00000000-0000-0000-0000-000000000000" newParent:"00000000-0000-0000-0000-000000000001" ========================================== recursive locations are not allowed ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" parent:"00000000-0000-0000-0000-000000000001" WHEN: - MoveLocationReq uid:"00000000-0000-0000-0000-000000000001" newParent:"00000000-0000-0000-0000-000000000002" + MoveLocationReq uid:"00000000-0000-0000-0000-000000000001" newParent:"00000000-0000-0000-0000-000000000002" ERROR: FailedPrecondition: bad location move @@ -210,9 +210,9 @@ ERROR: don't move location to itself ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" WHEN: - MoveLocationReq uid:"00000000-0000-0000-0000-000000000001" newParent:"00000000-0000-0000-0000-000000000001" + MoveLocationReq uid:"00000000-0000-0000-0000-000000000001" newParent:"00000000-0000-0000-0000-000000000001" ERROR: FailedPrecondition: bad location move @@ -220,9 +220,9 @@ ERROR: can't touch root ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" WHEN: - MoveLocationReq uid:"00000000-0000-0000-0000-000000000000" newParent:"00000000-0000-0000-0000-000000000001" + MoveLocationReq uid:"00000000-0000-0000-0000-000000000000" newParent:"00000000-0000-0000-0000-000000000001" ERROR: FailedPrecondition: bad location move @@ -230,10 +230,10 @@ ERROR: query locations after removal ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:-3 + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"NVidia" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:3 OnHand:3 + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:-3 WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: @@ -243,157 +243,157 @@ THEN: query inventory at a specific location ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Cola" - ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"Fanta" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:2 OnHand:2 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Cola" + ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"Fanta" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:2 OnHand:2 WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000002" OnHand:2 Available:2} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000002" OnHand:2 Available:2} ========================================== two boxes sum up their quantity at root ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Epyc" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf1" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf2" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Epyc" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf1" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf2" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000000" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:5 Available:5} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:5 Available:5} ========================================== boxes sums up quantity with parent container ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Epyc" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Bin" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Epyc" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Bin" parent:"00000000-0000-0000-0000-000000000001" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:5 Available:5} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:5 Available:5} ========================================== query inventory at root ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Cola" - ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"Fanta" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:2 OnHand:2 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"Cola" + ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"Fanta" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:2 OnHand:2 WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000000" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000002" OnHand:2 Available:2} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000002" OnHand:2 Available:2} ========================================== moving container to warehouse increases total quantity ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 - LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" - InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 + LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" + InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:15 Available:15} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:15 Available:15} ========================================== moving container to warehouse increases unloading quantity ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 - LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" - InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 + LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" + InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000002" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:10} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:10} ========================================== moving container with a reservation ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" - LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale1" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000003"} - LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" - InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000002" code:"sale3" items:{product:"00000000-0000-0000-0000-000000000001" quantity:9 location:"00000000-0000-0000-0000-000000000004"} - LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia 4080" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Unloading" parent:"00000000-0000-0000-0000-000000000001" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Shelf" parent:"00000000-0000-0000-0000-000000000001" + InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:5 OnHand:5 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale1" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000003"} + LocationAdded uid:"00000000-0000-0000-0000-000000000004" name:"Container" + InventoryUpdated location:"00000000-0000-0000-0000-000000000004" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000002" code:"sale3" items:{product:"00000000-0000-0000-0000-000000000001" quantity:9 location:"00000000-0000-0000-0000-000000000004"} + LocationMoved uid:"00000000-0000-0000-0000-000000000004" newParent:"00000000-0000-0000-0000-000000000002" WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:15 Available:3} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:15 Available:3} ========================================== reservation at location reduces availability at location ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000001" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:7} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:7} ========================================== reservation at location reduces availability globally ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000000" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:7} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:7} ========================================== multiple reservations stack ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale1" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} - Reserved reservation:"00000000-0000-0000-0000-000000000002" code:"sale2" items:{product:"00000000-0000-0000-0000-000000000001" quantity:4 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"pixel" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Warehouse" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale1" items:{product:"00000000-0000-0000-0000-000000000001" quantity:3 location:"00000000-0000-0000-0000-000000000001"} + Reserved reservation:"00000000-0000-0000-0000-000000000002" code:"sale2" items:{product:"00000000-0000-0000-0000-000000000001" quantity:4 location:"00000000-0000-0000-0000-000000000001"} WHEN: GetLocInventoryReq location:"00000000-0000-0000-0000-000000000000" THEN: - GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:3} + GetLocInventoryResp items:{Product:"00000000-0000-0000-0000-000000000001" OnHand:10 Available:3} ========================================== don't allow negative on-hand ------------------------------------------ GIVEN: - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"NVidia" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + ProductAdded uid:"00000000-0000-0000-0000-000000000002" sku:"NVidia" WHEN: - UpdateInventoryReq location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:-1 + UpdateInventoryReq location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000002" OnHandChange:-1 ERROR: FailedPrecondition: not enough quantity @@ -401,40 +401,40 @@ ERROR: reserve sale with one item ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} THEN: - ReserveResp reservation:"00000000-0000-0000-0000-000000000001" + ReserveResp reservation:"00000000-0000-0000-0000-000000000003" EVENTS: - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10} + Reserved reservation:"00000000-0000-0000-0000-000000000003" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10} ========================================== reserve sale in a specific location ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000001" + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000002" THEN: - ReserveResp reservation:"00000000-0000-0000-0000-000000000001" + ReserveResp reservation:"00000000-0000-0000-0000-000000000003" EVENTS: - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10 location:"00000000-0000-0000-0000-000000000001"} + Reserved reservation:"00000000-0000-0000-0000-000000000003" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10 location:"00000000-0000-0000-0000-000000000002"} ========================================== reservation codes must be unique ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:1 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Shelf" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:1 location:"00000000-0000-0000-0000-000000000002"} WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:1} location:"00000000-0000-0000-0000-000000000001" + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:1} location:"00000000-0000-0000-0000-000000000002" ERROR: AlreadyExists: already exists @@ -442,12 +442,12 @@ ERROR: reserve sale in a specific location that doesn't have quantity ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Empty" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Shelf" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Empty" + ProductAdded uid:"00000000-0000-0000-0000-000000000003" sku:"GPU" + InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000003" OnHandChange:10 OnHand:10 WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000002" + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000002" ERROR: FailedPrecondition: not enough quantity @@ -456,7 +456,7 @@ reserve non-existent sku ------------------------------------------ GIVEN: WHEN: - ReserveReq reservation:"test" items:{sku:"sale" quantity:1} + ReserveReq reservation:"test" items:{sku:"sale" quantity:1} ERROR: NotFound: product not found @@ -464,11 +464,11 @@ ERROR: reserve when onHand isn't enough ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WHS1" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WHS1" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 WHEN: - ReserveReq reservation:"test" items:{sku:"cola" quantity:3} + ReserveReq reservation:"test" items:{sku:"cola" quantity:3} ERROR: FailedPrecondition: not enough quantity @@ -476,12 +476,12 @@ ERROR: over-reserve ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"WHS1" - InventoryUpdated location:"00000000-0000-0000-0000-000000000001" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:1 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"cola" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"WHS1" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:2 OnHand:2 + Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:1 location:"00000000-0000-0000-0000-000000000002"} WHEN: - ReserveReq reservation:"test" items:{sku:"cola" quantity:2} + ReserveReq reservation:"test" items:{sku:"cola" quantity:2} ERROR: FailedPrecondition: not enough quantity @@ -489,27 +489,27 @@ ERROR: reserve in a location that contains enough inside ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Box" parent:"00000000-0000-0000-0000-000000000002" + InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000001" + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:10} location:"00000000-0000-0000-0000-000000000002" THEN: - ReserveResp reservation:"00000000-0000-0000-0000-000000000001" + ReserveResp reservation:"00000000-0000-0000-0000-000000000004" EVENTS: - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10 location:"00000000-0000-0000-0000-000000000001"} + Reserved reservation:"00000000-0000-0000-0000-000000000004" code:"sale" items:{product:"00000000-0000-0000-0000-000000000001" quantity:10 location:"00000000-0000-0000-0000-000000000002"} ========================================== reserve in a location that doesn't have enough inside ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 WHEN: - ReserveReq reservation:"sale" items:{sku:"GPU" quantity:11} location:"00000000-0000-0000-0000-000000000001" + ReserveReq reservation:"sale" items:{sku:"GPU" quantity:11} location:"00000000-0000-0000-0000-000000000001" ERROR: FailedPrecondition: not enough quantity @@ -517,29 +517,29 @@ ERROR: reserve box while container has a reservation on top of it (enough) ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale0" items:{product:"00000000-0000-0000-0000-000000000001" quantity:5 location:"00000000-0000-0000-0000-000000000001"} + ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Container" + LocationAdded uid:"00000000-0000-0000-0000-000000000003" name:"Box" parent:"00000000-0000-0000-0000-000000000002" + InventoryUpdated location:"00000000-0000-0000-0000-000000000003" product:"00000000-0000-0000-0000-000000000001" OnHandChange:10 OnHand:10 + Reserved reservation:"00000000-0000-0000-0000-000000000004" code:"sale0" items:{product:"00000000-0000-0000-0000-000000000001" quantity:5 location:"00000000-0000-0000-0000-000000000002"} WHEN: - ReserveReq reservation:"sale2" items:{sku:"GPU" quantity:4} location:"00000000-0000-0000-0000-000000000002" + ReserveReq reservation:"sale2" items:{sku:"GPU" quantity:4} location:"00000000-0000-0000-0000-000000000003" THEN: - ReserveResp reservation:"00000000-0000-0000-0000-000000000002" + ReserveResp reservation:"00000000-0000-0000-0000-000000000005" EVENTS: - Reserved reservation:"00000000-0000-0000-0000-000000000002" code:"sale2" items:{product:"00000000-0000-0000-0000-000000000001" quantity:4 location:"00000000-0000-0000-0000-000000000002"} + Reserved reservation:"00000000-0000-0000-0000-000000000005" code:"sale2" items:{product:"00000000-0000-0000-0000-000000000001" quantity:4 location:"00000000-0000-0000-0000-000000000003"} ========================================== reserve box while container has a reservation on top of it (not enough) ------------------------------------------ GIVEN: - ProductAdded uid:"00000000-0000-0000-0000-000000000001" sku:"GPU" - LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" - LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" - InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000001" OnHandChange:3 OnHand:3 - Reserved reservation:"00000000-0000-0000-0000-000000000001" code:"sale0" items:{product:"00000000-0000-0000-0000-000000000001" quantity:2 location:"00000000-0000-0000-0000-000000000001"} + LocationAdded uid:"00000000-0000-0000-0000-000000000001" name:"Container" + LocationAdded uid:"00000000-0000-0000-0000-000000000002" name:"Box" parent:"00000000-0000-0000-0000-000000000001" + ProductAdded uid:"00000000-0000-0000-0000-000000000003" sku:"GPU" + InventoryUpdated location:"00000000-0000-0000-0000-000000000002" product:"00000000-0000-0000-0000-000000000003" OnHandChange:3 OnHand:3 + Reserved reservation:"00000000-0000-0000-0000-000000000004" code:"sale0" items:{product:"00000000-0000-0000-0000-000000000003" quantity:2 location:"00000000-0000-0000-0000-000000000001"} WHEN: - ReserveReq reservation:"sale2" items:{sku:"GPU" quantity:2} location:"00000000-0000-0000-0000-000000000002" + ReserveReq reservation:"sale2" items:{sku:"GPU" quantity:2} location:"00000000-0000-0000-0000-000000000002" ERROR: FailedPrecondition: not enough quantity