---
id: ATS-ACC-TRX-011
scope: CAP-ACC-TRX-011
product_area: accounting
module: transactions
revision: 1
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-ACC-TRX-011-01
    title: Manual credit requires compatible accounts
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-01
      - INV-DOM-ACC-TRX-004-01
    preconditions: Accounts exist in two units.
    steps:
      - do: >-
          Omit accounts, choose foreign-unit account, choose wrong currency and
          submit valid credit.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
          refuses a manual credit without its accounts, and a payment’s credit
          without its payment (400)
    expected: >-
      Invalid variants fail and valid credit starts open at one million with its
      full value.
    negative: false
    data_needs: Liability and expense destinations.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
        refuses a manual credit without its accounts, and a payment’s credit
        without its payment (400)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses an account of another unit (business_unit_mismatch)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses an amount in another currency (currency_mismatch)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        numbers the tenant’s first credit 1,000,000, open, with its accounts and
        its whole balance
      - TST-ACC-TRX-004
      - TST-ACC-TRX-037
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
      refuses a manual credit without its accounts, and a payment’s credit
      without its payment (400)
    category: validation
    test_bindings:
      - file: 'services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js'
        assertion: >-
          it refuses a manual credit without its accounts, and a payment’s
          credit without its payment (400)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
          refuses a manual credit without its accounts, and a payment’s credit
          without its payment (400)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it refuses an account of another unit (business_unit_mismatch)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses an account of another unit (business_unit_mismatch)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it refuses an amount in another currency (currency_mismatch)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses an amount in another currency (currency_mismatch)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it numbers the tenant’s first credit 1,000,000, open, with its
          accounts and its whole balance
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          numbers the tenant’s first credit 1,000,000, open, with its accounts
          and its whole balance
    binding_review: []
  - id: ATS-ACC-TRX-011-02
    title: Credit creation transfers available receipt value
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-02
      - INV-DOM-ACC-TRX-004-02
    preconditions: A check holds 30.00.
    steps:
      - do: Create 20.00 of payment-backed credit twice.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the payment holds unapplied (over_application)
    expected: The first leaves 10.00 available and the second is rejected.
    negative: false
    data_needs: An unapplied check receipt.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        takes the money off the payment: credited out 2000, unapplied 1000
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        is the payment’s customer, unit and currency, open with its balance
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses more than the payment holds unapplied (over_application)
      - >-
        react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0310.spec.ts#ACT-ACC-0310
      - TST-ACC-TRX-037
      - TST-ACC-TRX-247
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application)
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: 'it takes the money off the payment: credited out 2000, unapplied 1000'
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          takes the money off the payment: credited out 2000, unapplied 1000
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: 'it is the payment’s customer, unit and currency, open with its balance'
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          is the payment’s customer, unit and currency, open with its balance
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it refuses more than the payment holds unapplied (over_application)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the payment holds unapplied (over_application)
      - file: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0310.spec.ts
        assertion: ACT-ACC-0310
        provenance: test
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0310.spec.ts#ACT-ACC-0310
    binding_review:
      - binding: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0310.spec.ts#ACT-ACC-0310
        completeness: not-verified
        provenance: observed
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0310.spec.ts#ACT-ACC-0310
        note: >-
          This citation remains component evidence. A browser request driven
          through an API helper does not establish direct database checks or
          every branch of the combined scenario.
  - id: ATS-ACC-TRX-011-03
    title: Credit spending remains bounded under concurrency
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-03
      - BR-CAP-ACC-TRX-011-07
      - INV-DOM-ACC-TRX-004-03
      - INV-DOM-ACC-TRX-004-07
    preconditions: A credit holds 50.00 and another is available for a race.
    steps:
      - do: >-
          Spend all, retry after use, overspend another credit and race two
          applications.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the credit holds (insufficient_credit), the
          database’s CHECK, writing nothing
    expected: >-
      Used credit cannot spend again, excess writes nothing and one concurrent
      request fails.
    negative: true
    data_needs: Parallel application clients.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        uses the credit up: applied 5000, balance 0, status used
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses applying a used credit (credit_not_open)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses more than the credit holds (insufficient_credit), the database’s
        CHECK, writing nothing
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        serializes two concurrent applications of one credit: one succeeds, the
        other is refused by the database
      - >-
        react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0321.spec.ts#ACT-ACC-0321
      - TST-ACC-TRX-037
      - TST-ACC-TRX-256
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing
    category: concurrency
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: 'it uses the credit up: applied 5000, balance 0, status used'
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          uses the credit up: applied 5000, balance 0, status used
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it refuses applying a used credit (credit_not_open)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses applying a used credit (credit_not_open)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it refuses more than the credit holds (insufficient_credit), the
          database’s CHECK, writing nothing
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the credit holds (insufficient_credit), the
          database’s CHECK, writing nothing
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it serializes two concurrent applications of one credit: one succeeds,
          the other is refused by the database
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          serializes two concurrent applications of one credit: one succeeds,
          the other is refused by the database
      - file: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0321.spec.ts
        assertion: ACT-ACC-0321
        provenance: test
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0321.spec.ts#ACT-ACC-0321
    binding_review:
      - binding: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0321.spec.ts#ACT-ACC-0321
        completeness: not-verified
        provenance: observed
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0321.spec.ts#ACT-ACC-0321
        note: >-
          This citation remains component evidence. A browser request driven
          through an API helper does not establish direct database checks or
          every branch of the combined scenario.
  - id: ATS-ACC-TRX-011-04
    title: One application can pay several invoices
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-04
      - INV-DOM-ACC-TRX-004-04
    preconditions: Credit holds 50.00 for two eligible bills.
    steps:
      - do: Distribute it through one application.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          raises the line’s amount_paid: a line settled by store credit reads
          open until fully paid, then paid
    expected: >-
      One number groups both target lines and settlement derives their paid
      standing.
    negative: false
    data_needs: Two invoices for the same customer.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        numbers the application 1,000,000, applied, for the whole credit: 4000
        then 1000 by pay priority
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        raises the line’s amount_paid: a line settled by store credit reads open
        until fully paid, then paid
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        applies one credit across two invoices in one application: a line of
        each, the balances of both lowered
      - TST-ACC-TRX-037
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      raises the line’s amount_paid: a line settled by store credit reads open
      until fully paid, then paid
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it numbers the application 1,000,000, applied, for the whole credit:
          4000 then 1000 by pay priority
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          numbers the application 1,000,000, applied, for the whole credit: 4000
          then 1000 by pay priority
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it raises the line’s amount_paid: a line settled by store credit reads
          open until fully paid, then paid
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          raises the line’s amount_paid: a line settled by store credit reads
          open until fully paid, then paid
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it applies one credit across two invoices in one application: a line
          of each, the balances of both lowered
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          applies one credit across two invoices in one application: a line of
          each, the balances of both lowered
    binding_review: []
  - id: ATS-ACC-TRX-011-05
    title: Credit cannot cross customers
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-05
      - INV-DOM-ACC-TRX-004-05
    preconditions: Member credit targets an employer invoice.
    steps:
      - do: Submit the application.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses a credit of another customer than the invoice’s bill-to
          (credit_customer_mismatch)
    expected: Customer mismatch leaves the position unchanged.
    negative: true
    data_needs: Separate member and employer records.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses a credit of another customer than the invoice’s bill-to
        (credit_customer_mismatch)
      - >-
        react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0322.spec.ts#ACT-ACC-0322
      - TST-ACC-TRX-037
      - TST-ACC-TRX-257
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses a credit of another customer than the invoice’s bill-to
      (credit_customer_mismatch)
    category: boundary
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it refuses a credit of another customer than the invoice’s bill-to
          (credit_customer_mismatch)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses a credit of another customer than the invoice’s bill-to
          (credit_customer_mismatch)
      - file: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0322.spec.ts
        assertion: ACT-ACC-0322
        provenance: test
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0322.spec.ts#ACT-ACC-0322
    binding_review:
      - binding: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0322.spec.ts#ACT-ACC-0322
        completeness: not-verified
        provenance: observed
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0322.spec.ts#ACT-ACC-0322
        note: >-
          This citation remains component evidence. A browser request driven
          through an API helper does not establish direct database checks or
          every branch of the combined scenario.
  - id: ATS-ACC-TRX-011-06
    title: Expiry boundary and order restriction are enforced
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-06
    preconditions: 'Credits expired yesterday, expire today and are membership-restricted.'
    steps:
      - do: >-
          Apply each and select gala and membership targets for the restricted
          credit.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses a credit that expired before the application date
          (credit_expired)
    expected: >-
      Earlier expiry and unrelated order fail; same-day and matching-order use
      succeed.
    negative: false
    data_needs: Invoices with order-type metadata.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses a credit that expired before the application date
        (credit_expired)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        applies a credit on the day it expires
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses a credit restricted to another order type than the invoice’s
        (credit_order_type_mismatch)
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        applies a restricted credit to an invoice of its order type
      - TST-ACC-TRX-037
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses a credit that expired before the application date (credit_expired)
    category: boundary
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it refuses a credit that expired before the application date
          (credit_expired)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses a credit that expired before the application date
          (credit_expired)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it applies a credit on the day it expires
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          applies a credit on the day it expires
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it refuses a credit restricted to another order type than the
          invoice’s (credit_order_type_mismatch)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses a credit restricted to another order type than the invoice’s
          (credit_order_type_mismatch)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it applies a restricted credit to an invoice of its order type
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          applies a restricted credit to an invoice of its order type
    binding_review: []
  - id: ATS-ACC-TRX-011-07
    title: Application reversal restores held value once
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-08
      - INV-DOM-ACC-TRX-004-08
    preconditions: Credit has been spent through an application.
    steps:
      - do: Reverse it with an explanation and repeat.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          marks the first reversed and gives the money back to the credit, which
          is open again
    expected: The opposing document restores debt and credit; another reversal fails.
    negative: false
    data_needs: A live credit application.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        answers a second application naming the first, its lines negating the
        first’s
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        marks the first reversed and gives the money back to the credit, which
        is open again
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses reversing it again (application_not_live)
      - >-
        react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0309.spec.ts#ACT-ACC-0309
      - TST-ACC-TRX-037
      - TST-ACC-TRX-246
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      marks the first reversed and gives the money back to the credit, which is
      open again
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it answers a second application naming the first, its lines negating
          the first’s
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          answers a second application naming the first, its lines negating the
          first’s
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it marks the first reversed and gives the money back to the credit,
          which is open again
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          marks the first reversed and gives the money back to the credit, which
          is open again
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it refuses reversing it again (application_not_live)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses reversing it again (application_not_live)
      - file: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0309.spec.ts
        assertion: ACT-ACC-0309
        provenance: test
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0309.spec.ts#ACT-ACC-0309
    binding_review:
      - binding: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0309.spec.ts#ACT-ACC-0309
        completeness: not-verified
        provenance: observed
        source: >-
          react-console:acceptance/accounting/playwright/journeys/payments/ACT-ACC-0309.spec.ts#ACT-ACC-0309
        note: >-
          This citation remains component evidence. A browser request driven
          through an API helper does not establish direct database checks or
          every branch of the combined scenario.
  - id: ATS-ACC-TRX-011-08
    title: Unused credit can be voided safely
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-09
      - INV-DOM-ACC-TRX-004-09
    preconditions: 'Manual, payment-backed and already-applied credits exist.'
    steps:
      - do: Attempt to void each.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses voiding a credit with money applied (credit_has_applications)
    expected: >-
      Unused credit voids, source money returns for payment-backed credit and
      applied credit fails.
    negative: false
    data_needs: Credits with differing use histories.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        voids an unused credit with the reason and nets its facts to nothing
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        gives a payment’s credit back to the payment
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses voiding a credit with money applied (credit_has_applications)
      - TST-ACC-TRX-037
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications)
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it voids an unused credit with the reason and nets its facts to
          nothing
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          voids an unused credit with the reason and nets its facts to nothing
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: it gives a payment’s credit back to the payment
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          gives a payment’s credit back to the payment
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js
        assertion: >-
          it refuses voiding a credit with money applied
          (credit_has_applications)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses voiding a credit with money applied (credit_has_applications)
    binding_review: []
  - id: ATS-ACC-TRX-011-09
    title: Reading credit does not authorize spending
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-11
    preconditions: The caller holds read-only access.
    steps:
      - do: Attempt every credit and application mutation.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
          is refused the application routes without their permissions (403)
    expected: Every request is denied.
    negative: true
    data_needs: A reader persona.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
        is refused the credit routes without their permissions (403)
      - >-
        services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
        is refused the application routes without their permissions (403)
      - TST-ACC-TRX-004
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
      is refused the application routes without their permissions (403)
    category: permission
    test_bindings:
      - file: 'services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js'
        assertion: it is refused the credit routes without their permissions (403)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
          is refused the credit routes without their permissions (403)
      - file: 'services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js'
        assertion: it is refused the application routes without their permissions (403)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
          is refused the application routes without their permissions (403)
    binding_review: []
  - id: ATS-ACC-TRX-011-10
    title: Credit transfer controls later use of its source receipt
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-TRX-011-02
      - BR-CAP-ACC-TRX-011-03
      - BR-CAP-ACC-TRX-011-09
      - BR-CAP-ACC-TRX-006-08
      - BR-CAP-ACC-TRX-006-10
      - BR-CAP-ACC-TRX-009-03
      - BR-CAP-ACC-TRX-009-04
      - BR-CAP-ACC-TRX-012-01
      - BR-CAP-ACC-TRX-012-02
      - BR-CAP-ACC-TRX-013-05
      - BR-CAP-ACC-TRX-014-03
      - BR-CAP-ACC-TRX-014-04
      - BR-CAP-ACC-TRX-003-04
      - BR-CAP-ACC-TRX-007-06
    exercises:
      - CAP-ACC-TRX-011
      - CAP-ACC-TRX-006
      - CAP-ACC-TRX-009
      - CAP-ACC-TRX-012
      - CAP-ACC-TRX-013
      - CAP-ACC-TRX-014
      - CAP-ACC-TRX-003
      - CAP-ACC-TRX-007
    preconditions: >-
      An isolated workspace has eligible customers, products, matching accounts,
      an open period and two open batches. Each branch owns separate financial
      records.
    steps:
      - do: >-
          Receive excess money, convert 20.00 into credit and attempt to void
          its source receipt. Spend part through settlement, refund another
          eligible part and cancel an unused grant in a separate branch. Reverse
          paid billing with credit remainder treatment. Use a lost-answer card
          settlement for one credit branch and issue a reduction memo releasing
          paid money in another.
        provenance: proposed
        source: >-
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the payment holds unapplied (over_application);
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses more than the credit holds (insufficient_credit), the
          database’s CHECK, writing nothing;
          services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
          refuses voiding a credit with money applied (credit_has_applications);
          rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
          rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
    expected: >-
      The live grant blocks source reversal; settlement and refund cannot
      consume the same available credit; cancelling unused receipt-derived
      credit restores its money; cancellation retains the separate remainder
      grant.
    negative: false
    data_needs: >-
      Separate command keys, two customers, invoice lines, receipts and credit;
      controlled processor outcomes and a fixed calendar where the branch
      requires them.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
    test_bindings: []
    binding_review: []
