---
id: CAP-COM-FUL-002
title: Authorize delivery from current order facts
feature: FEAT-COM-FUL-01
product_area: commerce
module: fulfillment
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - CAP-COM-REG-014
  - CAP-COM-REG-015
  - CAP-COM-REG-018
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
intent_sources:
  - >-
    services-commerce:docs/milestones/plans/COMM-M2-plan.md#D6 (decision (a),
    Andrew 2026-10-21)
purpose: >-
  The register decides whether an accepted order has met its saved delivery
  conditions.
outcomes:
  - Eligible purchases can progress promptly to delivery.
  - Financial eligibility protects against unintended release.
concepts:
  - CON-COM-FUL-001
  - CON-COM-FUL-002
actors:
  - ACT-COM-012
  - ACT-COM-013
surfaces:
  - job
preconditions: []
postconditions: []
permissions: []
rules:
  - id: BR-CAP-COM-FUL-002-01
    proved_by: [ATS-COM-FUL-002-01, TST-COM-FUL-052]
    statement: >-
      An obligation cannot open until its order is accepted, including when the
      policy has no financial condition.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#the
      order must be accepted whatever the policy, even none
    origin: none
  - id: BR-CAP-COM-FUL-002-02
    proved_by: [ATS-COM-FUL-002-02, ATS-COM-FUL-002-15, ATS-COM-FUL-004-13, ATS-COM-FUL-020-11, TST-COM-FUL-052]
    statement: >-
      A staff hold, unfulfilled migrated line, absent required approval or
      failed prerequisite produces a block requiring staff attention, and
      approval is checked before financial eligibility.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#blocks
      for a person exactly when the reason is a hold, a migrated line, a missing
      approval or a prerequisite that failed, and never otherwise
    origin: none
  - id: BR-CAP-COM-FUL-002-03
    proved_by: [ATS-COM-FUL-002-03, TST-COM-FUL-029, TST-COM-FUL-052]
    statement: >-
      Full payment requires paid money plus applied credits minus refunds to
      cover the invoiced amount with no pending capture; write-offs contribute
      nothing.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#a
      write-off never fulfils: a line written off in full stays closed with the
      balance due (08 row 19, B37)
    origin: none
    examples:
      positive: 'invoiced 100, paid 60, credit applied 40: open'
      negative: 'invoiced 100, paid 60, written off 40: closed'
  - id: BR-CAP-COM-FUL-002-04
    proved_by: [ATS-COM-FUL-002-03, TST-COM-FUL-029, TST-COM-FUL-052]
    statement: >-
      Bank-debit money contributes when the processor accepts it unless the
      policy requires settlement first.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#ACH
      counts when accepted by default, and only once settled when the policy
      says so
    origin: none
  - id: BR-CAP-COM-FUL-002-05
    proved_by: [ATS-COM-FUL-001-10, ATS-COM-FUL-002-04, ATS-COM-FUL-002-11, TST-COM-FUL-019, TST-COM-FUL-052]
    statement: >-
      Amount and percentage conditions compare effective payments with their
      thresholds, immediate delivery requires billing, no financial condition
      requires acceptance alone, and a deposit condition requires the plan's
      initial amount to be paid.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#a
      minimum amount and a minimum percent are met by what was paid, never by
      the balance
    origin: none
  - id: BR-CAP-COM-FUL-002-06
    proved_by: [ATS-COM-FUL-002-05, TST-COM-FUL-052, TST-COM-FUL-056]
    statement: >-
      A policy allowing approved terms can satisfy full payment for a console
      order billed on terms, while portal terms orders and merely submitted or
      declined terms tenders do not qualify through that console rule.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/register/order-billed-on-terms.spec.js#is
      a console order whose profile requires terms
    origin: >-
      COMM-M2 D6 (a), Andrew 2026-10-21:
      services-commerce:docs/milestones/plans/COMM-M2-plan.md#D6;
      docs/milestones/COMM-M2-take-a-staff-order.md#W4-2
  - id: BR-CAP-COM-FUL-002-07
    proved_by: [ATS-COM-FUL-002-06, ATS-COM-FUL-002-13, ATS-COM-FUL-003-06, ATS-COM-FUL-004-08, TST-COM-FUL-023, TST-COM-FUL-052]
    statement: >-
      A child obligation waits for its parent's open gate unless configured
      otherwise, and required application readiness must be reported before
      delivery opens.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#the
      participant’s prerequisite is waited for, and a child line follows its
      parent unless the policy says not
    origin: none
  - id: BR-CAP-COM-FUL-002-08
    proved_by: []
    statement: >-
      Each gate verdict retains the financial condition, amounts and invoice
      references used to reach it.
    kind: invariant
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js#carries
      the facts it used on every verdict: the condition, the money read and the
      invoice named
    origin: none
  - id: BR-CAP-COM-FUL-002-09
    proved_by: [ATS-COM-FUL-002-07, ATS-COM-FUL-002-14, ATS-COM-FUL-004-09, TST-COM-FUL-022, TST-COM-FUL-032]
    statement: >-
      Financial-event receipts prevent duplicate evaluation by event identity,
      while failed evaluation leaves no receipt and permits another attempt on
      redelivery.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/e2e/obligation-register.e2e.spec.js#is
      idempotent on the event id: the batch redelivered answers succeeded,
      evaluates nothing and opens nothing
    origin: none
  - id: BR-CAP-COM-FUL-002-10
    proved_by: [ATS-COM-FUL-002-07, TST-COM-FUL-022, TST-COM-FUL-032]
    statement: >-
      A financial event identifies candidate lines, whose current positions
      determine eligibility; unknown workspaces, orders and lines return success
      without changing records.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/e2e/obligation-register.e2e.spec.js#answers
      succeeded for every event, the unknown tenant and the unsold line among
      them, and applies the four
    origin: >-
      D-P4-04 (build decision, not a product ruling):
      services-commerce:docs/migrations/obligation-register/README.md#D-P4-04
  - id: BR-CAP-COM-FUL-002-11
    proved_by: [ATS-COM-FUL-002-08, TST-COM-FUL-040]
    statement: >-
      Gate opening creates the authorization and delivery-queue entry
      atomically, with only one authorization surviving concurrent evaluations.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/integration/services/persistence/obligation-register.integration.spec.js#answers
      the second not waiting once the first committed, and the register holds
      ONE authorization
    origin: none
  - id: BR-CAP-COM-FUL-002-12
    proved_by: [ATS-COM-FUL-001-11, ATS-COM-FUL-002-09, ATS-COM-FUL-002-12, ATS-COM-FUL-005-08, TST-COM-FUL-047]
    statement: >-
      Each minute the sweep can revisit a bounded page of pending obligations on
      accepted orders after ten minutes without evaluation; backlog and
      execution failures can extend recovery time.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-commerce:modules/fulfillment/services/register/register-sweeper.ts:sweepRegister
    origin: none
  - id: BR-CAP-COM-FUL-002-13
    proved_by: []
    statement: >-
      The deployed financial-facts provider reads Accounting's line-position
      view and supplies no approved-customer-terms fact until Accounting exposes
      one.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: observed
    source: >-
      services-commerce:modules/fulfillment/services/facts/financial-facts-port.ts:FINANCIAL_FACTS_SOURCE_VARIABLE
    origin: none
  - id: BR-CAP-COM-FUL-002-14
    proved_by: [ATS-COM-FUL-002-10]
    statement: >-
      A percentage threshold is the invoiced amount multiplied by the configured
      percentage and rounded upward to a whole minor currency unit.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-commerce:modules/fulfillment/services/policies/evaluate-gate.ts:evaluateGate
    origin: none
