---
id: TST-ACC-TRX-061
title: Rounding suite
kind: integration
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js
implements:
  - ATS-ACC-TRX-001-04
implements_parts:
  - scenario: ATS-ACC-TRX-001-04
    assertion: >-
      it rounds each line’s extension once, half away from zero: 832.5 to 833
      and 50.5 to 51
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js#it
      rounds each line’s extension once, half away from zero: 832.5 to 833 and
      50.5 to 51
  - scenario: ATS-ACC-TRX-001-04
    assertion: >-
      it totals the rounded lines (3422), not a rounding of the unrounded sum
      (3421)
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js#it
      totals the rounded lines (3422), not a rounding of the unrounded sum
      (3421)
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  Suite-marked records in the prepared local test database; fixture teardown
  removes owned records.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js
    assertion_titles:
      - rounding in currencies of exponent 0 and 3 (integration)
      - a JPY invoice
      - >-
        rounds each line’s extension once, half away from zero: 832.5 to 833 and
        50.5 to 51
      - totals the rounded lines in whole yen
      - appends the facts in whole yen
      - a KWD invoice
      - >-
        rounds each line’s extension once in fils: 3087.5 to 3088 and 333.6333
        to 334
      - >-
        totals the rounded lines (3422), not a rounding of the unrounded sum
        (3421)
      - appends the facts in fils
      - the receivable per currency
      - 'sums each currency in its own minor units, with its exponent'
    imports:
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { createDraft } =
        require('../../../../services/invoices/invoice-drafts');
      - >-
        const { issueInvoice } =
        require('../../../../services/invoices/invoice-issue');
      - >-
        const { sumReceivableEventsAsOf } =
        require('../../../../services/persistence/receivable-events');
      - '} = require(''../../invoices-fixtures'');'
      - "\t\tworld.require();"
      - "\t\tworld.require();"
      - "\t\t\texpect(yen.require().draft.lines.map((line) => [line.extended_amount, line.net_amount, line.total])).to.deep.equal(["
      - "\t\t\tconst { draft } = yen.require();"
      - "\t\t\texpect((await receivableEventRowsOf(TENANT, yen.require().issued.id)).map((row) => row.amount)).to.deep.equal(['833', '48']);"
      - "\t\t\texpect(dinar.require().draft.lines.map((line) => line.extended_amount)).to.deep.equal([kwd(3088), kwd(334)]);"
      - "\t\t\tconst { draft } = dinar.require();"
      - "\t\t\texpect((await receivableEventRowsOf(TENANT, dinar.require().issued.id)).map((row) => row.amount)).to.deep.equal(['3088', '334']);"
      - "\t\t\tyen.require();"
      - "\t\t\tdinar.require();"
    test_double_declarations: []
---

# Rounding suite

## Verification Boundary

The suite exercises transaction commands and database protections in the local prepared test environment. Registration records the existing executable file; it does not report a run or establish product approval.

## What This Suite Proves

Its cited assertions contribute evidence for rounded lines reconcile with their document. The structured assertion bindings identify which parts of combined scenarios it executes.

## What It Does Not Prove

Local commands and route invocations do not establish deployed routing, live processor guarantees or the complete staff browser experience. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The suite uses the imported commands, route handlers or persistence code against the local test database. Fixture helpers supply accounting context; any stepped clock, dummy processor or substituted external client is retained in the evidence declarations.

## Must Not Be Doubled

The command or persistence behavior under assertion and its relevant database protections must remain real. Substituting the final financial result removes evidence of transactional effects.
