---
id: TST-ACC-TRX-006
title: Customer terms suite
kind: api-lifecycle
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/transactions/tests/e2e/customer-terms.e2e.spec.js
implements:
  - ATS-ACC-TRX-019-01
  - ATS-ACC-TRX-019-06
implements_parts:
  - scenario: ATS-ACC-TRX-019-01
    assertion: 'it answers the defaults, saying so, before Acme has a record'
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it
      answers the defaults, saying so, before Acme has a record
  - scenario: ATS-ACC-TRX-019-01
    assertion: >-
      it answers the other tenant the defaults for Acme, not this tenant’s
      record
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it
      answers the other tenant the defaults for Acme, not this tenant’s record
  - scenario: ATS-ACC-TRX-019-06
    assertion: >-
      it reads with accounting.customer-terms.read alone and refuses a principal
      without it (403)
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it
      reads with accounting.customer-terms.read alone and refuses a principal
      without it (403)
  - scenario: ATS-ACC-TRX-019-06
    assertion: >-
      it refuses the write and the delete without
      accounting.customer-terms.manage (403), the reader’s key not enough
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it
      refuses the write and the delete without accounting.customer-terms.manage
      (403), the reader’s key not enough
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/e2e/customer-terms.e2e.spec.js'
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js
    assertion_titles:
      - the customer terms routes (end to end)
      - a party’s terms through their life
      - 'answers the defaults, saying so, before Acme has a record'
      - creates the record without a version and answers it at version 1
      - 'refuses a replacement at a stale version: 409'
      - >-
        replaces the record sent back as it was read, at its version: version 2,
        net 10
      - 'answers the other tenant the defaults for Acme, not this tenant’s record'
      - >-
        deletes the record, answering the defaults, and reads the defaults after
        it
      - the customer summary
      - answers the party’s terms beside its figures
      - the refusals
      - 'refuses a party kind that is neither contact nor organization: 400'
      - 'refuses a read that names no party: 400'
      - 'refuses a setting it does not know: 400'
      - 'refuses unknown default payment terms: 400 naming the field'
      - the permissions
      - >-
        reads with accounting.customer-terms.read alone and refuses a principal
        without it (403)
      - >-
        refuses the write and the delete without
        accounting.customer-terms.manage (403), the reader’s key not enough
    imports:
      - >-
        const { parseBody, proxyEvent } =
        require('@rhythmsoftware/macroservice-testing/signed-context');
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { accountingApi, accountingGrant } =
        require('../../../books/tests/e2e/e2e-security');
      - >-
        const { PERMISSION_MISSING, accessRefusalOf } =
        require('../../../books/tests/e2e/configuration-e2e-support');
      - >-
        const { createInvoiceWorld, expect, ready, removeTenantInvoices, testId
        } = require('../integration/invoices-fixtures');
      - "\t\t\tctx: ctx ?? session.require().administrator,"
      - "\t\t\tsession.require();"
      - "\t\t\tconst { defaults } = life.require();"
      - "\t\t\tconst { created } = life.require();"
      - "\t\t\tconst { stale } = life.require();"
      - "\t\t\tconst { replaced, reread } = life.require();"
      - "\t\t\tconst { foreign } = life.require();"
      - "\t\t\tconst { deleted, after } = life.require();"
      - "\t\t\tsession.require();"
      - "\t\t\t\tctx: session.require().administrator,"
      - "\t\t\tconst { reader, outsider } = session.require();"
      - "\t\t\tconst { reader } = session.require();"
    test_double_declarations: []
---

# Customer terms 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 terms defaults and uniqueness remain workspace-scoped; manage authority does not follow read access. 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.