evidence:
  - >-
    services-accounting at f47cb263875bbc0c5640fba7dae6785ec32695f8: the test
    files named in bound_to.
  - >-
    react-console at baf6dae382d6f41dce976c7f848667ccc37e076f: the Playwright
    journeys ACT-ACC-0309, 0310, 0321, 0322.
  - >-
    rhythm-v2-docs:specs/accounting/transactions/design: related workflows,
    domain invariants and state transitions examined for the back-fill.
coverage:
  rule: 'gap: FND-ACC-TRX-076'
  transition: 'gap: FND-ACC-TRX-076'
  validation: covered
  permission: covered
  edge: 'gap: FND-ACC-TRX-076'
  failure: 'gap: FND-ACC-TRX-076'
  boundary: covered
  concurrency: covered
  invariant: 'gap: FND-ACC-TRX-076'
  interaction: covered
coverage_notes:
  rule: >-
    No dedicated rule scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  edge: >-
    No dedicated edge scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  failure: >-
    No dedicated failure scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  invariant: >-
    No dedicated invariant scenario covers the applicable conditions; the
    finding identifies the remaining specification work.
  transition: >-
    Selected transition scenarios exist, but the listed state paths still need
    explicit guard, effect and actor mappings.
interaction_coverage:
  - to: CAP-ACC-TRX-003
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-006
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-007
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-009
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-012
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-013
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
  - to: CAP-ACC-TRX-014
    scenarios:
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application);
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing;
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications);
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06
transition_coverage:
  - state_model: STATE-ACC-TRX-011
    transition: 1
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/db/credits.table.ts;
        services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
        refuses a manual credit without its accounts, and a payment’s credit
        without its payment (400)
  - state_model: STATE-ACC-TRX-011
    transition: 2
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:db/migrations/20261017174829_payments_core.sql:derive_credit_status
  - state_model: STATE-ACC-TRX-011
    transition: 3
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/db/credits.table.ts;
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        marks the first reversed and gives the money back to the credit, which
        is open again
  - state_model: STATE-ACC-TRX-011
    transition: 4
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/db/credits.table.ts;
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses voiding a credit with money applied (credit_has_applications)
  - state_model: STATE-ACC-TRX-012
    transition: 1
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts;
        services-accounting:modules/transactions/db/credit-applications.table.ts;
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        raises the line’s amount_paid: a line settled by store credit reads open
        until fully paid, then paid
  - state_model: STATE-ACC-TRX-012
    transition: 2
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts;
        services-accounting:modules/transactions/db/credit-applications.table.ts;
        services-accounting:modules/transactions/tests/integration/services/settlements/settlements.integration.spec.js#it
        refuses with the decline (processor_declined), the settlement failed
        with the code, the reservation released, nothing applied
  - state_model: STATE-ACC-TRX-012
    transition: 3
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts;
        services-accounting:modules/transactions/db/credit-applications.table.ts;
        services-accounting:modules/transactions/tests/integration/services/settlements/settlements.integration.spec.js#it
        applies the open credit’s 500 first and takes a check of 8000 for the
        rest: completed with its payment
  - state_model: STATE-ACC-TRX-012
    transition: 4
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts;
        services-accounting:modules/transactions/db/credit-applications.table.ts;
        services-accounting:modules/transactions/tests/integration/services/settlements/settlement-retry.integration.spec.js#it
        runs a new attempt under the key: a new settlement, completed with a
        payment, stored under the key with its attempt number
  - state_model: STATE-ACC-TRX-012
    transition: 5
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts;
        services-accounting:modules/transactions/db/credit-applications.table.ts;
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        marks the first reversed and gives the money back to the credit, which
        is open again
