---
id: FAS-COM-ORD-07
title: Vendor purchasing and stock value
feature: FEAT-COM-ORD-07
product_area: commerce
module: orders
revision: 1
status: proposed
product_intent: proposed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
capabilities:
  - CAP-COM-ORD-017
  - CAP-COM-ORD-018
scenarios:
  - id: FAS-COM-ORD-07-01
    title: A vendor commitment produces stock and acquisition evidence
    kind: behaviour
    exercises:
      - CAP-COM-ORD-017
      - CAP-COM-ORD-018
    relies_on:
      - ATS-COM-ORD-017-03
      - ATS-COM-ORD-018-03
    preconditions: A vendor purchase covers one hundred units at ten dollars each.
    steps:
      - do: 'Draft, issue and receive sixty units.'
        provenance: test
        source:
          - >-
            services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#records
            the first receipt numbered, against the order, with one line of 60 at the order line’s cost,
            and the order partially received
          - >-
            services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#writes,
            in the receipt’s transaction, the receipt movement naming the line, the layer of 60 @ 1000
            and the capitalize_receipt fact of 60000
    expected: 'The commitment is partial with sixty units, their layers and capitalization fact.'
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-160
    provenance: test
    source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#records
        the first receipt numbered, against the order, with one line of 60 at the order line’s cost, and
        the order partially received
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#writes,
        in the receipt’s transaction, the receipt movement naming the line, the layer of 60 @ 1000 and
        the capitalize_receipt fact of 60000
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#records
        the first receipt numbered, against the order, with one line of 60 at the order line’s cost, and
        the order partially received
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#writes,
        in the receipt’s transaction, the receipt movement naming the line, the layer of 60 @ 1000 and
        the capitalize_receipt fact of 60000
  - id: FAS-COM-ORD-07-02
    title: Closing preserves the received quantity and cancels the remainder
    kind: interaction
    exercises:
      - CAP-COM-ORD-017
      - CAP-COM-ORD-018
    relies_on:
      - ATS-COM-ORD-017-04
      - ATS-COM-ORD-018-02
    preconditions: Ninety units of a one-hundred-unit purchase have arrived.
    steps:
      - do: 'Attempt cancellation, close the purchase and inspect its received and cancelled quantities.'
        provenance: test
        source:
          - >-
            services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#closes
            an issued order after 90 of 100: cancelled_quantity 10, status closed; cancelling it instead
            is refused
    expected: >-
      Cancellation is refused; closing retains ninety received units, cancels ten and refuses another
      receipt.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-160
    provenance: test
    source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#closes
        an issued order after 90 of 100: cancelled_quantity 10, status closed; cancelling it instead is
        refused
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#closes
        an issued order after 90 of 100: cancelled_quantity 10, status closed; cancelling it instead is
        refused
  - id: FAS-COM-ORD-07-03
    title: Two deliveries complete the purchase without duplicate stock
    kind: lifecycle
    exercises:
      - CAP-COM-ORD-017
      - CAP-COM-ORD-018
    relies_on:
      - ATS-COM-ORD-018-01
      - ATS-COM-ORD-018-03
      - ATS-COM-ORD-018-13
    preconditions: An issued purchase has one hundred open units.
    steps:
      - do: >-
          Receive sixty units, replay that receipt key, receive forty units and inspect the purchase and
          cost layers.
        provenance: test
        source:
          - >-
            services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#answers
            the retried receipt as found under its key, writing nothing twice
          - >-
            services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#receives
            the remaining 40 and the order is received with its instant; the two layers stand oldest
            first
    expected: The purchase becomes received with only one movement and cost trail per delivery.
    negative: false
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to:
      - TST-COM-ORD-160
    provenance: test
    source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#answers
        the retried receipt as found under its key, writing nothing twice
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#receives
        the remaining 40 and the order is received with its instant; the two layers stand oldest first
    expected_provenance: test
    expected_source:
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#answers
        the retried receipt as found under its key, writing nothing twice
      - >-
        services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#receives
        the remaining 40 and the order is received with its instant; the two layers stand oldest first
  - id: FAS-COM-ORD-07-04
    title: Purchasing readers cannot receive or change costing
    kind: permission
    exercises:
      - CAP-COM-ORD-017
      - CAP-COM-ORD-018
    relies_on:
      - ATS-COM-ORD-017-06
      - ATS-COM-ORD-018-06
    preconditions: A principal has purchasing and costing read authority alone.
    steps:
      - do: 'Read the purchase and settings, then attempt receipt and method replacement.'
        provenance: proposed
        source:
          - ATS-COM-ORD-017-06
          - ATS-COM-ORD-018-06
    expected: Reads succeed and both writes fail without quantity or version changes.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-017-06
      - ATS-COM-ORD-018-06
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-017-06
      - ATS-COM-ORD-018-06
  - id: FAS-COM-ORD-07-05
    title: Method changes leave earlier acquisition history intact
    kind: regression
    exercises:
      - CAP-COM-ORD-017
      - CAP-COM-ORD-018
    relies_on:
      - ATS-COM-ORD-018-05
      - ATS-COM-ORD-018-08
    preconditions: The fixture stock has receipt layers and prior FIFO shipment relief.
    steps:
      - do: 'Switch to LIFO, relieve new units and restore returned units.'
        provenance: proposed
        source:
          - ATS-COM-ORD-018-05
          - ATS-COM-ORD-018-08
    expected: Old relief remains unchanged and restoration uses each shipment’s original costs.
    negative: true
    data_needs: 'An isolated workspace with the records, permissions and controlled outcomes named above.'
    bound_to: []
    provenance: proposed
    source:
      - ATS-COM-ORD-018-05
      - ATS-COM-ORD-018-08
    expected_provenance: proposed
    expected_source:
      - ATS-COM-ORD-018-05
      - ATS-COM-ORD-018-08
evidence:
  - provenance: documented
    source: 'rhythm-v2-docs:specs/commerce/orders/planning/features/FEAT-COM-ORD-07-purchasing-stock.md'
  - provenance: observed
    source:
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-017-buy-stock-from-vendors-on-purchase-orders.md
      - >-
        rhythm-v2-docs:specs/commerce/orders/planning/capabilities/CAP-COM-ORD-018-receive-stock-and-keep-what-it-cost.md
---

# Vendor purchasing and stock value: Feature Acceptance Suite

## What the Feature Must Do as a Whole

Vendor purchasing connects an issued commitment to received quantities and acquisition cost. The suite follows partial receipts, replay and closing the remaining commitment so stock and cost evidence can be reviewed together.

## Interactions Between Capabilities

Receiving changes both purchase progress and cost layers within the local transaction. Closing preserves received quantity while cancelling the outstanding quantity. Cost-method changes and receiving permissions remain proposed feature chains; local receipt fixtures do not establish external financial posting.

## Regression Record

| Revision | Change | Scenario | Why |
|---|---|---|---|
| 1 | initial | all | Establish the feature’s combined outcomes from the pinned specification and executable evidence. |
