Skip to content

ATS-COM-ORD-017Arrange vendor stock purchases: Capability Test Specification

Markdown

ATS-COM-ORD-017

Arrange vendor stock purchases: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision2

Read atservices-commerce c8b66a98macroservice-libraries 54536a44react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-COM-ORD-074
  • Validation covered
  • Permission gap: FND-COM-ORD-074
  • Edge gap: FND-COM-ORD-074
  • Failure gap: FND-COM-ORD-074
  • Boundary gap: FND-COM-ORD-074
  • Concurrency gap: FND-COM-ORD-074
  • Invariant gap: FND-COM-ORD-074
  • Interaction covered

Test Scenarios

7 scenarios proving CAP-COM-ORD-017; 6 bound to an existing test.

01 Vendor replacement preserves validated detailsvalidationapitest
Proves
BR-CAP-COM-ORD-017-01
Preconditions
A vendor uses mixed-case e-mail and a supplier address.
Steps
[ { "do": "Create and replace it, retry a stale version and submit an unassigned country code.", "provenance": "test", "source": "services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#creates the vendor with its e-mail address lowercased, reads and lists it, replaces it at the version read (a stale one 409)" } ]
Expected
E-mail normalizes, stale replacement is refused and address.country identifies the invalid-country error.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#creates the vendor with its e-mail address lowercased, reads and lists it, replaces it at the version read (a stale one 409)
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
Source
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#creates the vendor with its e-mail address lowercased, reads and lists it, replaces it at the version read (a stale one 409)
02 Referenced suppliers cannot be deletedinvariantapinegativetest
Proves
BR-CAP-COM-ORD-017-02
Preconditions
A vendor has purchasing references.
Steps
[ { "do": "Attempt deletion.", "provenance": "test", "source": "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" } ]
Expected
The response returns 409 with the reference explanation.
Data
Use the controlled records and transports established by the cited tests.
Bound to
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
Source
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
03 Draft round-trip remains strict before issuetransitionapitest
Proves
BR-CAP-COM-ORD-017-03
Preconditions
A draft purchase order contains numbered lines.
Steps
[ { "do": "Replace the record as read, try an undeclared line field and issue the valid draft.", "provenance": "test", "source": "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" } ]
Expected
Round-trip replacement advances the version, the unknown field fails and issue advances the lifecycle.
Data
Use the controlled records and transports established by the cited tests.
Bound to
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
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#still refuses a line that states a column no purchase order line has (the schema stays strict)
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#drafts the order numbered with its line and issues it
Source
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
04 Received commitments use closing to cancel the remaindertransitionapitest
Proves
BR-CAP-COM-ORD-017-04
Preconditions
An order has received ninety of one hundred units alongside unreceived drafts.
Steps
[ { "do": "Try cancellation, close the received case and cancel draft or line quantities.", "provenance": "test", "source": "services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status" } ]
Expected
The received case requests closing, which cancels ten remaining units, while eligible unreceived cancellations proceed.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status
services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#cancels a draft and an issued order nothing was received against
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#closes an issued order after 90 of 100: cancelled_quantity 10, status closed; cancelling it instead is refused
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#closes a second order with unreceived quantity: the remainder cancelled, and cancels part of a line on another
Source
services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status
05 Open quantity derives from the line countersruleunittest
Proves
BR-CAP-COM-ORD-017-05
Preconditions
One hundred ordered units include sixty received and ten cancelled.
Steps
[ { "do": "Calculate the remaining quantity.", "provenance": "test", "source": "services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#is the ordered quantity less what was received and cancelled" } ]
Expected
The result is thirty units.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#is the ordered quantity less what was received and cancelled
Source
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#is the ordered quantity less what was received and cancelled
06 Purchasing API preserves read-only and workspace boundariespermissionapinegativetest
Proves
BR-CAP-COM-ORD-017-06
Preconditions
Contexts include reader, application-denied, absent and other-workspace callers.
Steps
[ { "do": "Read and mutate vendor and valuation records.", "provenance": "test", "source": "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" } ]
Expected
Authorized reads succeed, mutations and denied application access fail, missing context returns 401 and other records are not found.
Data
Use the controlled records and transports established by the cited tests.
Bound to
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
Source
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 Received stock changes how the remaining commitment can endinteractionapiproposed
Proves
BR-CAP-COM-ORD-017-04 BR-CAP-COM-ORD-018-02
Preconditions
An issued purchase order covers one hundred units.
Steps
[ { "do": "Receive ninety, attempt order cancellation and close the remainder.", "provenance": "proposed", "source": [ "services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status", "services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#refuses a receipt beyond what the line has open (over_receipt) and a receipt against a received order, writing nothing" ] } ]
Expected
The cancellation is refused and closing cancels the remaining ten units without removing the receipt.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/purchasing/tests/unit/orders/purchase-order-cancel.spec.js#tells a partially received order to close instead, not its status,services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#refuses a receipt beyond what the line has open (over_receipt) and a receipt against a received order, writing nothing

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.