Skip to content

ATS-MBR-MEM-010Undo a purchase or respond to a payment problem: Capability Test Specification

Markdown

ATS-MBR-MEM-010

Undo a purchase or respond to a payment problem: 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-092
  • Transition gap: FND-MBR-MEM-092
  • Validation gap: FND-MBR-MEM-092
  • Permission gap: FND-MBR-MEM-092
  • Edge gap: FND-MBR-MEM-092
  • Failure gap: FND-MBR-MEM-092
  • Boundary covered
  • Concurrency gap: FND-MBR-MEM-092
  • Invariant gap: FND-MBR-MEM-092
  • Interaction covered

Test Scenarios

13 scenarios proving CAP-MBR-MEM-010; 7 bound to an existing test.

01 Preparing a cancellation says what it would do and writes nothinginvariantapitest
Proves
BR-CAP-MBR-MEM-010-01
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Prepare the cancellation of a pending line and of a started one.", "expect": "The pending line is wholly refundable; the started one is a termination with the program's fraction; nothing is written.", "provenance": "test", "source": [ "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#allows the cancellation of the pending term, the whole line refundable", "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#plans the termination with the program’s prorated fraction" ] } ]
Expected
The pending line is wholly refundable; the started one is a termination with the program's fraction; nothing is written.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#allows the cancellation of the pending term, the whole line refundable
02 What a cancelled line's term becomestransitionunittest
Proves
BR-CAP-MBR-MEM-010-02
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Decide the action for a pending term, an unstarted committed term, a started term and a closed term.", "expect": "Cancel, cancel, terminate and nothing.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#cancels a pending term", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#cancels a committed term that has not started by the effective date", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#terminates a committed term that has started", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#does nothing to a term already closed" ] } ]
Expected
Cancel, cancel, terminate and nothing.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#cancels a pending term
03 The refundable fraction follows the program's policyboundaryunittest
Proves
BR-CAP-MBR-MEM-010-03
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Compute the fraction before the start, by days, by whole months, under no refund, after the end and for a never-ending term.", "expect": "All, the unused days, the unused whole months, nothing, nothing and nothing.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds everything before the term starts", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds the unused days by prorated_days", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds the unused whole months by prorated_months", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds nothing under no_refund once the term has started", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds nothing after the term ended", "services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds nothing of a term that never ends" ] } ]
Expected
All, the unused days, the unused whole months, nothing, nothing and nothing.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/commerce-participant/tests/unit/refund-policy.spec.ts#refunds everything before the term starts
04 A member cancels only what has not startedpermissionapinegativetest
Proves
BR-CAP-MBR-MEM-010-04
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "The member asks to cancel a started term; staff ask too.", "expect": "The member's request needs approval; staff's proceeds.", "provenance": "test", "source": [ "services-membership:tests/acceptance/commerce/MBR-ACC-0335.acceptance.ts#MBR-ACC-0335", "services-membership:tests/acceptance/commerce/MBR-ACC-0334.acceptance.ts#MBR-ACC-0334" ] } ]
Expected
The member's request needs approval; staff's proceeds.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/acceptance/commerce/MBR-ACC-0335.acceptance.ts#MBR-ACC-0335
05 A pending cancellation fences the membershipinteractionapitest
Proves
BR-CAP-MBR-MEM-010-05
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Fence a membership for cancellation, attempt a renewal purchase, then complete the cancellation.", "expect": "The renewal is unavailable: fence; the fence clears when the cancellation completes.", "provenance": "test", "source": [ "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#fences the membership in TX-K, refusing a competing purchase meanwhile", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#refuses a renewal of a membership a cancellation fences, with unavailable: fence" ] } ]
Expected
The renewal is unavailable: fence; the fence clears when the cancellation completes.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#fences the membership in TX-K, refusing a competing purchase meanwhile
06 A cancellation runs once per obligationinvariantapitest
Proves
BR-CAP-MBR-MEM-010-06
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Deliver the same cancel obligation twice.", "expect": "The same records are answered and nothing more changes.", "provenance": "test", "source": [ "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#answers a redelivered cancel obligation with the same records" ] } ]
Expected
The same records are answered and nothing more changes.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#answers a redelivered cancel obligation with the same records
07 A void of an unfulfilled first purchase leaves nothingtransitionapiproposed
Proves
BR-CAP-MBR-MEM-010-07
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Void a placed, unpaid first purchase; void an unfulfilled renewal.", "expect": "The first purchase's pending term and membership are gone; the renewal's membership is kept.", "provenance": "proposed", "source": "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
The first purchase's pending term and membership are gone; the renewal's membership is kept.
Data
FAA programs, packages, units and members from the integration seed.
Source
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
08 A reversed payment suspends once and its resolution restorestransitionapitest
Proves
BR-CAP-MBR-MEM-010-09
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Enforce suspend twice for a reversed payment and a dispute, restore one, then the other; also enforce on a staff-suspended member.", "expect": "Suspended once; restored only when no Commerce suspension stands; the staff suspension is never lifted.", "provenance": "test", "source": [ "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#suspends on a reversed payment, idempotently, and restores on resolution", "services-membership:tests/acceptance/commerce/MBR-ACC-0355.acceptance.ts#MBR-ACC-0355" ] } ]
Expected
Suspended once; restored only when no Commerce suspension stands; the staff suspension is never lifted.
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#suspends on a reversed payment, idempotently, and restores on resolution
09 A cancelled term's chapters end and its grants followinteractionapiproposed
Proves
BR-CAP-MBR-MEM-010-10
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Cancel a started term holding a chapter and a grant.", "expect": "The term ends the day before, its chapter ends with it, its granted term follows, and the fence clears.", "provenance": "proposed", "source": "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence" } ]
Expected
The term ends the day before, its chapter ends with it, its granted term follows, and the fence clears.
Data
FAA programs, packages, units and members from the integration seed.
Source
services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence
10 Refuse staff correction after purchase cancellationinteractionapinegativeproposed
Proves
BR-CAP-MBR-MEM-003-01 BR-CAP-MBR-MEM-010-10
Preconditions
A purchased period is committed and staff have read its version.
Steps
[ { "do": "Cancel the purchase, then submit a correction using the earlier version.", "expect": "The closed period remains closed and the correction cannot overwrite the cancellation.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/services/operations/staff-operations.ts:lockTerm, correctTerm, terminateTerm", "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence" ] } ]
Expected
The closed period remains closed and the correction cannot overwrite the cancellation.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/services/operations/staff-operations.ts:lockTerm, correctTerm, terminateTerm,services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence
11 Keep staff suspension after payment restorationinteractionapiproposed
Proves
BR-CAP-MBR-MEM-004-02 BR-CAP-MBR-MEM-004-03 BR-CAP-MBR-MEM-010-09
Preconditions
Staff have suspended a purchased membership with a reason.
Steps
[ { "do": "Apply a Commerce suspension enforcement, then restore that enforcement.", "expect": "The enforcement is restored while the staff suspension and its reason remain.", "provenance": "proposed", "source": [ "services-membership:tests/acceptance/memberships/MBR-ACC-0174.acceptance.ts#MBR-ACC-0174: A membership is suspended over its terms and restored to whatever the terms give, once each way, with no detections while suspended and the history showing the suspension", "services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#suspends on a reversed payment, idempotently, and restores on resolution" ] } ]
Expected
The enforcement is restored while the staff suspension and its reason remain.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:tests/acceptance/memberships/MBR-ACC-0174.acceptance.ts#MBR-ACC-0174: A membership is suspended over its terms and restored to whatever the terms give, once each way, with no detections while suspended and the history showing the suspension,services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#suspends on a reversed payment, idempotently, and restores on resolution
12 Resolve attention when a purchased term closesinteractionapiproposed
Proves
BR-CAP-MBR-MEM-010-10 BR-CAP-MBR-MEM-014-07
Preconditions
Publication is enabled for an expiring purchased term.
Steps
[ { "do": "Cancel the started purchase and inspect the closure and the original expiry item.", "expect": "The term and chapter coverage close and the enabled item resolves in the closing write.", "provenance": "proposed", "source": [ "services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence", "services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction" ] } ]
Expected
The term and chapter coverage close and the enabled item resolves in the closing write.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:tests/e2e/commerce-cancellation.e2e.spec.ts#terminates the term the day before the effective date, ends its chapter, clears the fence,services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction
13 Describe first-purchase removal in its cancellation eventinteractionapinegativeproposed
Proves
BR-CAP-MBR-MEM-010-07 BR-CAP-MBR-MEM-020-04
Preconditions
A first purchase has a pending term and no other coverage.
Steps
[ { "do": "Cancel its obligation and inspect the committed cancellation event before and after redelivery.", "expect": "The event records that the holding is removed and redelivery creates no second event.", "provenance": "proposed", "source": [ "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", "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says whether a cancellation removed the membership" ] } ]
Expected
The event records that the holding is removed and redelivery creates no second event.
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#releases a voided order: the pending term and the membership the claim created are deleted,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.