Skip to content

ATS-COM-FUL-018Allocate stock and explain what buyers can obtain: Acceptance Test Set

Markdown

ATS-COM-FUL-018

Allocate stock and explain what buyers can obtain: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-FUL-018

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision1

Read atservices-commerce c8b66a98

Test Scenarios

7 scenarios proving CAP-COM-FUL-018; 7 bound to an existing test.

01 Claims retain individual units and allocation orderapitest
Proves
BR-CAP-COM-FUL-018-01
Preconditions
Two sellable bins hold stock.
Steps
Claim two units for one line and repeat.
Expected
The first location supplies two numbered commitments and repetition creates no duplicates.
Data
Fixtures for claims retain individual units and allocation order.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#answers ok with one committed claim for the SKU and the quantity, under the claim ref the line is stamped with
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#writes one committed unit per unit on the first location in allocation order, unit 0 and 1, each stamped with the order and the line
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#answers the same claim again for the same line without writing twice (idempotent on the line)
Source
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#answers ok with one committed claim for the SKU and the quantity, under the claim ref the line is stamped with
02 Product policy decides shortage refusal or backorderapinegativetest
Proves
BR-CAP-COM-FUL-018-02
Preconditions
Products differ on backorder permission and have too little stock.
Steps
Claim excess quantity and exercise an absent location item.
Expected
The strict product fails, the permissive product commits and backorders, and the missing item is created where needed.
Data
Fixtures for product policy decides shortage refusal or backorder.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#is refused insufficient_stock with nothing written when the product prohibits backorders (the last cap)
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#commits what exists and backorders the rest when the product allows it (A12), the shortfall counting as backordered, never against available
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#backorders a SKU no item holds yet by making its item at the first sellable location, when the product allows it
Source
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#is refused insufficient_stock with nothing written when the product prohibits backorders (the last cap)
03 Concurrent buyers cannot share the final stockapinegativetest
Proves
BR-CAP-COM-FUL-018-03 BR-CAP-COM-FUL-018-08
Preconditions
Ten carts compete for one unit and a shipment can consume it.
Steps
Race placements and separately race claim against shipment.
Expected
One placement wins, other carts conflict and a shipped unit is not claimed again.
Data
Fixtures for concurrent buyers cannot share the final stock.
Bound to
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#lets exactly one placement win and refuses the nine others 409 claim_conflict naming the item, the SKU and insufficient_stock
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#refuses a placement made after the last cap was gone with the same 409 claim_conflict and insufficient_stock, never a preparation refusal (D-P8I-21)
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#answers the second, once it gets the row, insufficient_stock, with nothing written for it
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#answers the claim, once it gets the row, insufficient_stock: the unit the shipment took is not claimed twice
Source
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#lets exactly one placement win and refuses the nine others 409 claim_conflict naming the item, the SKU and insufficient_stock
04 Early holds retain extension and release limitsapinegativetest
Proves
BR-CAP-COM-FUL-018-04 BR-CAP-COM-FUL-018-09
Preconditions
Checkout holds two limited-stock units.
Steps
Extend within the permitted window, exceed it, place and void.
Expected
The excessive extension fails, placement commits the units and void releases them.
Data
Fixtures for early holds retain extension and release limits.
Bound to
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#holds the two caps for the item under hold:<item> (the units held with the product’s expiry), and the shelf shows one left
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#extends the hold within the window and refuses one past it, 409 hold_not_extendable
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#converts the held units to committed on the line at placement, and the void releases them (reason void), the stock back
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#converts the held unit to committed on the line, answering the hold’s ref as the claim
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#refuses a hold that is not held (converted already, or never made): hold_not_found
Source
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#holds the two caps for the item under hold:<item> (the units held with the product’s expiry), and the shelf shows one left
05 Allocation constraints enforce one-unit state recordsapinegativetest
Proves
BR-CAP-COM-FUL-018-05
Preconditions
A stock item is available for direct ledger fixtures.
Steps
Try missing hold or commitment references, duplicate holds, multi-unit rows and item changes.
Expected
All invalid rows fail and valid state changes affect held or allocated balances.
Data
Fixtures for allocation constraints enforce one-unit state records.
Bound to
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#counts a held row against held, a committed one against allocated and a released one against nothing, through the trigger
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses a held row without a checkout item or an expiry, and a committed row without a line, by inventory_allocations_holder_check and inventory_allocations_held_until_check
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses a second live hold of one checkout item and unit, by inventory_allocations_hold_unit_uidx, and a quantity other than one, by inventory_allocations_quantity_check
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses a hold the stock cannot cover, by inventory_items_balances_check: available never falls below zero
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses moving a row to another item, SQLSTATE RHC05 (the trigger), and a release reason outside the contract’s
Source
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#counts a held row against held, a committed one against allocated and a released one against nothing, through the trigger
06 Availability uses consistent product statesapitest
Proves
BR-CAP-COM-FUL-018-06
Preconditions
Fixtures include limited stock, permitted backorders and untracked goods.
Steps
Read storefront availability for each requested quantity.
Expected
Results distinguish limited, unavailable and backorder states while untracked goods remain available without counts.
Data
Fixtures for availability uses consistent product states.
Bound to
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#answers the availability in the storefront’s words: limited with what is left, unavailable for more than the shelf has, backorder for the shirt, available for a product it does not track
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#answers the storefront’s words: limited with what is left, backorder with the shortfall for the shirt, unavailable for the cap, available for a product it does not track
Source
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#answers the availability in the storefront’s words: limited with what is left, unavailable for more than the shelf has, backorder for the shirt, available for a product it does not track
07 Void and cancellation release only their owned unitsapitest
Proves
BR-CAP-COM-FUL-018-07
Preconditions
Separate orders contain committed units and a partial cancellation.
Steps
Void one order and deliver the other's selected cancellation.
Expected
Void releases all its commitments and partial cancellation releases only its named unit.
Data
Fixtures for void and cancellation release only their owned units.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#releases a line’s committed units on a void, giving the stock back; a release naming nothing live answers released: []
services-commerce:modules/shipping/tests/e2e/post-purchase-shipping.e2e.spec.js#delivers the cancel to the Merchandise participant: unit 2 released, the kept units unfenced and picked, the document completed, the memo and the refund after the domain
Source
services-commerce:modules/inventory/tests/integration/services/stock/merchandise-claims.integration.spec.js#releases a line’s committed units on a void, giving the stock back; a release naming nothing live answers released: []

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.