Skip to content

CAP-COM-ORD-017Arrange vendor stock purchases

Markdown

CAP-COM-ORD-017

Arrange vendor stock purchases

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

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
Purchasing staff can inspect the supplier commitments and quantities still due.Received purchase orders use closing rather than cancellation.
Surfaces
api
Intent sources
services-commerce:docs/migrations/purchasing/README.md#D-P8P-16. A supplier's country is one of ISO 3166-1 alpha-2's assigned codes (Q07, Andrew 2026-10-19)

Controls

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

Permissions

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

Business Rules

7 rules, 6 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
Vendor e-mail is normalized to lower case, replacement requires the current version and supplier countries must be assigned two-letter country codes.
origin: services-commerce:docs/migrations/purchasing/README.md#D-P8P-16. A supplier's country is one of ISO 3166-1 alpha-2's assigned codes (Q07, Andrew 2026-10-19)
no proof recorded yet
validationapi, databasetest
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#refuses a supplier address whose country is not an ISO 3166-1 code (ZZ), on a create and on a replacement, 400 naming address.country
02must prove
Proposed
A vendor referenced by purchase orders or receipts cannot be deleted.
no proof recorded yet
invariantservice, databasetest
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#refuses a receipt against the received order 409, a receipt line with no quantity 400, and the vendor’s delete 409
03must prove
Proposed
Staff draft a numbered purchase order and replace it only while draft at the version read, accepting read-only fields on round-trip but rejecting unknown line fields before issue.
no proof recorded yet
lifecycleapi, servicetest
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#replaces the draft at the version read with the record exactly as it was read, read-only line columns included, and answers the same lines one version on
04must prove
Proposed
A purchase order can be cancelled before receipt in draft or issued state; after receipt it can be closed to cancel the remainder, and individual open line quantities can also be cancelled.
no proof recorded yet
lifecycleservicetest
services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status
05must prove
Proposed
The remaining purchase quantity equals ordered units minus received and cancelled units.
no proof recorded yet
calculationservicetest
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#is the ordered quantity less what was received and cancelled
06must prove
Proposed
Purchasing readers can inspect records but cannot change them, with application access, security context and workspace isolation enforced on the API.
no proof recorded yet
permissionapitest
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#lets a reader list and read, refuses the reader every write 403 permission_missing, a denied principal 403 app_not_permitted, no context 401, and another tenant 404
07
Proposed
Purchase orders distinguish draft, issued, partially received, received, closed and cancelled states.
lifecycledatabaseobserved

Scenarios

IdGivenWhenThenProvenance
01A supplier commitment covers one hundred tote bags.Staff receive sixty, then the remainder with freight, and close the order.The purchase progresses through partial receipt, completed receipt and closing.unknown

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.