Skip to content

CAP-ACC-PRD-010Configure discounts for quantity purchases

Markdown

CAP-ACC-PRD-010

Configure discounts for quantity purchases

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

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
Quantity incentives remain consistent across product saves.
Surfaces
consoleapi
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D12

Controls

21 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-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-PI-001 TC-PI-003

Permissions

KeyChecked atScope
accounting.products.updateapitenant

Business Rules

6 rules, 4 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
A quantity band includes both endpoints or has no upper endpoint and reduces unit price by a zero-to-one-hundred percentage with two decimals or a nonnegative minor-unit amount.
validationapi, service, databasetest
02must prove
Proposed
A band’s final quantity cannot be smaller than its initial quantity.
validationapi, service, databasetest
services-accounting:modules/products/tests/unit/rules/product-rules.spec.js#refuses a range that ends before it starts, naming the row
03must prove
Proposed
Quantity bands cannot overlap, and validation compares every pair and identifies the conflicting ranges.
✓ A band ending at nine can precede an open-ended band starting at ten.✗ Bands from one to ten and from ten to twenty overlap at ten.
invariantservicetest
04must prove
Proposed
Up to fifty bands replace the previous collection; empty feature arrays are rejected and an empty setting disables the feature.
validationapi, servicetest
05
Proposed
Documented responsibility leaves purchase-time discount application to Orders while retaining discount information in the portal projection.
policydocumented
06
Proposed
The console offers Bulk Pricing only for kinds that permit quantity discounts.
policyconsoleobserved

Scenarios

IdGivenWhenThenProvenance
01A publication offers quantity incentives.Staff configure ten percent for 10–49 copies and twenty percent above that.Both disjoint bands are accepted.test
services-accounting:modules/products/tests/unit/rules/product-rules.spec.js#accepts rules that cover no quantity twice, in any order

Edge Cases

IdGivenWhenThenProvenance
02A flat band reduces price by 150 minor units.An administrator saves it.The amount is accepted without applying a percentage ceiling.test
services-accounting:modules/products/tests/unit/rules/product-rules.spec.js#accepts a flat amount above 100, which is minor units

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.