permission_coverage:
  - key: accounting.credits.create
    where_checked: api
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#CAP-ACC-TRX-011
  - key: accounting.credits.read
    where_checked: api
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#CAP-ACC-TRX-011
  - key: accounting.credits.update
    where_checked: api
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#CAP-ACC-TRX-011
  - key: accounting.credit-applications.create
    where_checked: api
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#CAP-ACC-TRX-011
  - key: accounting.credit-applications.read
    where_checked: api
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#CAP-ACC-TRX-011
rule_coverage:
  - rule: BR-CAP-ACC-TRX-011-01
    scenarios:
      - ATS-ACC-TRX-011-01
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
      refuses a manual credit without its accounts, and a payment’s credit
      without its payment (400)
  - rule: BR-CAP-ACC-TRX-011-02
    scenarios:
      - ATS-ACC-TRX-011-02
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application)
  - rule: BR-CAP-ACC-TRX-011-03
    scenarios:
      - ATS-ACC-TRX-011-03
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing
  - rule: BR-CAP-ACC-TRX-011-04
    scenarios:
      - ATS-ACC-TRX-011-04
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      raises the line’s amount_paid: a line settled by store credit reads open
      until fully paid, then paid
  - rule: BR-CAP-ACC-TRX-011-05
    scenarios:
      - ATS-ACC-TRX-011-05
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses a credit of another customer than the invoice’s bill-to
      (credit_customer_mismatch)
  - rule: BR-CAP-ACC-TRX-011-06
    scenarios:
      - ATS-ACC-TRX-011-06
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses a credit that expired before the application date (credit_expired)
  - rule: BR-CAP-ACC-TRX-011-07
    scenarios:
      - ATS-ACC-TRX-011-03
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      serializes two concurrent applications of one credit: one succeeds, the
      other is refused by the database
  - rule: BR-CAP-ACC-TRX-011-08
    scenarios:
      - ATS-ACC-TRX-011-07
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      marks the first reversed and gives the money back to the credit, which is
      open again
  - rule: BR-CAP-ACC-TRX-011-09
    scenarios:
      - ATS-ACC-TRX-011-08
      - ATS-ACC-TRX-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications)
  - rule: BR-CAP-ACC-TRX-011-11
    scenarios:
      - ATS-ACC-TRX-011-09
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
      is refused the application routes without their permissions (403)
