Skip to content

CAP-COM-CAT-007Manage merchandise selections and sale availability

Markdown

CAP-COM-CAT-007

Manage merchandise selections and sale availability

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

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
Merchandise preparation retains atomic persistence with its Accounting product.A buyer is does not sold stock that is not there except when backorders are allowed.
Surfaces
consoleapi
Intent sources
services-commerce:docs/milestones/walkthroughs/COMM-M1-handoff.md#What changed after your review (6)services-commerce:docs/milestones/COMM-M1b-promotions-and-codes.md#Decisions (R6)

Controls

22 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-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.merchandise.readapitenant
commerce.merchandise.createapitenant
commerce.merchandise.updateapitenant
commerce.merchandise.deleteapitenant
commerce.merchandise.bulkapitenant

Business Rules

14 rules, 12 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
Commerce permits one merchandise extension for an existing Accounting merchandise product and refuses unknown products, other product types and duplicate extensions.
validationservice, databasetest
services-commerce:modules/merchandise/tests/e2e/merchandise.e2e.spec.js#answers 400 to a product the tenant has not, a selection off the sets, a SKU in use and a second extension, naming the rule
02must prove
Proposed
Merchandise and Accounting product creation or replacement commit together, rolling back both when either validation fails.
invariantservicetest
03must prove
Proposed
Accounting refuses a merchandise price grid without a Standard price in the product’s base currency.
origin: COMM-M1 D6 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
validationservicetest
04must prove
Proposed
Retirement changes the Accounting product’s status while retaining its merchandise extension, and a repeated retirement is refused.
lifecycleservicetest
services-commerce:modules/merchandise/tests/e2e/merchandise.e2e.spec.js#retires the product at its version, keeping the extension; a second retirement is 409
05must prove
Proposed
Stock references to merchandise variants prevent deletion of the merchandise extension.
lifecycleservicetest
services-commerce:modules/merchandise/tests/integration/services/persistence/merchandise.integration.spec.js#refuses to delete an extension whose SKUs inventory items hold (409), deletes one that has none, and answers 404 for one the tenant has not
06must prove
Proposed
Variant SKUs are unique within the workspace, each selection supplies exactly one permitted value per variant option set, and selections cannot repeat within a product.
validationservice, databasetest
services-commerce:modules/merchandise/tests/integration/db/merchandise-tables.table.integration.spec.js#refuses one SKU twice in a tenant (merchandise_variants_sku_uq) and one selection twice for a product (merchandise_variants_selection_uq), while another tenant may use the SKU
07
Proposed
Replacement retains variant identities for retained SKUs and removes omitted SKUs, preserving inventory references to the retained variants.
invariantservicetest
services-commerce:modules/merchandise/tests/integration/services/persistence/merchandise.integration.spec.js#replaces the extension at its version: the kept SKU keeps its id, a new SKU is added, a dropped one goes
08must prove
Proposed
Option sets distinguish variant values from modifiers: modifiers must use permitted values, variant sets have no modifier options, and empty sets are refused.
validationservice, databasetest
services-commerce:modules/merchandise/tests/integration/services/persistence/merchandise.integration.spec.js#refuses a modifier option off the set’s values, a variant set with options, and an empty set, 400
09must prove
Proposed
Availability compares requested quantity with tracked stock: sufficient stock above the threshold is available, a smaller remainder is limited, and shortfalls either become permitted backorders or refusals; untracked stock remains available.
calculationservicetest
services-commerce:modules/merchandise/tests/unit/participant/merchandise-availability.spec.js#is unavailable with what is left when stock is short and the product prohibits backorders: the line is refused
10must prove
Proposed
Merchandise lines reject notes exceeding two hundred counted characters and selections that identify no variant.
validationservicetest
services-commerce:modules/merchandise/tests/unit/participant/merchandise-payload.spec.js#limits a note to 200 characters, counted as the person sees them: an emoji is one, so 201 characters are refused and 200 are not (COM-ACC-0015)
11must prove
Proposed
The isolated pricing engine uses supplied variant prices and modifiers, but ordinary product loading supplies empty lists and does not connect those adjustments to quotes.
calculationserviceobserved
12must prove
Proposed
Merchandise reads require read permission, writes require administrator permissions, and the merchandise contract rejects custom fields.
permissionapi, consoletest
services-commerce:modules/merchandise/tests/e2e/merchandise.e2e.spec.js#lets a reader list and read, and refuses it every write 403 permission_missing, leaving the records as they were
13
Proposed
Staff manage merchandise and its listing in one item screen, and the former listing address redirects to that item.
origin: COMM-M1 walkthrough ruling R1 (docs/milestones/walkthroughs/COMM-M1-handoff.md)
policyconsoletest
react-console:e2e/mock/merchandise.mock.spec.ts#the old Listings address opens the same item
14must prove
Proposed
A full lock prevents replacing a merchandise extension, and either full or deletion-only locking prevents removing it.
policyserviceobserved

Scenarios

IdGivenWhenThenProvenance
01One cap remains and backorders are prohibitedRequest two capsAvailability refuses the line for insufficient stock and reports one remainingtest
02Tracked shirt stock is insufficient and backorders are enabledRequest more shirts than available stockThe line proceeds with the shortfall reported as a backordertest
services-commerce:modules/merchandise/tests/integration/services/participant/merchandise-participant.integration.spec.js#answers the shirt short of stock ok with backorders allowed, the shortfall named as a warning and in the conditions, the SKU resolved from the selection

Edge Cases

IdGivenWhenThenProvenance
03A new backordered SKU has no inventory rowRun competing placement claims for that SKUBoth claims succeed while sharing one inventory itemtest

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.