---
id: TST-ACC-TRX-144
title: Customer terms rules suite
kind: unit
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/transactions/tests/unit/rules/customer-terms-rules.spec.js
implements: []
implements_parts: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: In-memory fixtures and test-controlled collaborators.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/unit/rules/customer-terms-rules.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/unit/rules/customer-terms-rules.spec.js
    assertion_titles:
      - the customer terms’ rules
      - the vocabulary
      - >-
        names the collection statuses, the remitting agreements and the party
        kinds of the design
      - 'defaults to no terms, not set, no allow-list, not set and no note'
      - the answer
      - >-
        answers a party without a record the defaults, saying so, with no id and
        no version
      - 'answers a party’s record as it is, not the defaults'
      - an invoice’s payment terms
      - takes the terms the request names over the bill-to’s
      - 'takes the bill-to’s default terms when the request names none, or null'
      - >-
        takes none when neither the request nor the bill-to names terms, or the
        bill-to has no record
      - the PUT body
      - 'accepts an empty body: every setting takes its default'
      - >-
        accepts a record read and sent back as it was, the defaults answer
        included
      - >-
        refuses an allow-list of more than 50 ids, an id over 100 characters,
        and an id named twice
      - >-
        refuses a collection status or a remitting agreement outside the
        vocabulary
      - refuses a property it does not know
      - the request mapper
      - >-
        maps the body to the write’s input and its version; a setting left out
        is absent or null
      - refuses a body naming another tenant or another party than the path
      - refuses a path party kind that is neither contact nor organization
    imports:
      - 'const { expect } = require(''chai'');'
      - '} = require(''../../../db/customer-terms.table'');'
      - >-
        const { customerTermsAnswerOf, invoicePaymentTermsIdOf } =
        require('../../../services/customers/customer-terms-rules');
      - >-
        const { customerTermsPartyOf, customerTermsPutSchema } =
        require('../../../aws/api/customer-terms.schemas');
      - >-
        const { mapPutCustomerTermsRequest } =
        require('../../../aws/api/customer-terms.routes');
    test_double_declarations: []
---

# Customer terms rules suite

## Verification Boundary

The suite exercises financial calculations and input contracts in an isolated test process. Registration records the existing executable file; it does not report a run or establish product approval.

## What This Suite Proves

The executable assertions exercise this module, but no capability or feature scenario binding is established for this file. Its individual assertion titles remain in the evidence register for subsequent mapping.

## What It Does Not Prove

Pure calculations and doubled collaborators do not establish database persistence, route authorization or deployed behavior. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The imported calculation or contract runs with the fixtures and collaborators declared by the test. The evidence register retains those declarations so the boundaries can be inspected.

## Must Not Be Doubled

The calculation or contract being asserted must remain real; replacing it with a predetermined result removes this suite’s evidence.