executable_gaps:
  - scenario: ATS-ACC-TRX-011-10
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    evidence:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses more than the payment holds unapplied (over_application);
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses more than the credit holds (insufficient_credit), the database’s
        CHECK, writing nothing;
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses voiding a credit with money applied (credit_has_applications);
        rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008;
        rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010
invariant_coverage:
  - invariant: INV-DOM-ACC-TRX-004-01
    scenarios:
      - ATS-ACC-TRX-011-01
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it
      refuses a manual credit without its accounts, and a payment’s credit
      without its payment (400)
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-02
    scenarios:
      - ATS-ACC-TRX-011-02
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the payment holds unapplied (over_application)
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-03
    scenarios:
      - ATS-ACC-TRX-011-03
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses more than the credit holds (insufficient_credit), the database’s
      CHECK, writing nothing
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-04
    scenarios:
      - ATS-ACC-TRX-011-04
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      raises the line’s amount_paid: a line settled by store credit reads open
      until fully paid, then paid
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-05
    scenarios:
      - ATS-ACC-TRX-011-05
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses a credit of another customer than the invoice’s bill-to
      (credit_customer_mismatch)
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-06
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    evidence:
      - >-
        services-accounting:modules/transactions/services/credits/credit-commands.ts:requireCreditUsable;
        services-accounting:modules/transactions/services/settlements/settlement-commands.ts:settle
    note: >-
      The complete invariant has no exact assertion binding in this
      specification; component evidence does not close the gap.
  - invariant: INV-DOM-ACC-TRX-004-07
    scenarios:
      - ATS-ACC-TRX-011-03
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      serializes two concurrent applications of one credit: one succeeds, the
      other is refused by the database
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-08
    scenarios:
      - ATS-ACC-TRX-011-07
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      marks the first reversed and gives the money back to the credit, which is
      open again
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-09
    scenarios:
      - ATS-ACC-TRX-011-08
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
      refuses voiding a credit with money applied (credit_has_applications)
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
  - invariant: INV-DOM-ACC-TRX-004-10
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    evidence:
      - >-
        services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it
        refuses an UPDATE and a DELETE of an application line
    note: >-
      The complete invariant has no exact assertion binding in this
      specification; component evidence does not close the gap.
  - invariant: INV-DOM-ACC-TRX-004-11
    gap: FND-ACC-TRX-076
    provenance: unknown
    source: FND-ACC-TRX-076
    evidence:
      - >-
        services-accounting:docs/milestones/plans/ACCT-M2-plan.md#7a. Entity
        capabilities (R2-ARCH-001)
    note: >-
      The complete invariant has no exact assertion binding in this
      specification; component evidence does not close the gap.
