Skip to content

CAP-ACC-PRD-006Delete a product after its dependencies are removed

Markdown

CAP-ACC-PRD-006

Delete a product after its dependencies are removed

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
Removal respects records that still depend on the product.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D11

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

Permissions

KeyChecked atScope
accounting.products.deleteapitenant

Business Rules

9 rules, 8 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
Products included in another product’s bundle cannot be removed.
policyservice, databasetest
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses deleting a product another product bundles, 409, and keeps it
02must prove
Proposed
Invoice product references, invoice discount-product references and installment line references prevent product deletion.
policydatabaseobserved
03must prove
Proposed
Deletion cascades to prices, components, feature collections, accounting setup and its children, and migrated pricing handovers.
invariantdatabasetest
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#takes its prices, components, accounting setup and the setup’s collections with it
04must prove
Proposed
Either product lock prevents deletion.
permissionservicetest
05must prove
Proposed
A lock preventing deletion of the accounting setup also prevents deletion of its owning product.
permissionservicetest
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)
06must prove
Proposed
After product deletion commits, Accounting clears its owned confirmation template; cleanup failure is logged and leaves the deletion committed.
lifecycleservicetest
07must prove
Proposed
A business unit containing products cannot be deleted.
policydatabasetest
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 409 to deleting a business unit that still has products
08must prove
Proposed
Product deletion requires product delete permission.
permissionapitest
09
Proposed
Deletion returns not found for products outside the current workspace or absent from it.
validationservicetest

Scenarios

IdGivenWhenThenProvenance
01A mistaken product has prices and accounting configuration.An administrator confirms Delete in the row menu.The product and owned configuration disappear and subsequent retrieval returns not found.test

Edge Cases

IdGivenWhenThenProvenance
02A second product includes this product in its bundle.An administrator attempts deletion.Removal fails with guidance about the bundle dependency.test
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 409 to deleting a product a bundle includes

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.