Skip to content

ATS-COM-FUL-017Keep stock movements and transfers accountable: Acceptance Test Set

Markdown

ATS-COM-FUL-017

Keep stock movements and transfers accountable: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-FUL-017

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision1

Read atservices-commerce c8b66a98

Test Scenarios

6 scenarios proving CAP-COM-FUL-017; 6 bound to an existing test.

01 Staff movement validation protects operational typesapinegativetest
Proves
BR-CAP-COM-FUL-017-01 BR-CAP-COM-FUL-017-02 BR-CAP-COM-FUL-017-06
Preconditions
A stock item exists at a bin.
Steps
Record allowed receipt, quarantine and scrap, then try shipment type, negative receipt and absent-SKU scrap.
Expected
Allowed ledger entries succeed and invalid staff movements fail.
Data
Fixtures for staff movement validation protects operational types.
Bound to
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#moves quarantined beside on_hand and a scrap off it; refuses what the shelf cannot bear (400 naming the rule), a wrong sign (400) and a type staff do not record (400)
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses a quantity whose sign the type forbids, by inventory_movements_quantity_sign_check, and a type outside the twelve
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#refuses a receipt of a negative quantity and a scrap of a positive one (400), and a movement of a SKU nothing holds
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#moves quarantined and damaged beside on_hand, and a scrap off it; available is what is left to sell
Source
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#moves quarantined beside on_hand and a scrap off it; refuses what the shelf cannot bear (400 naming the rule), a wrong sign (400) and a type staff do not record (400)
02 Balances and movement history reject direct alterationapinegativetest
Proves
BR-CAP-COM-FUL-017-03 BR-CAP-COM-FUL-017-04 BR-CAP-COM-FUL-017-11
Preconditions
Five units are on hand.
Steps
Try direct balance edit, six-unit scrap and movement mutations, then change item settings.
Expected
Invalid balance and ledger edits fail while settings alone can change.
Data
Fixtures for balances and movement history reject direct alteration.
Bound to
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses the application role a balance: UPDATE on on_hand is 42501 (the column grant), while its settings are its to change
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses a movement the shelf cannot bear, by inventory_items_balances_check (the last line of defence), leaving the balances as they were
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#is append-only: the application role cannot update or delete a movement (42501)
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#refuses a movement the shelf cannot bear, 400 naming the balance rule, writing nothing
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#changes an item’s settings (and nothing of its balances), 404 for an item the tenant has not
Source
services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses the application role a balance: UPDATE on on_hand is 42501 (the column grant), while its settings are its to change
03 Movement retries require the same payloadunitnegativetest
Proves
BR-CAP-COM-FUL-017-05
Preconditions
A receipt is stored under an idempotency key.
Steps
Repeat by matching details and item identity, then change SKU, quantity, type or location.
Expected
Matching retries return the stored movement and changed requests reject key reuse.
Data
Fixtures for movement retries require the same payload.
Bound to
services-commerce:modules/inventory/tests/unit/stock/staff-movement-keys.spec.js#is the same movement when the retry restates the type, the quantity and the item by product, SKU and location
services-commerce:modules/inventory/tests/unit/stock/staff-movement-keys.spec.js#is another movement when the key arrives with another SKU and quantity (the pads under the pens’ key)
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#refuses the receipt key reused for another SKU or quantity, 409 idempotency_key_reused naming the first movement, writing nothing (DEF-COM-0452)
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#records the receipt once, the item made at A1 with the five on hand, the retry answering the same movement unrecorded and no backorder filled
Source
services-commerce:modules/inventory/tests/unit/stock/staff-movement-keys.spec.js#is the same movement when the retry restates the type, the quantity and the item by product, SKU and location
04 Receipt commits the oldest waiting backordersapitest
Proves
BR-CAP-COM-FUL-017-07
Preconditions
Two units of a SKU are backordered.
Steps
Receive three units into sellable stock.
Expected
Both backorders become committed oldest first and one unit remains available.
Data
Fixtures for receipt commits the oldest waiting backorders.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#converts both backordered units to committed in the receipt’s transaction, oldest order first, leaving one to sell
services-commerce:modules/inventory/tests/e2e/merchandise-placement.e2e.spec.js#fills the backordered unit in the receipt’s transaction: committed, counted against allocated, four left to sell, both obligations still in progress
Source
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#converts both backordered units to committed in the receipt’s transaction, oldest order first, leaving one to sell
05 Transfer preserves linked stock and cost changesapitest
Proves
BR-CAP-COM-FUL-017-08
Preconditions
Seven source units have two cost layers.
Steps
Move five units to another bin and replay the transfer.
Expected
One linked movement pair and destination item survive, cost is carried at weighted value without posting and repetition moves nothing.
Data
Fixtures for transfer preserves linked stock and cost changes.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#writes the pair in one transfer: a transfer_out of five on A1’s item and a transfer_in of five on A2’s, one id, each naming the other
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#makes the destination item, and moves on-hand on both: A1 seven to two, A2 none to five
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#relieves the source’s layers oldest first under transfer_out (four at 1000, one at 1301), naming the transfer_out movement
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#answers a retry under the key with the same transfer and moves nothing twice
Source
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#writes the pair in one transfer: a transfer_out of five on A1’s item and a transfer_in of five on A2’s, one id, each naming the other
06 Transfer guards exclude unavailable or invalid quantitiesapinegativetest
Proves
BR-CAP-COM-FUL-017-09 BR-CAP-COM-FUL-017-10 BR-CAP-COM-FUL-017-12
Preconditions
Some source stock is allocated and a reader is available.
Steps
Try over-transfer, allocated stock, same destination, zero, unknown SKU, conflicting key and reader transfer.
Expected
Every invalid request fails without a transfer, including attempts to move backorder-filled units.
Data
Fixtures for transfer guards exclude unavailable or invalid quantities.
Bound to
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#refuses more than the source has available 409 insufficient_available, and writes nothing
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#never moves an allocated unit: the two caps left on A1 claimed by an order, a transfer of one is refused
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#refuses the same location twice 400 same_location and a quantity of zero 400 quantity_not_positive
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#refuses a second transfer of the filled units 409 insufficient_available: they are the buyer’s now
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#lets a reader list the transfers and refuses it a transfer 403 permission_missing; a denied principal 403 app_not_permitted; no context 401; tenant B none
Source
services-commerce:modules/inventory/tests/integration/services/stock/inventory-transfers.integration.spec.js#refuses more than the source has available 409 insufficient_available, and writes nothing

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.