Skip to content

CAP-ACC-PRD-015Assign a product’s accounting treatment

Markdown

CAP-ACC-PRD-015

Assign a product’s accounting treatment

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleProductsRevision3

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
Accounts and dimensions describe the product’s financial treatment.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D11services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D12services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#R21services-accounting:docs/migrations/accounting-modernization/products-shared/README.md#D-7

Controls

23 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-TEN-004 TC-DAT-001 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-PI-001 TC-PI-003 TC-PI-005

Permissions

KeyChecked atScope
accounting.product-accounting.readapitenant
accounting.product-accounting.updateapitenant
accounting.product-accounting.deleteapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Proposed
A product may lack an accounting setup, in which case its summary is empty and recorded posting policy uses unit defaults.
policyservicetest
02must prove
Proposed
Sellable products require a revenue account in their setup, while Legacy Products may omit it.
validationservicetest
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to an Accounting Product without a revenue GL account
03must prove
Proposed
Setup accounts and dimensions belong to the product’s unit, except tax classes belong to the workspace as a whole.
validationservice, databasetest
04must prove
Proposed
Receivable and inventory slots require asset accounts, revenue requires income, deferred revenue requires liability, and write-off and cost of goods sold require expense.
validationservicetest
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#refuses an asset account as the revenue account, naming the slot and the types it takes, and writes no setup
05must prove
Proposed
New setup references require active records; an inactive record retained in the same field remains acceptable.
validationservicetest
06must prove
Proposed
A setup tax class overrides its kind default, and an already held class remains acceptable after retirement.
policyservice, databasetest
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#keeps the class it already names after the class is retired
07must prove
Proposed
A first setup needs no read version, but existing setups require their read version and reject stale replacement.
validationservicetest
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to a replacement without the version read
08must prove
Proposed
Setup replacement clears omitted values and replaces all child collections transactionally, preserving previous data if it fails.
invariantservicetest
09must prove
Proposed
Update-locked setups require explicit lock removal for replacement, either lock blocks deletion, and authorized setup editors may remove locks.
permissionservicetest
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#unlocks a setup locked against updates when the replacement states sys_locked null, then deletes it
10must prove
Proposed
Deleting an accounting setup leaves its product intact with an empty accounting summary.
lifecycleservicetest
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#deletes it, leaving the product with accounting: null
11must prove
Proposed
Accounts, dimensions, merchant accounts and tax classes referenced by setups cannot be deleted while referenced.
invariantdatabasetest
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 409 to deleting a GL account a setup still names
12must prove
Proposed
Setup reads, replacement and deletion require separate product-accounting permissions, independent of product permissions.
permissionapitest
13must prove
Proposed
A setup’s product and business unit are fixed at creation and cannot change.
invariantservice, databasetest
14
Proposed
The console groups accounting into five cards, saves it separately after the product, and requires a receivable account beyond backend requirements.
policyconsoleobserved
15
Proposed
Accounting permits creation and replacement of setups on retired products.
policyserviceobserved
16must prove
Proposed
Changing an accounting setup after posting leaves the account recorded on the existing posted entry unchanged.
invariantservicetest

Scenarios

IdGivenWhenThenProvenance
01A workshop has no accounting setup.Finance supplies revenue, receivable and deferred accounts plus a department.The setup starts at version one and the product summary identifies its revenue account.test

Edge Cases

IdGivenWhenThenProvenance
02A caller has product management authority but no setup read authority.The caller requests full accounting setup.The setup read fails while product editing remains independently authorized.test

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.