---

# Provide and spend customer credit: Capability Test Specification

## Coverage

The category map separates specified examples from recorded gaps. The table lists a scenario or finding for each rule requiring proof; a listed scenario may still be proposed. Executable bindings cover their cited assertions, while the transition, permission and invariant registers identify combinations that need further proof.

| Required rule | Scenario or finding |
|---|---|
| `BR-CAP-ACC-TRX-011-01` | `ATS-ACC-TRX-011-01` |
| `BR-CAP-ACC-TRX-011-02` | `ATS-ACC-TRX-011-02`, `ATS-ACC-TRX-011-10` |
| `BR-CAP-ACC-TRX-011-03` | `ATS-ACC-TRX-011-03`, `ATS-ACC-TRX-011-10` |
| `BR-CAP-ACC-TRX-011-04` | `ATS-ACC-TRX-011-04` |
| `BR-CAP-ACC-TRX-011-05` | `ATS-ACC-TRX-011-05` |
| `BR-CAP-ACC-TRX-011-06` | `ATS-ACC-TRX-011-06` |
| `BR-CAP-ACC-TRX-011-07` | `ATS-ACC-TRX-011-03` |
| `BR-CAP-ACC-TRX-011-08` | `ATS-ACC-TRX-011-07` |
| `BR-CAP-ACC-TRX-011-09` | `ATS-ACC-TRX-011-08`, `ATS-ACC-TRX-011-10` |
| `BR-CAP-ACC-TRX-011-11` | `ATS-ACC-TRX-011-09` |

## Interactions With Related Capabilities

Receive excess money, convert 20.00 into credit and attempt to void its source receipt. Spend part through settlement, refund another eligible part and cancel an unused grant in a separate branch. Reverse paid billing with credit remainder treatment. Use a lost-answer card settlement for one credit branch and issue a reduction memo releasing paid money in another.

The live grant blocks source reversal; settlement and refund cannot consume the same available credit; cancelling unused receipt-derived credit restores its money; cancellation retains the separate remainder grant. The complete chain remains proposed until one executable run proves its combined outcomes.
