---
id: TST-COM-FUL-078
title: Shipping flow
kind: integration
product_area: commerce
module: fulfillment
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-commerce
files:
  - modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js
implements:
  - ATS-COM-FUL-004-12
  - ATS-COM-FUL-012-01
  - ATS-COM-FUL-012-03
  - ATS-COM-FUL-012-04
  - ATS-COM-FUL-012-06
  - ATS-COM-FUL-012-10
  - ATS-COM-FUL-013-01
  - ATS-COM-FUL-013-02
  - ATS-COM-FUL-013-06
  - ATS-COM-FUL-013-07
  - ATS-COM-FUL-013-08
  - ATS-COM-FUL-013-10
  - ATS-COM-FUL-014-01
  - ATS-COM-FUL-014-02
  - ATS-COM-FUL-014-03
  - ATS-COM-FUL-014-04
  - ATS-COM-FUL-014-05
  - ATS-COM-FUL-014-06
  - ATS-COM-FUL-014-07
  - ATS-COM-FUL-018-08
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/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js
    test_titles:
      - >-
        makes the shipment from the order’s three picked units as one line (units 0..2) at the
        warehouse, numbered, addressed from the order, charged what the order paid, on the
        strategy’s carrier and service
      - 'stamps the ledger’s units with the shipment line at its creation, leaving them picked'
      - >-
        releases the shipment to the floor and lists its line for picking at the bin the ledger
        names, the shipment picking
      - >-
        records the pick: the list line picked, the shipment line picked with its quantity, the
        shipment picked
      - >-
        packs the three units into two parcels, the second weighed from nothing (the shirt has no
        weight), the line packed, the shipment packed with two packages
      - >-
        buys the first label through UPS under package:<id>:1 (the intent then the outcome), the
        tracking number and the cost on the label, the package labelled
      - >-
        takes the clerk’s tracking number and cost for the second label at the counter, and the
        shipment is labelled once both are
      - 'manifests the labelled shipment, its line and packages with it'
      - >-
        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
      - >-
        completes every unit’s obligation through the register (the allocation as the record), and
        emits one deferred cost relief fact per item
      - >-
        writes the shipped quantity on the order line, the order’s shipping_summary complete, and
        the order’s history
      - 'keeps the whole history on the shipment, oldest first'
      - >-
        refuses a second handoff of the same shipment (not manifested any more) and records the
        refusal
      - >-
        tracks the UPS package to delivery from the platform’s history, records the counter package
        delivered by hand, and the shipment is delivered once both are
      - >-
        refuses units_not_authorized, naming the obligation still pending, and moves nothing: the
        unit committed, nothing shipped, the shipment still manifested
      - raises the handoff_refused finding and writes the refusal on the shipment’s history
      - >-
        fences the whole range the unit is in (cancellation_pending under cancellation:<id>),
        nothing refused
      - >-
        refuses the handoff shipment_cancelled_pull_package, naming the fenced line, and moves
        nothing
      - >-
        cancels the fenced line at the cancel step: the units unstamped (still the order’s, picked),
        the label voided and the package pulled, the shipment cancelled
      - 'leaves the order’s units free for a new shipment: a second shipment carries both again'
      - >-
        lets the handoff commit, and the cancellation that waited finds the line already handed off:
        refused, nothing fenced
      - 'answers the plan must_return for the unit: shipped, by the row'
      - >-
        leaves an unknown purchase in flight: the label requested under package:<id>:1, the package
        packed, the uncertainty on the history
      - >-
        asks the carrier by the key before buying again, then the same purchase under the same key,
        and refuses label_purchase_in_flight while neither settles it, buying under no new key
      - >-
        settles the purchase in flight by the lookup: the label the carrier holds recorded on
        attempt 1, the package labelled, never bought twice
      - >-
        answers a purchase the platform refused before anything ran 503 carrier_unavailable with the
        reason, sent once
      - >-
        records the refused purchase failed (carrier_unavailable), not in flight, so the next
        purchase buys on attempt 2
      - >-
        keeps a void the carrier refused (refused.void_window_closed): the label void_failed with
        its cost, the void_failed finding
      - 'voids the second label through the platform: the label voided, the package back to packed'
      - >-
        records a label UPS refused (ups:01) failed with the contract’s code, the package still
        packed, the failure on the history
      - >-
        records a label that timed out before send (ups:02), was rate limited (ups:04) or unmapped
        (ups:05) failed with the contract’s code, nothing in flight
      - >-
        leaves a label sold and never answered (ups:03) in flight under package:<id>:1, the
        uncertainty on the history
      - >-
        settles the ups:03 label by asking the carrier, then the same purchase under the same key:
        the label sold recorded on attempt 1, a pdf data URI, never a second sale
      - >-
        answers a void whose outcome is not known 503 carrier_unavailable and records no void
        outcome, so the next attempt voids the label
      - >-
        voids again under the next attempt’s key (void:<label id>:2), each attempt’s intent on the
        history
      - >-
        makes a pickup shipment of the order at the pick-up warehouse, on no carrier, charged
        nothing
      - packs it as any other shipment (premise of the refusals)
      - 'refuses the carrier’s label purchase, void, manifest and handoff operation_not_supported'
      - >-
        hands it over: the lines, the package and the shipment collected with who collected it, the
        whole quantity shipped
      - >-
        moves the stock as the handoff does: the units shipped, one shipment movement of minus two
        (reason handover), two fewer on hand
      - >-
        completes the obligations through the register, emits the cost relief fact and writes the
        order’s shipped quantities
      - 'ends the history with the collection, naming who collected and why'
      - refuses a second handover (not packed any more) and the cancellation of a collected shipment
      - >-
        refuses the handover of a pick-up whose line the cancellation fenced,
        shipment_cancelled_pull_package, and moves nothing
      - refuses the handover of a carrier’s shipment operation_not_supported
    scenario_anchors:
      - >-
        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
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#completes
        every unit’s obligation through the register (the allocation as the record), and emits one
        deferred cost relief fact per item
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#writes
        the shipped quantity on the order line, the order’s shipping_summary complete, and the
        order’s history
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#makes
        the shipment from the order’s three picked units as one line (units 0..2) at the warehouse,
        numbered, addressed from the order, charged what the order paid, on the strategy’s carrier
        and service
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#makes
        a pickup shipment of the order at the pick-up warehouse, on no carrier, charged nothing
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#releases
        the shipment to the floor and lists its line for picking at the bin the ledger names, the
        shipment picking
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#records
        the pick: the list line picked, the shipment line picked with its quantity, the shipment
        picked
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#packs
        the three units into two parcels, the second weighed from nothing (the shirt has no weight),
        the line packed, the shipment packed with two packages
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        a second handover (not packed any more) and the cancellation of a collected shipment
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#buys
        the first label through UPS under package:<id>:1 (the intent then the outcome), the tracking
        number and the cost on the label, the package labelled
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#records
        the refused purchase failed (carrier_unavailable), not in flight, so the next purchase buys
        on attempt 2
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#answers
        a purchase the platform refused before anything ran 503 carrier_unavailable with the reason,
        sent once
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#leaves
        an unknown purchase in flight: the label requested under package:<id>:1, the package packed,
        the uncertainty on the history
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#asks
        the carrier by the key before buying again, then the same purchase under the same key, and
        refuses label_purchase_in_flight while neither settles it, buying under no new key
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#settles
        the purchase in flight by the lookup: the label the carrier holds recorded on attempt 1, the
        package labelled, never bought twice
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#keeps
        a void the carrier refused (refused.void_window_closed): the label void_failed with its
        cost, the void_failed finding
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#voids
        the second label through the platform: the label voided, the package back to packed
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#voids
        again under the next attempt’s key (void:<label id>:2), each attempt’s intent on the history
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#tracks
        the UPS package to delivery from the platform’s history, records the counter package
        delivered by hand, and the shipment is delivered once both are
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        the carrier’s label purchase, void, manifest and handoff operation_not_supported
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        units_not_authorized, naming the obligation still pending, and moves nothing: the unit
        committed, nothing shipped, the shipment still manifested
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#raises
        the handoff_refused finding and writes the refusal on the shipment’s history
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        a second handoff of the same shipment (not manifested any more) and records the refusal
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#fences
        the whole range the unit is in (cancellation_pending under cancellation:<id>), nothing
        refused
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        the handoff shipment_cancelled_pull_package, naming the fenced line, and moves nothing
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#lets
        the handoff commit, and the cancellation that waited finds the line already handed off:
        refused, nothing fenced
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#answers
        the plan must_return for the unit: shipped, by the row
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#cancels
        the fenced line at the cancel step: the units unstamped (still the order’s, picked), the
        label voided and the package pulled, the shipment cancelled
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#leaves
        the order’s units free for a new shipment: a second shipment carries both again
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#hands
        it over: the lines, the package and the shipment collected with who collected it, the whole
        quantity shipped
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#moves
        the stock as the handoff does: the units shipped, one shipment movement of minus two (reason
        handover), two fewer on hand
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#completes
        the obligations through the register, emits the cost relief fact and writes the order’s
        shipped quantities
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        the handover of a pick-up whose line the cancellation fenced,
        shipment_cancelled_pull_package, and moves nothing
      - >-
        services-commerce:modules/shipping/tests/integration/services/fulfillment/shipping-flow.integration.spec.js#refuses
        the handover of a carrier’s shipment operation_not_supported
---

# Shipping flow

## Verification Boundary

This suite checks shipping flow 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. Carrier integration answers use the local gateway’s scripted outcomes. 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.
