Skip to content

CAP-ACC-PRD-007Keep domain products under their owning application

Markdown

CAP-ACC-PRD-007

Keep domain products under their owning application

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleProductsRevision4

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
Shared product writes respect application ownership.
Surfaces
apijob
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D4services-accounting:docs/migrations/accounting-modernization/products-shared/README.md#D-1services-accounting:docs/migrations/accounting-modernization/products-shared/README.md#D-2

Controls

25 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-IAM-006 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-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-002 TC-PI-003 TC-PI-005

Permissions

KeyChecked atScope
accounting.products.createservicerecord
accounting.products.updateservicerecord
accounting.products.deleteservicerecord

Business Rules

12 rules, 10 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
Service callers may mutate only product kinds owned by their application, with refusals identifying the owner, kind and caller.
permissionservice, databasetest
services-accounting:modules/products/tests/integration/services/persistence/products.shared-base.integration.spec.js#refuses Commerce creating a membership package, naming the owner, the type and the caller
02must prove
Proposed
Domain service callers cannot mutate Accounting-owned product kinds.
permissionservice, databasetest
03must prove
Proposed
Console and system callers may write any active product kind, allowing the console to save the common product before its domain extension.
permissionservicetest
services-accounting:modules/products/tests/unit/rules/product-rules.spec.js#lets a console caller write any type (the console calls Accounting first and the domain second)
04must prove
Proposed
A domain can save the common product within its own database transaction so the common record and extension share a commit boundary.
invariantdatabasetest
05must prove
Proposed
Database product writes derive workspace, actor and application from session context and reject sessions lacking a workspace or application identity.
permissiondatabasetest
06must prove
Proposed
The database saving path shares product validation sentences with Accounting and distinguishes invalid input, incompatible state, absence and unauthorized callers.
invariantdatabasetest
services-accounting:modules/products/tests/integration/db/save-product-function.integration.spec.js#refuses bundled prices above the product price with one sentence on both paths
07must prove
Proposed
The database saving path requires a supplied identity, writes no accounting setup and rejects product-owned confirmation content.
validationdatabasetest
services-accounting:modules/products/tests/integration/db/save-product-function.integration.spec.js#refuses a product-specific confirmation e-mail, which Accounting’s API composes
08must prove
Proposed
Database replacement preserves omitted scalar properties, clears explicit empty values and replaces collections in full.
policydatabasetest
services-accounting:modules/products/tests/integration/db/save-product-function.integration.spec.js#replaces the row and every collection as a whole, keeping an omitted property and clearing a null one
09
Proposed
The database path provides creation, replacement and retirement; console API reactivation and deletion currently expose no domain service route.
policydatabasedocumented
10
Proposed
Accounting permits a domain product without an extension record and leaves completion or retirement to that domain.
policyservicedocumented
services-accounting:docs/accounting/products.md#Who may write a product (the owner rule)
11must prove
Proposed
Database domain saving defaults an omitted component price to zero and compares unweighted component price sums with the bundle’s list prices.
calculationdatabaseobserved
12must prove
Proposed
Database domain saving continues admitting audiences already held by the product when Commerce’s audience registry exists.
validationdatabaseobserved

Scenarios

IdGivenWhenThenProvenance
01Membership saves a package inside its own transaction.The extension write fails after the common product save.The documented workflow expects rollback of both records, pending executable cross-domain proof.documented
02Commerce acts under its service identity.It attempts to create a Membership package.Ownership validation names Membership and rejects the write.test
services-accounting:modules/products/tests/integration/services/persistence/products.shared-base.integration.spec.js#refuses Commerce creating a membership package, naming the owner, the type and the caller

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.