Skip to content

ATS-COM-ORD-013Provide purchased rights and account for their use: Acceptance Test Set

Markdown

ATS-COM-ORD-013

Provide purchased rights and account for their use: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-013

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

10 scenarios proving CAP-COM-ORD-013; 10 bound to an existing test.

01 Grant delivery reads the frozen purchaseapitest
Proves
BR-CAP-COM-ORD-013-01
Preconditions
An e-book purchase contains an entitlement specification.
Steps
Place, pay and deliver its grant obligation.
Expected
The purchase retains the specification and the completed obligation identifies its grant record.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#placed the e-book with a plan of the register’s own kind and the download specification frozen on the line
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#delivered the obligation to the register: completed, with the grant as its record
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#placed the e-book with a plan of the register’s own kind and the download specification frozen on the line
02 Copies do not multiply a specified grant limitapitest
Proves
BR-CAP-COM-ORD-013-02
Preconditions
Three copies each carry the purchase-level two-download declaration.
Steps
Place and fulfil the purchase, then consume its right.
Expected
One two-use grant exists, without a six-use multiplication.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#grants ONE download right of two uses for the three copies, not six
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#gives two downloads and refuses the third 409 insufficient_entitlement
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#grants ONE download right of two uses for the three copies, not six
03 Holder resolution honors recipient or buyer selectionunittest
Proves
BR-CAP-COM-ORD-013-03
Preconditions
Inputs name a recipient, omit one or explicitly choose the buyer.
Steps
Resolve the holder for each specification.
Expected
The results select the recipient, buyer fallback or explicit buyer respectively.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/unit/register/grant-specification.spec.js#gives the grant to the line’s recipient, to the buyer when the line names none, and to the buyer when the spec says so
Source
services-commerce:modules/entitlements/tests/unit/register/grant-specification.spec.js#gives the grant to the line’s recipient, to the buyer when the line names none, and to the buyer when the spec says so
04 A missing grant specification fails permanentlyapinegativetest
Proves
BR-CAP-COM-ORD-013-04
Preconditions
A grant obligation references purchase details without a readable specification.
Steps
Process the obligation.
Expected
The obligation fails non-retryably, creates no right and raises obligation_failed.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/integration/services/register/grant-handler.integration.spec.js#fails the obligation of a purchase that names no specification, not retryable, with obligation_failed raised
Source
services-commerce:modules/entitlements/tests/integration/services/register/grant-handler.integration.spec.js#fails the obligation of a purchase that names no specification, not retryable, with obligation_failed raised
05 Consumption replay does not spend an extra useapitest
Proves
BR-CAP-COM-ORD-013-05
Preconditions
A download right has two available uses.
Steps
Download, replay the first request, make the second request and attempt a third.
Expected
Only two uses are consumed and the final independent request receives insufficient_entitlement.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#gives the member a link and consumes one use per Idempotency-Key (the retry free), then refuses the third 409 insufficient_entitlement
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#gives the member a link and consumes one use per Idempotency-Key (the retry free), then refuses the third 409 insufficient_entitlement
06 Restoration returns one consumed use with audit evidenceapitest
Proves
BR-CAP-COM-ORD-013-06
Preconditions
Both uses on a grant are consumed.
Steps
Restore the first use, replay that request, try another key and consume again.
Expected
The restoration has intervention, history and audit records; replay is free and a duplicate restoration is refused.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#restores use 1 (an intervention: the log row, the history, the audit event), replays under the same key, refuses the same use under another
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#restores use 1 (an intervention: the log row, the history, the audit event), replays under the same key, refuses the same use under another
07 Manual interventions retain source and reasonapitest
Proves
BR-CAP-COM-ORD-013-07
Preconditions
Staff can grant rights to a contact without a sale and can revoke a purchased right.
Steps
Grant, revoke, retry revocation and submit an invalid window.
Expected
The manual source and reason remain, used quantities survive revocation, repetition is refused and the invalid window returns 400.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js#writes a manual grant with no order, line or obligation, the window stated, the reason in its notes
services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js#revokes it whatever its source, with the intervention and the revocation on the order’s history
services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js#refuses a window that ends before it starts, writing neither the grant nor the intervention
Source
services-commerce:modules/entitlements/tests/integration/services/entitlements/entitlement-interventions.integration.spec.js#writes a manual grant with no order, line or obligation, the window stated, the reason in its notes
08 Cancellation revocation prevents further downloadapinegativetest
Proves
BR-CAP-COM-ORD-013-08
Preconditions
A purchased e-book right remains linked to its line.
Steps
Invoke cancellation revocation and attempt download.
Expected
The grant is revoked with its reason, use history stays and the download returns entitlement_not_active.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#revokes the line’s grant with the reason, refuses the download 409 entitlement_not_active, and writes the history
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#revokes the line’s grant with the reason, refuses the download 409 entitlement_not_active, and writes the history
09 Expiry processing affects only elapsed windowsapitest
Proves
BR-CAP-COM-ORD-013-09
Preconditions
Grants include expired, live, unbounded and revoked fixtures.
Steps
Run expiry processing and repeat it.
Expected
Only active elapsed-window grants change, with no repeated expiry write.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/integration/services/register/entitlement-sweeper.integration.spec.js#expires the lapsed grants of both tenants, oldest expiry first, and counts what it did
services-commerce:modules/entitlements/tests/integration/services/register/entitlement-sweeper.integration.spec.js#leaves a grant inside its window, one with no window and a revoked one alone
Source
services-commerce:modules/entitlements/tests/integration/services/register/entitlement-sweeper.integration.spec.js#expires the lapsed grants of both tenants, oldest expiry first, and counts what it did
10 Rights access separates holders from staff readersapinegativetest
Proves
BR-CAP-COM-ORD-013-10
Preconditions
The fixtures provide a holder, another member and a console reader.
Steps
Read by holder and order and attempt restoration.
Expected
The authorized reads succeed, another member cannot reach the right and restoration requires staff authority.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#shows a stranger nothing of the member’s, and refuses the member’s grant by id 403
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#lets a console reader read the member’s grants by holder and by order, and refuses them the restore
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#refuses a portal member the restore, and a restore with no Idempotency-Key 400
Source
services-commerce:modules/entitlements/tests/e2e/entitlements.e2e.spec.js#shows a stranger nothing of the member’s, and refuses the member’s grant by id 403

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.