---
id: ADR-ACC-PRD-002
title: Domain Transactions Include the Common Product Write
product_area: accounting
module: products
revision: 3
status: proposed
design_intent: confirmed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: A server-side domain save calls Accounting's product function inside its own transaction before saving
  the extension, while the console uses separate successive requests.
constrains:
- SVC-ACC-PRD-products
- WF-ACC-PRD-004
- WF-ACC-PRD-002
- DOM-ACC-PRD-001
origin: 'services-accounting:docs/migrations/accounting-modernization/products-shared/README.md#D-2 (Andrew,
  2026-10-18: A then B)'
alternatives:
- option: Let Accounting write both base and extension.
  why_not: This requires Accounting to understand and modify every domain's owned structures.
- option: Save through Accounting HTTP and then save the extension.
  why_not: Independent commits cannot provide the server-side atomicity chosen by Product.
consequences:
- SQL and service validators need to be maintained together.
- The database session identifies the workspace, actor and calling application.
- The domain function does not compose owned templates or write accounting setups.
- Current bundle and audience checks demonstrate incomplete parity.
supersedes: []
evidence:
- 'services-accounting at f47cb263: docs/accounting/products.md (The domain write path); db/migrations/20261019201047_product_lock_and_held_bundle_components.sql;
  modules/products/tests/integration/db/save-product-function.integration.spec.js.'
---

# Domain Transactions Include the Common Product Write

## Context

An HTTP call cannot join the domain's local transaction. The recorded choice supplies a database function so the domain controls the complete write boundary.

## Decision

A server-side domain save calls Accounting's product function inside its own transaction before saving the extension, while the console uses separate successive requests.

## Alternatives Considered

Let Accounting write both base and extension. This requires Accounting to understand and modify every domain's owned structures.

Save through Accounting HTTP and then save the extension. Independent commits cannot provide the server-side atomicity chosen by Product.

## Consequences

The real domain failure after a common save still needs execution proof. Separate console requests preserve successful stages and do not substitute for the approved server transaction.
