---
id: TST-COM-FUL-059
title: Inventory tables table
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/db/inventory-tables.table.integration.spec.js
implements:
  - ATS-COM-FUL-016-01
  - ATS-COM-FUL-016-02
  - ATS-COM-FUL-017-01
  - ATS-COM-FUL-017-02
  - ATS-COM-FUL-018-05
  - ATS-COM-FUL-019-02
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/db/inventory-tables.table.integration.spec.js
    test_titles:
      - >-
        holds the warehouse, its padded name trimmed by the text-normalization trigger, and the item
        with every balance zero (premise)
      - >-
        refuses an id that is not a configuration id, by warehouses_id_configuration_id_check, and a
        negative priority by warehouses_fulfillment_priority_check
      - >-
        refuses two locations of one warehouse with one code, by inventory_locations_code_uq, and a
        kind outside the six, by inventory_locations_kind_check
      - >-
        refuses a location of a warehouse the tenant does not have, by
        inventory_locations_warehouse_fk, another tenant’s included
      - >-
        refuses deleting a warehouse its locations and items still name (RESTRICT), by one of its
        warehouse keys
      - >-
        refuses a second item of one SKU at one location, by inventory_items_sku_location_uq, and
        lets another location take it
      - >-
        refuses the application role a balance: UPDATE on on_hand is 42501 (the column grant), while
        its settings are its to change
      - >-
        refuses the application role an insert that names a balance, 42501, and admits one that
        leaves the balances to their defaults
      - >-
        moves on_hand by a receipt through the trigger, quarantined by a quarantine_in and damaged
        by a damage, and available follows
      - >-
        refuses a quantity whose sign the type forbids, by inventory_movements_quantity_sign_check,
        and a type outside the twelve
      - >-
        refuses a movement the shelf cannot bear, by inventory_items_balances_check (the last line
        of defence), leaving the balances as they were
      - >-
        refuses a second movement under one idempotency key, by
        inventory_movements_idempotency_key_uq
      - 'is append-only: the application role cannot update or delete a movement (42501)'
      - 'refuses a movement of an item the tenant does not have, by inventory_movements_item_fk'
      - >-
        counts a held row against held, a committed one against allocated and a released one against
        nothing, through the trigger
      - >-
        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
      - >-
        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
      - >-
        refuses a hold the stock cannot cover, by inventory_items_balances_check: available never
        falls below zero
      - >-
        refuses moving a row to another item, SQLSTATE RHC05 (the trigger), and a release reason
        outside the contract’s
      - >-
        refuses a completed count without its instant, by inventory_counts_completed_check, and a
        line of a count the tenant does not have, by inventory_count_lines_count_fk
      - >-
        refuses two open findings of one kind about one subject, by inventory_exceptions_open_uidx,
        and a kind outside the six
      - 'shows a tenant only its own rows, with no predicate in the statement'
    scenario_anchors:
      - >-
        services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses
        an id that is not a configuration id, by warehouses_id_configuration_id_check, and a
        negative priority by warehouses_fulfillment_priority_check
      - >-
        services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses
        deleting a warehouse its locations and items still name (RESTRICT), by one of its warehouse
        keys
      - >-
        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/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/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
      - >-
        services-commerce:modules/inventory/tests/integration/db/inventory-tables.table.integration.spec.js#refuses
        two open findings of one kind about one subject, by inventory_exceptions_open_uidx, and a
        kind outside the six
---

# Inventory tables table

## Verification Boundary

This suite checks inventory tables table 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.

## 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.