scenarios:
  - id: SC-CAP-COM-FUL-002-01
    given: Four orders are paid and one product also requires approval.
    when: Deliver Accounting's relevant change events.
    then: >-
      Three obligations open while the approval-dependent obligation remains
      blocked.
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/e2e/obligation-register.e2e.spec.js#resolves
      each line by Accounting’s invoice line through the facts port, opens three
      gates and blocks the one that needs approval
  - id: SC-CAP-COM-FUL-002-02
    given: The line's payment covers its invoice but capture remains pending.
    when: Evaluate full-payment eligibility.
    then: The outstanding capture keeps delivery closed.
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/integration/services/facts/position-view-gate.integration.spec.js#closes
      paid_in_full on pending capture although the line is paid in full
edge_cases:
  - id: SC-CAP-COM-FUL-002-03
    given: >-
      A lost financial event leaves a paid obligation among stale page
      candidates.
    when: Run the sweep eleven minutes after the earlier evaluation.
    then: The selected obligation is evaluated and authorized.
    provenance: test
    source: >-
      services-commerce:modules/fulfillment/tests/integration/services/register/register-sweeper.integration.spec.js#leaves
      the paid obligations authorized and queued, with the sweep as the trigger
      and the facts on them
constraints: []
depends_on:
  - CAP-COM-FUL-001
related:
  - CAP-COM-FUL-003
  - CAP-COM-FUL-004
journeys:
  - JNY-COM-FUL-001
open_questions: []
evidence:
  - repository: services-commerce
    paths:
      - modules/fulfillment/tests/unit/policies/evaluate-gate.spec.js
      - modules/fulfillment/tests/unit/register/order-billed-on-terms.spec.js
      - modules/fulfillment/tests/e2e/obligation-register.e2e.spec.js
      - >-
        modules/fulfillment/tests/integration/services/persistence/obligation-register.integration.spec.js
      - modules/fulfillment/services/register/register-sweeper.ts
      - modules/fulfillment/services/facts/financial-facts-port.ts
      - modules/fulfillment/services/policies/evaluate-gate.ts
controls: [TC-IAM-006, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-CRY-001, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-LOG-004, TC-LOG-005, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-007, TC-AVL-004, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-VEN-001, TC-VEN-002, TC-VEN-003, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-COM-FUL-01-01, FAS-COM-FUL-01-02, FAS-COM-FUL-01-05]
suites: [TST-COM-FUL-019, TST-COM-FUL-022, TST-COM-FUL-023, TST-COM-FUL-029, TST-COM-FUL-032, TST-COM-FUL-040, TST-COM-FUL-047, TST-COM-FUL-052, TST-COM-FUL-056]
---

# Authorize delivery from current order facts

## Purpose

The register decides whether an accepted order has met its saved delivery conditions.

## How It Works

Commerce evaluates obligations when relevant financial facts arrive. It reads current line positions from Accounting rather than treating event amounts as the balance. Evaluation combines money, approval, readiness and parent-line facts. The resulting explanation remains available to staff investigating a delay. An eligible obligation enters authorized work for its delivering application. A scheduled backstop revisits stale pending work, subject to its page budget. The product should make recovery backlog and unsuccessful evaluations visible to operations staff.

## Relationships

- Choose delivery conditions for sold items supplies or consumes related delivery records.
- Protect a member-priced purchase until its membership arrives supplies or consumes related delivery records.
- Carry authorized work to its delivering application supplies or consumes related delivery records.
