Skip to content

CAP-ACC-PRD-004Save product corrections against the version read

Markdown

CAP-ACC-PRD-004

Save product corrections against the version read

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
Corrections respect intervening changes.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D4services-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#R10

Controls

24 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-LOG-005 TC-PI-001 TC-PI-003 TC-PI-005

Permissions

KeyChecked atScope
accounting.products.updateapitenant

Business Rules

11 rules, 9 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
Replacement requires the version originally read and rejects a stale version without persisting changes.
validationapi, servicetest
02must prove
Proposed
Replacement clears omitted optional fields and replaces every owned collection, except an omitted confirmation setting retains its stored value.
policyapi, servicetest
03must prove
Proposed
Replacement rejects a body identity differing from the addressed product and refuses changes to kind or business unit.
validationapi, servicetest
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 400 to a body whose id is not the path’s: an id never changes
04must prove
Proposed
Retired products reject replacement until reactivated.
lifecycleservicetest
05must prove
Proposed
An update-locked product accepts replacement only when the request explicitly removes that lock or reduces it to delete-only; product editors may make that change.
permissionapi, servicetest
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a locked product replaced without stating sys_locked, or with the same lock
06must prove
Proposed
A failed replacement preserves the previous product, prices and components.
invariantservicetest
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#leaves the old prices and components when a rule refuses the replacement
07
Proposed
Product replacement holds the product lock throughout its transaction, serializing it with other product and accounting setup writes.
invariantserviceobserved
08must prove
Proposed
Product replacement requires product update permission.
permissionapitest
09must prove
Proposed
A replacement naming another workspace is rejected, while submitted pricing model, accounting summary and tax class are discarded as derived values.
validationapiobserved
10must prove
Proposed
Console replacement resends loaded values for availability, portal visibility and settings whose controls are hidden.
policyconsoleobserved
11
Proposed
A console save rejected for a newer version explains the conflict and offers Reload.
policyconsoletest

Scenarios

IdGivenWhenThenProvenance
01Two administrators read the same product version.One saves a price and the other then saves a name.The later save conflicts and offers a reload.test
02An API client configured a ceiling, task instructions and quantity bands.Finance changes the product name through the console.Those stored settings survive the correction.test

Edge Cases

IdGivenWhenThenProvenance
03A product has an update-and-delete lock.A replacement repeats the existing lock.The request fails with lock-removal guidance.test
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a locked product replaced without stating sys_locked, or with the same lock

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.