Skip to content

CAP-ACC-BKS-004Maintain dated exchange rates for a unit

Markdown

CAP-ACC-BKS-004

Maintain dated exchange rates for a unit

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationPartially observed

KindCapabilityProduct areaAccountingModuleBooks, Business Units and Chart of AccountsRevision1

Read atservices-accounting f47cb263react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Dated resolution selects the latest eligible quote.Provider quote correction uses removal and refilling rather than manual editing.Commerce and Accounting share the same resolved quote.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/plans/ACCT-M1-plan.md#2. Scopeservices-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D4services-accounting:docs/architecture/accounting-2.0/02-decisions.md#P-3services-accounting:docs/architecture/accounting-2.0/02-decisions.md#P-4services-accounting:docs/architecture/accounting-2.0/02-decisions.md#P-5

Controls

27 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
accounting.exchange-rates.readapitenant
accounting.exchange-rates.createapitenant
accounting.exchange-rates.updateapitenant
accounting.exchange-rates.deleteapitenant

Business Rules

8 rules, 7 to be proved before approval. A rule's product intent is derived from its origin: 8 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
A rate is positive decimal text with no more than eight integer and ten fractional digits for a supported non-base currency on a valid date; numeric input is refused to preserve precision.
✓ A valid configuration completes the stated operation.✗ A conflicting configuration receives the stated refusal.
validationapi, service, databasetest
services-accounting:modules/books/tests/unit/rules/exchange-rate-rules.spec.js#refuses a number (digits would be lost), zero, a negative, more than ten places, nine integer digits and a word
02must prove
Confirmed
A unit has at most one rate for each currency and date, and a saved rate cannot change its unit, currency, date or source.
invariantservice, databasetest
services-accounting:modules/books/tests/integration/services/persistence/exchange-rates.integration.spec.js#refuses changing the unit, the currency or the day: a rate’s identity is write-once
03must prove
Confirmed
Rate resolution returns the latest quote on or before the requested date, defaulting to the workspace’s current date, with source and pricing settings or no quote; Commerce uses the same database answer.
calculationservice, databasetest
04must prove
Confirmed
Provider rates cannot be edited manually; deletion is permitted, so correction requires deletion followed by another fill.
policyserviceobserved
05must prove
Confirmed
Provider filling makes one request outside the database transaction for missing quotes among selected provider currencies, skips existing dated quotes, reports unpriced currencies and stores quotes on the provider’s date.
calculationservicetest
services-accounting:modules/books/tests/integration/services/persistence/exchange-rates.integration.spec.js#skips a currency whose day already holds a rate, reports one the provider did not price, and stores a quote on the provider’s own earlier day
06must prove
Confirmed
Filling refuses table-sourced or unsupported currencies and units without provider currencies, and writes nothing when the provider is unavailable or declines.
validationservicetest
07must prove
Confirmed
Conversion rounds half away from zero at the target currency’s precision, while reciprocal rates round half up to ten decimal places.
calculationservicetest
services-accounting:modules/books/tests/unit/rules/exchange-rate-rules.spec.js#applies the target currency’s exponent exactly: 100.00 USD at 149.37 is 14937 yen
08
Confirmed
Rate lists order by unit, currency and descending date, support unit, currency and inclusive date filters, and provider filling requires rate-create permission.
policyapi, servicetest

Scenarios

IdGivenWhenThenProvenance
01The unit maintains Canadian-dollar quotes manually.Staff enter today’s and last week’s quotes and resolve yesterday’s rate.Resolution returns last week’s quote together with table sourcing and calculated-price handling.test
02The development workspace has no available provider connection.The controller requests a provider fill.The request reports provider unavailability without saving a quote.test
services-accounting:modules/books/tests/e2e/exchange-rates.e2e.spec.js#refuses the fill 409 provider_unavailable while no platform client exists, writing nothing

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.