Skip to content

ATS-MBR-MEM-009Sell membership through the Commerce checkout: Capability Test Specification

Markdown

ATS-MBR-MEM-009

Sell membership through the Commerce checkout: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaMembershipModuleMemberships, Applications and Membership BillingRevision2

Read atservices-membership 5994c270react-console baf6dae3

Coverage

  • Rule gap: FND-MBR-MEM-091
  • Transition gap: FND-MBR-MEM-091
  • Validation covered
  • Permission gap: FND-MBR-MEM-091
  • Edge covered
  • Failure gap: FND-MBR-MEM-091
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-MBR-MEM-091
  • Interaction covered

Test Scenarios

20 scenarios proving CAP-MBR-MEM-009; 11 bound to an existing test.

01 Preparing a checkout writes nothing and carries no amountinvariantapitest
Proves
BR-CAP-MBR-MEM-009-01
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Advise and prepare a cart with a package and a dues line.", "expect": "Both answer the plan without writing; no field anywhere holds an amount.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/purchase-plan.spec.ts#carries no amount anywhere", "services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#advises ok and writes nothing" ] } ]
Expected
Both answer the plan without writing; no field anywhere holds an amount.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/purchase-plan.spec.ts#carries no amount anywhere
02 A package line must be the package itself, active and consistentvalidationapinegativeproposed
Proves
BR-CAP-MBR-MEM-009-02
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare a line whose product is another product, and one whose package is retired.", "expect": "Both are refused naming the problem.", "provenance": "proposed", "source": "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#refuses a package line whose product is not the package: the package is its product (D-1)" } ]
Expected
Both are refused naming the problem.
Data
FAA programs, packages, units and members from the integration seed.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#refuses a package line whose product is not the package: the package is its product (D-1)
03 The member's state decides the operation, and a wrong one is refused naming the right onevalidationunitnegativetest
Proves
BR-CAP-MBR-MEM-009-03
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Ask to enrol an existing member, renew a lapsed one, reinstate a current one and rejoin inside the window.", "expect": "Each is refused naming renew, rejoin, renew and reinstate respectively.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an owner already holding the membership, naming renew", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a renewal of a lapsed membership, naming rejoin (07 §2)", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a reinstatement of a current membership, naming renew", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a rejoin inside the reinstatement window, naming reinstate", "services-membership:tests/acceptance/commerce/MBR-ACC-0332.acceptance.ts#MBR-ACC-0332" ] } ]
Expected
Each is refused naming renew, rejoin, renew and reinstate respectively.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an owner already holding the membership, naming renew
04 Renewal windows, do-not-renew and past effective dates refuseboundaryunitnegativetest
Proves
BR-CAP-MBR-MEM-009-04
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Renew before the window, renew a do-not-renew member, renew on a chosen date, enrol from a past date.", "expect": "Each is refused.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a renewal before the package’s renewal window opens", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a membership marked do not renew", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an on_date renewal", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an effective date in the past" ] } ]
Expected
Each is refused.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a renewal before the package’s renewal window opens
05 Suspended, fenced and pending memberships cannot be bought foredgeunitnegativetest
Proves
BR-CAP-MBR-MEM-009-05
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare for a suspended member, a fenced member, one with a pending renewal and one with a pending first term.", "expect": "Refused, then unavailable with fence, renewal_in_progress and term_pending.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a suspended membership", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers a fenced membership unavailable: fence", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers a renewal while one is pending unavailable: renewal_in_progress", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers an enrolment while a first term is pending unavailable: term_pending" ] } ]
Expected
Refused, then unavailable with fence, renewal_in_progress and term_pending.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a suspended membership
06 Mid-term changes need an amendment; an upgrade at term end is a renewalinteractionunittest
Proves
BR-CAP-MBR-MEM-009-06
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Ask for an immediate upgrade, a transfer, a change of chapter, and an upgrade at term end.", "expect": "The first three are refused requires_amendment; the last is planned as a renewal into the other type.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an immediate upgrade as requires_amendment, naming prepare_change", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a transfer as requires_amendment", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a change of affiliation as requires_amendment", "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#takes an upgrade at term end as a renewal into the other type" ] } ]
Expected
The first three are refused requires_amendment; the last is planned as a renewal into the other type.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses an immediate upgrade as requires_amendment, naming prepare_change
07 The plan names the period, the chapters with their dues products, the grants and the claimruleapiproposed
Proves
BR-CAP-MBR-MEM-009-07
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare a join with a chapter whose dues line is missing, then present.", "expect": "Without the dues line the package line is refused; with it the plan lists the period, the chapter and its dues product, the grants and one claim.", "provenance": "proposed", "source": "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans a join: kind, service period from the package rule, the dues chapter, audience new, a sql claim, no amount" } ]
Expected
Without the dues line the package line is refused; with it the plan lists the period, the chapter and its dues product, the grants and one claim.
Data
FAA programs, packages, units and members from the integration seed.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans a join: kind, service period from the package rule, the dues chapter, audience new, a sql claim, no amount
08 Each line names its price audience and prorationruleunittest
Proves
BR-CAP-MBR-MEM-009-08
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Map enrolment, renewal, reinstatement and rejoin against price lists with and without their rows.", "expect": "New, renewing, the package's choice and rejoining, falling back to new; first terms prorated on the original price; renewals never.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices an enrolment as new", "services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices a renewal as renewing", "services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#falls back to new when the grid has no row for the operation’s audience (D-5: a blank rejoining inherits new)", "services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prorates a first term by the package’s enrolment proration, on the original price, for new members", "services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#never prorates a renewal: the proration is null, as contracts 0.3.0 says \"none\"" ] } ]
Expected
New, renewing, the package's choice and rejoining, falling back to new; first terms prorated on the original price; renewals never.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices an enrolment as new
09 Each line says through whom it is soldruleunittest
Proves
BR-CAP-MBR-MEM-009-09
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare a package line and dues lines of a chapter with and without its own ordering profile.", "expect": "The program's profile for the package; the chapter's own, locked, or the program's for its dues.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names the program and its profile for a package line", "services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names the chapter’s own profile for its dues, locked", "services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#inherits the program’s profile for a chapter without one, naming the program as where it came from", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers each item’s selling context: the program’s for the package, the chapter’s (inheriting the program’s profile) for its dues" ] } ]
Expected
The program's profile for the package; the chapter's own, locked, or the program's for its dues.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names the program and its profile for a package line
10 Placement reserves one pending term and only one of two racing checkouts winsconcurrencyapitest
Proves
BR-CAP-MBR-MEM-009-10
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Place two orders for the same person's first membership at once.", "expect": "One reserves a pending, unnumbered membership and term; the other is refused term_pending.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims under the capability role: a pending, unnumbered membership with its pending term and claim", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#lets one of two concurrent checkouts for the same person win and refuses the other with term_pending", "services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#lets one of two concurrent placements claim the person’s term and refuses the other term_pending" ] } ]
Expected
One reserves a pending, unnumbered membership and term; the other is refused term_pending.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims under the capability role: a pending, unnumbered membership with its pending term and claim
11 A reviewed package waits for approval unless the approved application is namedinteractionapitest
Proves
BR-CAP-MBR-MEM-009-11
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare a reviewed package with and without its approved application.", "expect": "Without it the line answers requires_approval; with it the line is ok.", "provenance": "test", "source": [ "services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named", "services-membership:tests/acceptance/commerce/MBR-ACC-0341.acceptance.ts#MBR-ACC-0341" ] } ]
Expected
Without it the line answers requires_approval; with it the line is ok.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named
12 Fulfilment commits once per authorizationtransitionapitest
Proves
BR-CAP-MBR-MEM-009-12
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Fulfil a placed join, then deliver the same authorization again.", "expect": "The term is committed and numbered with its chapter and dues product, enrolled; the redelivery answers the same records and writes nothing.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers a redelivered authorization with the same records and writes nothing again", "services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#answers a redelivered authorization after a lost acknowledgement with the same records (A17)" ] } ]
Expected
The term is committed and numbered with its chapter and dues product, enrolled; the redelivery answers the same records and writes nothing.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled
13 A dues line waits for its package linetransitionapitest
Proves
BR-CAP-MBR-MEM-009-13
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Fulfil the dues line before the package line, then after.", "expect": "Before, it asks for redelivery; after, its order line is stamped on the chapter's affiliation.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#stamps the dues line on the affiliation once the package line is fulfilled, and asks for a redelivery before" ] } ]
Expected
Before, it asks for redelivery; after, its order line is stamped on the chapter's affiliation.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#stamps the dues line on the affiliation once the package line is fulfilled, and asks for a redelivery before
14 Release a first purchase without deleting earlier membershipinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-10 BR-CAP-MBR-MEM-010-07
Preconditions
One person has a pending first purchase and another has a pending renewal.
Steps
[ { "do": "Void each unfulfilled order and inspect its claims, periods and holdings.", "expect": "Both reservations release; only the empty holding created for the first purchase disappears.", "provenance": "proposed", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims under the capability role: a pending, unnumbered membership with its pending term and claim", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#releases a voided order: the pending term and the membership the claim created are deleted" ] } ]
Expected
Both reservations release; only the empty holding created for the first purchase disappears.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims under the capability role: a pending, unnumbered membership with its pending term and claim,services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#releases a voided order: the pending term and the membership the claim created are deleted
15 Apply the configured review process to checkoutinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-11 BR-CAP-MBR-MEM-011-01
Preconditions
An active application process reviews the selected package.
Steps
[ { "do": "Prepare checkout before approval, then record a matching approval and prepare with its application.", "expect": "The first preparation needs approval; the approved application permits preparation of the same offer.", "provenance": "proposed", "source": [ "services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named", "services-membership:tests/acceptance/commerce/MBR-ACC-0346.acceptance.ts#MBR-ACC-0346" ] } ]
Expected
The first preparation needs approval; the approved application permits preparation of the same offer.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named,services-membership:tests/acceptance/commerce/MBR-ACC-0346.acceptance.ts#MBR-ACC-0346
16 Keep an approved purchase pending until fulfilmentinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-11 BR-CAP-MBR-MEM-012-05 BR-CAP-MBR-MEM-012-06
Preconditions
A typed application selects a package and dues-bearing chapter.
Steps
[ { "do": "Deliver approval, inspect the placed purchase, redeliver approval, then fulfil the authorization.", "expect": "The decision creates one pending purchase; only fulfilment commits coverage, and decision replay creates no second order.", "provenance": "proposed", "source": [ "services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named", "services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#records an approval, places the dues order through the port (package and chapter dues), and acknowledges it" ] } ]
Expected
The decision creates one pending purchase; only fulfilment commits coverage, and decision replay creates no second order.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers requires_approval for the package the process reviews when no decided application is named,services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#records an approval, places the dues order through the port (package and chapter dues), and acknowledges it
17 Reserve renewal coverage through billing order placementinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-05 BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09
Preconditions
A renewing candidate has a planned billing order action.
Steps
[ { "do": "Execute the action through the Commerce test port, then prepare a competing renewal.", "expect": "The billing order owns a pending renewal and the competing checkout is refused for the pending period.", "provenance": "proposed", "source": [ "services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a suspended membership", "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#executes on the jobs engine: one order per renewing candidate (Jo’s with both dues chapters), a notice and reminder each, one drop per lapsed term" ] } ]
Expected
The billing order owns a pending renewal and the competing checkout is refused for the pending period.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses a suspended membership,services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#executes on the jobs engine: one order per renewing candidate (Jo’s with both dues chapters), a notice and reminder each, one drop per lapsed term
18 Resolve expiry attention at purchase fulfilmentinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-12 BR-CAP-MBR-MEM-014-07
Preconditions
Publication is enabled and an expiring member has a placed renewal purchase.
Steps
[ { "do": "Inspect attention before fulfilment, then fulfil the renewal and inspect the committed item.", "expect": "The pending purchase has not committed renewal rights; completed renewal resolves the existing item.", "provenance": "proposed", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled", "services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction" ] } ]
Expected
The pending purchase has not committed renewal rights; completed renewal resolves the existing item.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled,services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction
19 Prepare officer orders with the member as recipientinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-07 BR-CAP-MBR-MEM-016-06
Preconditions
An officer reaches a member and the selected renewal chapter.
Steps
[ { "do": "Request an officer renewal and inspect the prepared and placed checkout through the recording Commerce port.", "expect": "The order acts as the officer, names the member as recipient and includes the required dues components.", "provenance": "proposed", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans a join: kind, service period from the package rule, the dues chapter, audience new, a sql claim, no amount", "services-membership:tests/acceptance/security/MBR-ACC-0465.acceptance.ts#MBR-ACC-0465" ] } ]
Expected
The order acts as the officer, names the member as recipient and includes the required dues components.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans a join: kind, service period from the package rule, the dues chapter, audience new, a sql claim, no amount,services-membership:tests/acceptance/security/MBR-ACC-0465.acceptance.ts#MBR-ACC-0465
20 Publish purchase commitment once per authorizationinteractionapiproposed
Proves
BR-CAP-MBR-MEM-009-12 BR-CAP-MBR-MEM-020-04
Preconditions
A package purchase is reserved and awaiting fulfilment.
Steps
[ { "do": "Fulfil the authorization, redeliver it, and inspect committed period events.", "expect": "The same committed records are returned and only one commitment event is stored.", "provenance": "proposed", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled", "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says whether a cancellation removed the membership" ] } ]
Expected
The same committed records are returned and only one commitment event is stored.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils: committed with its authorization, numbered, its chapter written with the dues product, enrolled,services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says whether a cancellation removed the membership

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.