Skip to content

CAP-COM-CAT-010Configure qualifying price audiences

Markdown

CAP-COM-CAT-010

Configure qualifying price audiences

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Audience naming and ordering avoid conflicting selections.No group of customers silently edits price because an audience was deleted.
Surfaces
consoleapi
Intent sources
services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D1services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D7services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D10services-commerce:docs/milestones/plans/COMM-M1-plan.md#2. Scope (item 4)services-commerce:docs/milestones/plans/COMM-M1-plan.md#4. Assumptions (A4, A8)

Controls

31 controls apply, from the corpus control catalogue.

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-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-004 TC-LOG-005 TC-CHG-001 TC-CHG-002 TC-CHG-003 TC-CHG-004 TC-CHG-007 TC-AVL-005 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.pricing-audiences.readapitenant
commerce.pricing-audiences.createapitenant
commerce.pricing-audiences.updateapitenant
commerce.pricing-audiences.deleteapitenant
commerce.pricing-audiences.bulkapitenant

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
Standard and Member are built-in audiences at ranks zero and ten, respectively, with Standard covering everyone and Member using eligibility and public display; neither can be removed or change kind.
no proof recorded yet
invariantservice, databasetest
services-commerce:modules/pricing/tests/e2e/pricing-audiences.e2e.spec.js#lists standard for everyone at rank 0 and member by eligibility at rank 10, built in, member shown to visitors, with no binding yet
02must prove
Proposed
Audience ranks are nonnegative and unique within a workspace.
no proof recorded yet
validationservice, databasetest
services-commerce:modules/pricing/tests/e2e/pricing-audiences.e2e.spec.js#answers 400 with the problem code audience_rank_taken to a rank another audience holds, creating nothing
03must prove
Proposed
Audience names, including built-ins, remain unique after case and spacing normalization; creation or renaming onto an occupied name identifies the existing audience in a refusal.
no proof recorded yet
validationservice, databasetest
services-commerce:modules/pricing/tests/integration/services/persistence/pricing-audiences.integration.spec.js#refuses a create to the same name in other letter case and spacing, 409 audience_name_taken naming the existing audience
04must prove
Proposed
An audience covers everyone, eligible subjects or selected membership operations; operation audiences require operations and eligibility bindings belong only to eligibility audiences.
no proof recorded yet
validationapi, databasetest
services-commerce:modules/pricing/tests/integration/db/member-pricing-tables.table.integration.spec.js#refuses an operation audience without an operation, and operations on another kind, by pricing_audiences_operations_check
05must prove
Proposed
Price references prevent audience deletion, with the refusal reporting the product count and up to five products so staff can deactivate the audience instead.
origin: COMM-M1 D7 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
no proof recorded yet
lifecycleservicetest
services-commerce:modules/pricing/tests/integration/services/persistence/pricing-audiences.integration.spec.js#refuses 409 audience_in_use, naming the products and their count, and keeps the audience
06must prove
Proposed
Deactivation removes an audience from price selection without deleting its prices, which become usable again after reactivation.
origin: COMM-M1 D7 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
no proof recorded yet
lifecycleservicetest
services-commerce:modules/pricing/tests/integration/services/inputs/pricing-inputs.integration.spec.js#loads the active audiences in rank order, the inactive left out, and the period each schedule is in at the instant
07must prove
Proposed
An eligibility audience without a selected rule qualifies no buyer and produces a warning.
no proof recorded yet
policyservicetest
services-commerce:modules/pricing/tests/unit/engine/step-2-audience-resolution.spec.js#warns of an audience with no binding, and holds nobody for it; a binding the batch did not answer is simply not held
08
Proposed
Public-display selection exposes an audience’s price beside Standard pricing to anonymous visitors.
origin: COMM-M1 D10 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
policyservice, consoletest
services-commerce:modules/pricing/tests/e2e/price-quote-public-display.e2e.spec.js#shows the Standard price 2500 with the Members price 2000 beside it when the Member audience is marked public, and the sign-in notice
09
Proposed
Accounting’s imported special-price handovers become product-scoped audiences once, while rank conflicts retain an unresolved handover with its reason.
lifecycleservicetest
services-commerce:modules/pricing/tests/integration/services/handovers/audience-handover-realization.integration.spec.js#leaves a handover whose rank another audience of the tenant holds, naming the rank
10must prove
Proposed
Audience inspection requires read permission and audience changes require administrator write permissions.
no proof recorded yet
permissionapi, consoletest
services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#is refused the creates, replacements and deletes, 403 permission_missing, each leaving the record as it was
11must prove
Proposed
Audience replacement sends the complete record at the read version and refuses a stale version.
no proof recorded yet
invariantapi, servicetest
services-commerce:modules/pricing/tests/e2e/pricing-audiences.e2e.spec.js#answers 409 to a stale version, 400 to a body whose id is not the path’s, and 400 to a replacement without its version
12must prove
Proposed
A full lock prevents replacing an audience, and either full or deletion-only locking prevents removing it.
no proof recorded yet
policyserviceobserved

Scenarios

IdGivenWhenThenProvenance
01Product prices reference RetireeAttempt audience deletion and then deactivationDeletion reports the dependent product count and references; deactivation succeedstest
services-commerce:modules/pricing/tests/e2e/pricing-audiences.e2e.spec.js#refuses the delete 409 audience_in_use with the sentence and the details
02The Member name is already occupiedCreate an audience under a spaced case variant of that nameNormalized-name validation identifies the existing audiencetest
services-commerce:modules/pricing/tests/e2e/pricing-audiences.e2e.spec.js#answers 409 audience_name_taken to a rename onto the built-in’s name, and 200 to the audience keeping its own

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.