---
id: CAP-ACC-PRD-006
title: Delete a product after its dependencies are removed
feature: FEAT-ACC-PRD-01
product_area: accounting
module: products
revision: 3
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - react-console acceptance inventory CAP-ACC-PRD-006
  - react-console acceptance inventory RUL-ACC-PRD-021
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3'
  - 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D11'
purpose: An administrator chooses Delete for a product that no longer needs a continuing identity.
outcomes:
  - Removal respects records that still depend on the product.
concepts:
  - CON-ACC-PRD-001
actors:
  - ACT-ACC-006
  - ACT-ACC-010
surfaces:
  - console
  - api
permissions:
  - key: accounting.products.delete
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-ACC-PRD-006-01
    proved_by: [ATS-ACC-PRD-005-09, ATS-ACC-PRD-006-01, ATS-ACC-PRD-006-11, ATS-ACC-PRD-011-09, TST-ACC-PRD-030, TST-ACC-PRD-031, TST-ACC-PRD-040]
    statement: Products included in another product’s bundle cannot be removed.
    kind: policy
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses
      deleting a product another product bundles, 409, and keeps it
    origin: 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3'
  - id: BR-CAP-ACC-PRD-006-02
    proved_by: [ATS-ACC-PRD-006-02, ATS-ACC-PRD-006-03, TST-ACC-PRD-011]
    statement: >-
      Invoice product references, invoice discount-product references and installment line references prevent
      product deletion.
    kind: policy
    enforced_at:
      - database
    must_prove: true
    provenance: observed
    source: >-
      services-accounting:modules/transactions/db/invoice-lines.table.ts:invoice_lines_product_fk;
      modules/transactions/db/invoice-lines.table.ts:invoice_lines_discount_product_fk;
      modules/billing/db/installment-schedule-lines.table.ts:installment_schedule_lines_product_fk
    origin: 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3'
  - id: BR-CAP-ACC-PRD-006-03
    proved_by: [ATS-ACC-PRD-006-04, ATS-ACC-PRD-006-10, ATS-ACC-PRD-009-04, TST-ACC-PRD-031, TST-ACC-PRD-040]
    statement: >-
      Deletion cascades to prices, components, feature collections, accounting setup and its children, and
      migrated pricing handovers.
    kind: invariant
    enforced_at:
      - database
    must_prove: true
    provenance: test
    source: >-
      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
    origin: none
  - id: BR-CAP-ACC-PRD-006-04
    proved_by: [ATS-ACC-PRD-006-05, TST-ACC-PRD-040, TST-ACC-PRD-066]
    statement: Either product lock prevents deletion.
    kind: permission
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses
      a product locked against deletes
    origin: 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D11'
  - id: BR-CAP-ACC-PRD-006-05
    proved_by: [ATS-ACC-PRD-006-06, ATS-ACC-PRD-006-11, ATS-ACC-PRD-015-17, TST-ACC-PRD-040]
    statement: A lock preventing deletion of the accounting setup also prevents deletion of its owning product.
    kind: permission
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      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)
    origin: 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D11'
  - id: BR-CAP-ACC-PRD-006-06
    proved_by: [ATS-ACC-PRD-006-07, ATS-ACC-PRD-006-11, ATS-ACC-PRD-014-07, TST-ACC-PRD-039]
    statement: >-
      After product deletion commits, Accounting clears its owned confirmation template; cleanup failure is
      logged and leaves the deletion committed.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/products/tests/integration/services/persistence/products.features.integration.spec.js#leaves
      the delete standing when Platform cannot clear the template
    origin: none
  - id: BR-CAP-ACC-PRD-006-07
    proved_by: [ATS-ACC-PRD-006-08, TST-ACC-PRD-030]
    statement: A business unit containing products cannot be deleted.
    kind: policy
    enforced_at:
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 409 to deleting a business
      unit that still has products
    origin: none
  - id: BR-CAP-ACC-PRD-006-08
    proved_by: [ATS-ACC-PRD-006-09, TST-ACC-PRD-028]
    statement: Product deletion requires product delete permission.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js#is refused deleting a
      product
    origin: 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3'
  - id: BR-CAP-ACC-PRD-006-09
    proved_by: [ATS-ACC-PRD-006-10]
    statement: Deletion returns not found for products outside the current workspace or absent from it.
    kind: validation
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#answers
      another tenant’s product as absent and leaves it
    origin: none
scenarios:
  - id: SC-CAP-ACC-PRD-006-01
    given: A mistaken product has prices and accounting configuration.
    when: An administrator confirms Delete in the row menu.
    then: The product and owned configuration disappear and subsequent retrieval returns not found.
    provenance: test
    source: 'react-console:acceptance/accounting/playwright/journeys/products/ACT-ACC-0107.spec.ts#ACT-ACC-0107'
edge_cases:
  - id: SC-CAP-ACC-PRD-006-02
    given: A second product includes this product in its bundle.
    when: An administrator attempts deletion.
    then: Removal fails with guidance about the bundle dependency.
    provenance: test
    source: >-
      services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 409 to deleting a product a
      bundle includes
constraints: []
depends_on: []
related:
  - CAP-ACC-PRD-005
  - CAP-ACC-PRD-011
  - CAP-ACC-PRD-014
  - CAP-ACC-PRD-015
journeys:
  - JNY-ACC-PRD-002
open_questions: []
evidence:
  - 'react-console:acceptance/accounting/playwright/journeys/products/ACT-ACC-0107.spec.ts'
  - 'react-console:components/accounting-config/products/product-row-actions.tsx'
  - 'services-accounting:docs/accounting/products.md'
  - 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md'
  - 'services-accounting:modules/billing/db/installment-schedule-lines.table.ts'
  - 'services-accounting:modules/products/aws/api/products.routes.ts'
  - 'services-accounting:modules/products/services/confirmation-emails/confirmation-email-templates.ts'
  - 'services-accounting:modules/products/services/persistence/product-refusals.ts'
  - 'services-accounting:modules/products/services/persistence/products.ts'
  - 'services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js'
  - 'services-accounting:modules/products/tests/e2e/products.e2e.spec.js'
  - 'services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js'
  - >-
    services-accounting:modules/products/tests/integration/services/persistence/products.features.integration.spec.js
  - 'services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js'
  - 'services-accounting:modules/transactions/db/invoice-lines.table.ts'
controls: [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]
exercised_by: [FAS-ACC-PRD-01-03, FAS-ACC-PRD-01-04]
suites: [TST-ACC-PRD-011, TST-ACC-PRD-028, TST-ACC-PRD-030, TST-ACC-PRD-031, TST-ACC-PRD-039, TST-ACC-PRD-040, TST-ACC-PRD-066]
---

# Delete a product after its dependencies are removed

## Purpose

An administrator chooses Delete for a product that no longer needs a continuing identity.

## How It Works

An administrator chooses Delete for a product that no longer needs a continuing identity. The service checks its lock and the accounting setup’s lock. Database references prevent removal while another bundle or a transaction depends on it. Successful deletion removes the product’s owned configuration. The template cleanup happens after that commit. A cleanup failure therefore leaves a removed product and requires operational follow-up. Some transaction-reference refusals still surface as server errors rather than useful explanations. Product delete authority does not bypass those dependencies.

## Relationships

The product record supplies the identity and configuration used by this outcome.
