---
id: TST-COM-FUL-066
title: Staff movements
kind: integration
product_area: commerce
module: fulfillment
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-commerce
files:
  - modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js
implements:
  - ATS-COM-FUL-017-01
  - ATS-COM-FUL-017-02
  - ATS-COM-FUL-017-03
  - ATS-COM-FUL-017-04
  - ATS-COM-FUL-018-06
  - ATS-COM-FUL-019-01
  - ATS-COM-FUL-019-02
  - FAS-COM-FUL-04-01
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  Run-created workspace identifiers and fixture records in the prepared test database; concurrency
  cases own their extra connections.
evidence:
  - repository: services-commerce
    path: modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js
    test_titles:
      - >-
        records the receipt once: the item made at A1 with the ten on hand, the retry answering the
        same movement unrecorded
      - >-
        moves quarantined and damaged beside on_hand, and a scrap off it; available is what is left
        to sell
      - >-
        refuses a receipt of a negative quantity and a scrap of a positive one (400), and a movement
        of a SKU nothing holds
      - 'refuses a movement the shelf cannot bear, 400 naming the balance rule, writing nothing'
      - >-
        refuses the receipt key reused for another SKU or quantity, 409 idempotency_key_reused
        naming the first movement, writing nothing (DEF-COM-0452)
      - 'lists the item’s movements (all four) and the tenant’s by type, product and key'
      - >-
        counted the two backordered units against backordered, never against available, before the
        receipt
      - >-
        converts both backordered units to committed in the receipt’s transaction, oldest order
        first, leaving one to sell
      - >-
        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
      - >-
        opens the count open with no lines, records the lines with what the shelf expected, and
        completes it with one correction for the variance
      - 'leaves the shelf as counted, stamped last_counted_at on both items'
      - >-
        refuses lines on a completed count and a second completion (409), and the cancelled count
        wrote nothing
      - lists the counts by state and reads one with its lines
      - >-
        is raised open, acknowledged, resolved with its resolution, and raised again as a new row
        once resolved
    scenario_anchors:
      - >-
        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
      - >-
        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/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/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/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
      - >-
        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/services/stock/staff-movements.integration.spec.js#leaves
        the shelf as counted, stamped last_counted_at on both items
      - >-
        services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#refuses
        lines on a completed count and a second completion (409), and the cancelled count wrote
        nothing
      - >-
        services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js#is
        raised open, acknowledged, resolved with its resolution, and raised again as a new row once
        resolved
      - >-
        services-commerce:modules/inventory/tests/integration/services/stock/staff-movements.integration.spec.js
---

# Staff movements

## Verification Boundary

This suite checks staff movements against the prepared PostgreSQL database. Its entry points are the persistence and service functions used by the tests.

## What This Suite Proves

The bound scenarios identify the assertions this suite contributes. Source anchors retain the exact test cases; where a capability scenario has several contributing suites, a single binding does not imply that every branch runs here.

## What It Does Not Prove

Direct service and persistence calls do not establish the full HTTP permission contract, deployed scheduling or browser behavior. No execution result is claimed by this register.

## Real Dependencies and Test Doubles

The database and imported Commerce persistence services are real. Fixtures create the records owned by this run. Time-sensitive cases use a controlled clock where the source fixture supplies one.

## Must Not Be Doubled

Keep the database constraints, row visibility and persistence writes real when claiming this integration coverage. A canned repository response cannot replace the boundary being checked.
