Skip to content

ATS-ACC-PRD-015Assign a product’s accounting treatment: Capability Test Specification

Markdown

ATS-ACC-PRD-015

Assign a product’s accounting treatment: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleProductsRevision3

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

  • Rule covered
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

17 scenarios proving CAP-ACC-PRD-015; 14 bound to an existing test.

01 Missing setup is explicit on readsruleapitest
Proves
BR-CAP-ACC-PRD-015-01
Preconditions
A product has no accounting setup.
Steps
Read the product and request its full setup.
Expected
The summary is empty and the full setup request returns not found.
Data
A product has no accounting setup.
Bound to
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers accounting: null on the product
02 Revenue requirements follow sellabilityvalidationapinegativetest
Proves
BR-CAP-ACC-PRD-015-02
Preconditions
Accounting, Donation and Legacy fixtures are available.
Steps
Save each setup without a revenue account.
Expected
Sellable kinds fail and Legacy configuration succeeds.
Data
Accounting, Donation and Legacy fixtures are available.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to an Accounting Product without a revenue GL account
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to a Donation Product without a revenue GL account
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#accepts a Legacy Product without a revenue GL account
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to an Accounting Product without a revenue GL account
03 Financial references stay within the product unitboundaryunitnegativetest
Proves
BR-CAP-ACC-PRD-015-03 INV-DOM-ACC-PRD-004-02
Preconditions
Two units have charts, dimensions and merchant records.
Steps
Assign foreign-unit or missing references to setup fields.
Expected
Every invalid reference fails with scope or absence details.
Data
Two units have charts, dimensions and merchant records.
Bound to
Source
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#refuses a revenue GL account of another business unit, naming both units
04 Account categories match their slotsvalidationunitnegativetest
Proves
BR-CAP-ACC-PRD-015-04 INV-DOM-ACC-PRD-004-03
Preconditions
The chart contains each account category.
Steps
Assign incompatible categories to setup slots and then supply matching categories.
Expected
Mismatches fail and the correctly categorized setup succeeds.
Data
The chart contains each account category.
Bound to
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
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#refuses an account of the wrong kind in the write-off, cost of goods sold and inventory slots
services-accounting:modules/products/tests/unit/rules/product-rules.spec.js#refuses revenue booked to an asset account, naming the slot and the types it takes
Source
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
05 Held inactive references remain editableedgeunitnegativetest
Proves
BR-CAP-ACC-PRD-015-05 INV-DOM-ACC-PRD-004-05
Preconditions
A setup retains an account later deactivated and other inactive references exist.
Steps
Correct notes, move the account to a new slot and newly choose inactive records.
Expected
The notes correction retains the account and new inactive assignments fail.
Data
A setup retains an account later deactivated and other inactive references exist.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 200 at the next version, keeping the inactive account it already held
Source
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#refuses it newly named in another field
06 Tax assignment respects workspace and retentioninteractionapinegativetest
Proves
BR-CAP-ACC-PRD-015-06
Preconditions
Class fixtures include active, foreign and inactive choices.
Steps
Choose an active class, clear it, try invalid choices and resave a held retired class.
Expected
Eligible assignments and retained classes succeed; invalid new choices fail.
Data
Class fixtures include active, foreign and inactive choices.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#keeps the class it already names after the class is retired
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to newly choosing an inactive tax class
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#keeps the class it already names after the class is retired
07 Setup replacement requires its own versionconcurrencyapinegativetest
Proves
BR-CAP-ACC-PRD-015-07
Preconditions
A product initially has no setup.
Steps
Create its setup, then replace without a version and with an old version.
Expected
Creation starts at one and invalid replacement versions fail.
Data
A product initially has no setup.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to a replacement without the version read
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to a replacement without the version read
08 Setup replacement is transactionalfailureunitnegativetest
Proves
BR-CAP-ACC-PRD-015-08 INV-DOM-ACC-PRD-004-09
Preconditions
A setup contains each supported collection.
Steps
Omit values in a valid replacement and cause validation and database failures in later attempts.
Expected
Valid omission clears values and failed attempts preserve the last complete setup.
Data
A setup contains each supported collection.
Bound to
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#answers the replaced setup at version 2, its cleared fields left out and every collection replaced
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#leaves the previous setup and collections when the database refuses a new row after the old ones were removed
Source
services-accounting:modules/products/tests/integration/services/persistence/product-accounting-setups.integration.spec.js#leaves the previous setup and collections when a rule refuses the replacement
09 Setup locks require deliberate removalpermissionunitnegativetest
Proves
BR-CAP-ACC-PRD-015-09
Preconditions
Setups have update and delete locks.
Steps
Replace without changing the update lock, clear it explicitly and delete a still delete-locked setup.
Expected
Only the deliberate unlock replacement succeeds.
Data
Setups have update and delete locks.
Bound to
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
services-accounting:modules/products/tests/unit/api/products-api-mapper.spec.js#keeps an explicit null on an accounting setup replacement
Source
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
10 Deleting setup preserves product identitytransitionapitest
Proves
BR-CAP-ACC-PRD-015-10
Preconditions
A product has a setup.
Steps
Delete the setup and repeat deletion.
Expected
The product retains an empty summary and repeat deletion returns not found.
Data
A product has a setup.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#deletes it, leaving the product with accounting: null
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 404 to deleting a setup that does not exist
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#deletes it, leaving the product with accounting: null
11 Referenced book records cannot disappearinvariantapinegativetest
Proves
BR-CAP-ACC-PRD-015-11
Preconditions
A setup refers to accounts, dimensions, merchant configuration and a class.
Steps
Attempt deletion of referenced book records.
Expected
Dependencies reject those removals.
Data
A setup refers to accounts, dimensions, merchant configuration and a class.
Bound to
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 409 to deleting a GL account a setup still names
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 409 to deleting a tax class a setup still names
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses deleting a GL account a setup names as its revenue account
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 409 to deleting a GL account a setup still names
12 Catalogue and setup authority are independentpermissionapinegativetest
Proves
BR-CAP-ACC-PRD-015-12
Preconditions
Product-only, accounting-only and reader personas exist.
Steps
Read and mutate setups and attempt product creation under these personas.
Expected
Separate permissions determine each action without granting unrelated product creation.
Data
Product-only, accounting-only and reader personas exist.
Bound to
services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js#is refused changing a product’s accounting setup
services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js#is refused deleting a product’s accounting setup
Source
services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js#is refused reading a product’s accounting setup
13 Setup ownership cannot moveinvariantunitnegativetest
Proves
BR-CAP-ACC-PRD-015-13
Preconditions
A saved setup has a fixed product and unit.
Steps
Attempt direct changes to those ownership coordinates.
Expected
The write-once protection rejects the changes.
Data
A saved setup has a fixed product and unit.
Bound to
Source
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses a change of product_id (RHF01)
14 Resolve setup at posting and preserve an existing entryinteractionbrowsertest
Proves
BR-CAP-ACC-PRD-015-01 BR-CAP-ACC-PRD-015-16 AS-JNY-ACC-PRD-005-03
Preconditions
Two products lack setups, and an issued invoice remains unposted.
Steps
Assign revenue configuration to one product, post the invoice batch, then change that setup’s revenue account.
Expected
The configured product posts to its assigned revenue account, the other uses the unit default, and later correction leaves the posted account unchanged.
Data
A business unit with a revenue default and an alternative income account.
Bound to
Source
react-console:acceptance/accounting/playwright/journeys/products/ACT-ACC-0121.spec.ts#ACT-ACC-0121
15 First setup, replacement and removal change completenesstransitionapinegativeproposed
Proves
BR-CAP-ACC-PRD-015-07 BR-CAP-ACC-PRD-015-10
Preconditions
A product initially has no setup and valid account fixtures are available.
Steps
Create its setup, replace it at the returned setup version, delete it, and inspect the product after each action.
Expected
Completeness follows the setup state while the product identity remains fixed.
Data
A product initially has no setup and valid account fixtures are available.
Source
rhythm-v2-docs:specs/accounting/products/design/state-models/STATE-ACC-PRD-003-accounting-setup-lifecycle.md#transitions; services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#deletes it, leaving the product with accounting: null
16 Setup editors exercise every supported protection changetransitionapinegativeproposed
Proves
BR-CAP-ACC-PRD-015-09
Preconditions
A setup editor rereads its version before each replacement.
Steps
Move unlocked protection to each lock, delete-only protection to unlocked and combined, and explicitly reduce combined protection to each weaker setting.
Expected
The saved protection matches each supported request; replacement without explicit reduction of combined protection fails.
Data
A setup editor rereads its version before each replacement.
Source
rhythm-v2-docs:specs/accounting/products/design/state-models/STATE-ACC-PRD-002-record-lock.md#transitions; 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
17 Setup removal restores missing-setup and kind-default readsinteractionapinegativeproposed
Proves
BR-CAP-ACC-PRD-015-10 BR-CAP-ACC-PRD-006-05 BR-CAP-ACC-PRD-016-01 BR-CAP-ACC-PRD-017-01 BR-CAP-ACC-PRD-018-01
Preconditions
A product has a deferred setup class, a kind default and deletion protection on its setup.
Steps
Try product deletion, deliberately remove setup protection, delete the setup, and read the product and missing-setup list.
Expected
Setup protection blocks product removal; setup deletion keeps the product, restores kind fallback and returns it to missing-setup results.
Data
A product has a deferred setup class, a kind default and deletion protection on its setup.
Source
services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#deletes it, leaving the product with accounting: null; services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a product whose accounting setup is locked against deletes, leaving the product and its setup (DEF-ACT-0101); services-accounting:modules/products/tests/e2e/product-accounting.e2e.spec.js#answers 400 to deferral without a deferred revenue GL account; services-accounting:modules/products/tests/e2e/product-accounting-setups.e2e.spec.js#answers the active products with no setup, by name; services-accounting:modules/products/tests/e2e/products-shared-base.e2e.spec.js#lets the product’s own accounting setup class win over the type default

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.