Skip to content

ATS-COM-FUL-017Keep stock movements and transfers accountable: Capability Test Specification

Markdown

ATS-COM-FUL-017

Keep stock movements and transfers accountable: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision2

Read atservices-commerce c8b66a98react-console baf6dae3

Coverage

  • Rule gap: FND-COM-FUL-072
  • Transition gap: FND-COM-FUL-072
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure gap: FND-COM-FUL-072
  • Boundary gap: FND-COM-FUL-072
  • Concurrency gap: FND-COM-FUL-072
  • Invariant covered
  • Interaction covered

Test Scenarios

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

01 Staff movement validation protects operational typesvalidationapinegativetest
Proves
BR-CAP-COM-FUL-017-01 BR-CAP-COM-FUL-017-02 BR-CAP-COM-FUL-017-06 INV-DOM-COM-FUL-005-03
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 alterationinvariantapinegativetest
Proves
BR-CAP-COM-FUL-017-03 BR-CAP-COM-FUL-017-04 BR-CAP-COM-FUL-017-11 INV-DOM-COM-FUL-005-01 INV-DOM-COM-FUL-005-02 INV-DOM-COM-FUL-005-03
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 payloadedgeunitnegativetest
Proves
BR-CAP-COM-FUL-017-05 INV-DOM-COM-FUL-005-04
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 backordersinteractionapitest
Proves
BR-CAP-COM-FUL-017-07 INV-DOM-COM-FUL-005-09
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 changesinvariantapitest
Proves
BR-CAP-COM-FUL-017-08 INV-DOM-COM-FUL-005-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 quantitiespermissionapinegativetest
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
07 Replenishment creates the second dispatch waveinteractionapitest
Proves
BR-CAP-COM-FUL-012-02 BR-CAP-COM-FUL-017-07 BR-CAP-COM-FUL-018-02 BR-CAP-COM-FUL-014-01
Preconditions
A five-shirt order has three available units and two backorders.
Steps
Ship the first wave, receive two more shirts and create and ship the next wave.
Expected
The second wave contains only the two replenished units; all five obligations complete.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Bound to
services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#makes the first wave of the three picked units (0..2), charged what the order paid, and walks it to the handoff
services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#fills the two backorders at the receipt, and the second wave picks the filled units at its creation (3..4) and ships them
services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#completes the order’s shipping: every unit shipped, every obligation completed, the shelf down five, the cost facts emitted per wave
Source
services-commerce:modules/shipping/tests/e2e/shipping.e2e.spec.js#makes the first wave of the three picked units (0..2), charged what the order paid, and walks it to the handoff,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/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/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#hands off: the line handed to the carrier with its whole quantity shipped, the units shipped in the ledger, one shipment movement of minus three on the item, three fewer on hand
08 Returned stock becomes available through the movement ledgerinteractionapiproposed
Proves
BR-CAP-COM-FUL-015-05 BR-CAP-COM-FUL-017-03 BR-CAP-COM-FUL-018-06
Preconditions
Two shipped shirts return under a restock-permitting authorization.
Steps
Receive and inspect them, restock to the original sellable location and read availability and movements.
Expected
The returned quantity has a restock entry and is available to buyers; receiving alone adds no stock.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Source
services-commerce:modules/shipping/tests/integration/services/returns/return-receiving.integration.spec.js#restocks the two units at the bin they shipped from: the return_restock movement naming the disposition, on hand up two, the two reliefs reversed at 1500 with the restore_cogs fact of 3000,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/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
09 An inactive warehouse refuses receipt and allocationinteractionapiproposed
Proves
BR-CAP-COM-FUL-018-01 INV-DOM-COM-FUL-005-12
Preconditions
The only sellable location belongs to an inactive warehouse.
Steps
Attempt a receipt and a placement claim, then repeat after authorized activation.
Expected
Inactive-place work is refused; active-place work is considered under its normal stock guards.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Source
services-commerce:modules/inventory/tests/e2e/inventory.e2e.spec.js#lets a reader list and read everything, and refuses it every write 403 permission_missing,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/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
10 Place ordering controls the units claimed from received stockinteractionapiproposed
Proves
BR-CAP-COM-FUL-016-05 BR-CAP-COM-FUL-017-01 BR-CAP-COM-FUL-018-01
Preconditions
Two active sellable bins have different pick priorities and receive the same SKU.
Steps
Receive stock in both and claim two units, then inspect their item and location references.
Expected
The claim uses the earlier sellable location before the later one.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Source
services-commerce:modules/inventory/tests/integration/services/persistence/inventory-configuration.integration.spec.js#answers the sellable locations across warehouses in allocation order: the main warehouse (priority 1) before the depot (2), bins by pick priority, quarantine and returns left out,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/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
11 A shelf count corrects the ledger and changes availabilityinteractionapiproposed
Proves
BR-CAP-COM-FUL-019-02 BR-CAP-COM-FUL-017-03 BR-CAP-COM-FUL-018-06
Preconditions
A sellable item holds ten units and a scoped count observes eight.
Steps
Complete the count, inspect its correction movement and read availability.
Expected
The count retains one correction and buyers see the corrected stock; repeated completion changes nothing.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Source
services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#opens the count open with no lines, records the lines with what the shelf expected, and completes it with one correction for the variance,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/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
12 Imported opening stock participates in the normal ledgerinteractionapitest
Proves
BR-CAP-COM-FUL-020-12 BR-CAP-COM-FUL-017-03
Preconditions
An implementation workspace has a migrated warehouse, location and product source identity.
Steps
Import twelve units with two damaged, read back the source key and inspect live balances and movements.
Expected
The item has ten available units, backed by count and damage entries; an inactive destination refuses a new item.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Bound to
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#opens the mug’s item through the ledger: a count correction of twelve and a damage of two, so the trigger holds ten available
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#opens the cap’s item under the product’s own SKU at the default location, with no movement for a count of nought
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#refuses the same key loaded again as that item’s invalid value, moving nothing
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#refuses an item at an inactive location as that item’s refusal, as the implicit creation would
Source
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#opens the mug’s item through the ledger: a count correction of twelve and a damage of two, so the trigger holds ten available,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/e2e/inventory.e2e.spec.js#lets a reader list and read everything, and refuses it every write 403 permission_missing

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.