Skip to content

ATS-MBR-MEM-020Tell other applications when membership changes: Capability Test Specification

Markdown

ATS-MBR-MEM-020

Tell other applications when membership changes: 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-102
  • Transition gap: FND-MBR-MEM-102
  • Validation covered
  • Permission gap: FND-MBR-MEM-102
  • Edge gap: FND-MBR-MEM-102
  • Failure covered
  • Boundary covered
  • Concurrency gap: FND-MBR-MEM-102
  • Invariant gap: FND-MBR-MEM-102
  • Interaction covered

Test Scenarios

17 scenarios proving CAP-MBR-MEM-020; 6 bound to an existing test.

01 Each operation states exactly its events, and a rollback states noneinvariantapitest
Proves
BR-CAP-MBR-MEM-020-01 INV-DOM-MBR-MEM-006-07
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Run each staff, affiliation, structure and sweep operation; roll one back; state an event outside a transaction.", "expect": "Exactly the expected events with their contents; none for the rollback; the last refused.", "provenance": "test", "source": [ "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states the old unit’s end and the new unit’s start for a transfer, each naming the other", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.unit.reparented for a moved unit, with the old and the new parent", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#leaves no event when the operation that stated it rolls back", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#refuses to state an event outside a transaction" ] } ]
Expected
Exactly the expected events with their contents; none for the rollback; the last refused.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term
02 Events name the membership's holder correctlyruleunittest
Proves
BR-CAP-MBR-MEM-020-02
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Build events for a person's and an organization's membership.", "expect": "The person by contact; the organization by organization with no contact.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#names a person’s membership by its contact_id and no organization", "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#names an organization’s membership by its organization and no contact_id, whoever its primary contact is", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#names no contact_id when the terminated membership is an organization’s" ] } ]
Expected
The person by contact; the organization by organization with no contact.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#names a person’s membership by its contact_id and no organization
03 Terminations and lapses carry the last day of rightsboundaryapitest
Proves
BR-CAP-MBR-MEM-020-03
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Terminate a term and let the sweep find another lapsed.", "expect": "Each is one termination with its last day, the first day without and the reason; the lapse ends on the term's own last day.", "provenance": "test", "source": [ "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.terminated once when the midnight sweep finds a term lapsed, with the term’s last day", "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#gives a termination its last day of rights and the first day without, and its reason" ] } ]
Expected
Each is one termination with its last day, the first day without and the reason; the lapse ends on the term's own last day.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights
04 A cancellation says whether the membership went with ittransitionapiproposed
Proves
BR-CAP-MBR-MEM-020-04
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Cancel a pending first purchase and a pending renewal.", "expect": "The first says the membership was removed; the second does not.", "provenance": "proposed", "source": "services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says whether a cancellation removed the membership" } ]
Expected
The first says the membership was removed; the second does not.
Data
FAA programs, packages, units and members from the integration seed.
Source
services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says whether a cancellation removed the membership
05 Event contents are strictvalidationunitnegativetest
Proves
BR-CAP-MBR-MEM-020-05 INV-DOM-MBR-MEM-006-08
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Validate a termination without its last day, an undeclared field, a non-local date and an overlong id.", "expect": "Each is refused.", "provenance": "test", "source": [ "services-membership:modules/events/tests/unit/business-event-schemas.spec.ts#refuses a termination that names no last day", "services-membership:modules/events/tests/unit/business-event-schemas.spec.ts#refuses a field the event does not declare", "services-membership:modules/events/tests/unit/business-event-schemas.spec.ts#refuses a date that is not a local date", "services-membership:modules/events/tests/unit/business-event-schemas.spec.ts#refuses an id longer than an id can be" ] } ]
Expected
Each is refused.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/events/tests/unit/business-event-schemas.spec.ts#refuses a termination that names no last day
06 Committees receives terminations alone, each with a stable identifierinteractionapitest
Proves
BR-CAP-MBR-MEM-020-06
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Dispatch a batch of events to Committees' fake receiver, then redeliver.", "expect": "Only the termination is handed over, as the remote contract, with the event's own id; the others settle without a call.", "provenance": "test", "source": [ "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#hands Committees the termination alone, as { version: 1, stream, events } with data.contact_id and data.ends_on", "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#gives Committees the business event’s own id, so a redelivery names the same event", "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#answers the events Committees does not act on without calling it", "services-membership:tests/e2e/business-events.e2e.spec.ts#hands Committees the termination alone, in the remote contract, and settles every message" ] } ]
Expected
Only the termination is handed over, as the remote contract, with the event's own id; the others settle without a call.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#hands Committees the termination alone, as { version: 1, stream, events } with data.contact_id and data.ends_on
07 A failed delivery is retried, then set asidefailureapinegativetest
Proves
BR-CAP-MBR-MEM-020-07
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Committees answers failed, then succeeds; on another message it fails on the last attempt.", "expect": "The failed attempt is reported for retry and the successful retry is acknowledged. A failure at the final receive remains failed for the queue’s configured redrive policy; the suite does not observe a deployed dead-letter transfer.", "provenance": "test", "source": [ "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#returns the message to the queue when Committees answers failed, so SQS retries it", "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#acknowledges the retried message once Committees takes it", "services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#reports a failure on the queue’s last receive too, which moves the message to the dead-letter queue" ] } ]
Expected
The failed attempt is reported for retry and the successful retry is acknowledged. A failure at the final receive remains failed for the queue’s configured redrive policy; the suite does not observe a deployed dead-letter transfer.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#returns the message to the queue when Committees answers failed, so SQS retries it
08 Publish the last covered day of staff terminationinteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-06 BR-CAP-MBR-MEM-020-03
Preconditions
A person holds a started period.
Steps
[ { "do": "Terminate it from a selected day and inspect the committed termination event; repeat the operation in a transaction that rolls back.", "expect": "The committed event identifies the shortened last day; the rolled-back attempt publishes no event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights" ] } ]
Expected
The committed event identifies the shortened last day; the rolled-back attempt publishes no event.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights
09 State suspension and restoration alongside their writesinteractionapiproposed
Proves
BR-CAP-MBR-MEM-004-02 BR-CAP-MBR-MEM-004-03 BR-CAP-MBR-MEM-020-01
Preconditions
A principal holding is unsuspended.
Steps
[ { "do": "Suspend and restore it and inspect committed events; separately roll back a suspension.", "expect": "The committed changes have their corresponding events; the rolled-back suspension has none.", "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/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
The committed changes have their corresponding events; the rolled-back suspension has none.
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/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term
10 Publish one lapse event through repeated sweepsinteractionapiproposed
Proves
BR-CAP-MBR-MEM-005-05 BR-CAP-MBR-MEM-020-03
Preconditions
A term has passed its final grace day without renewed coverage.
Steps
[ { "do": "Run the status sweep after the lapse boundary, then repeat the same sweep.", "expect": "The saved lapse detection and termination event retain the original last covered day and are not duplicated.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/status-sweep.integration.spec.ts#records lapsed_detected effective the day after grace ended, even when found late", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights" ] } ]
Expected
The saved lapse detection and termination event retain the original last covered day and are not duplicated.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/status-sweep.integration.spec.ts#records lapsed_detected effective the day after grace ended, even when found late,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights
11 State commitment for a package grant with its sourceinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-01 BR-CAP-MBR-MEM-020-01
Preconditions
A new person selects a granting package.
Steps
[ { "do": "Create the source period and inspect the committed events for both source and granted periods.", "expect": "Both committed periods have their corresponding commitment events; a rolled-back save retains neither event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
Both committed periods have their corresponding commitment events; a rolled-back save retains neither event.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term
12 Publish an affiliation end with its saved last dayinteractionapiproposed
Proves
BR-CAP-MBR-MEM-007-08 BR-CAP-MBR-MEM-020-01
Preconditions
A permitted chapter row is active and may be ended without violating the minimum.
Steps
[ { "do": "End the row and inspect its saved last day and committed affiliation event.", "expect": "The event identifies the row’s saved last covered day; rollback removes both change and event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/affiliation-withdrawal-continued.integration.spec.ts#refuses to withdraw the continued row, naming the affiliation that continues it, and keeps the row", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
The event identifies the row’s saved last covered day; rollback removes both change and event.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/affiliation-withdrawal-continued.integration.spec.ts#refuses to withdraw the continued row, naming the affiliation that continues it, and keeps the row,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term
13 Publish both sides of a permitted transferinteractionapiproposed
Proves
BR-CAP-MBR-MEM-008-01 BR-CAP-MBR-MEM-020-01
Preconditions
A source chapter and a no-dues target permit direct transfer.
Steps
[ { "do": "Transfer the affiliation and inspect the committed started and ended events.", "expect": "The two events identify their opposite units and the effective transfer boundary.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#transfers to a chapter that sells no dues: the old row ends the day before, the new one continues it as primary", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
The two events identify their opposite units and the effective transfer boundary.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#transfers to a chapter that sells no dues: the old row ends the day before, the new one continues it as primary,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term
14 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
15 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
16 State billing terminations with their last covered dayinteractionapiproposed
Proves
BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09 BR-CAP-MBR-MEM-020-03
Preconditions
Lapsed candidates have planned drop actions.
Steps
[ { "do": "Execute the billing run, repeat execution, and inspect each candidate’s termination event.", "expect": "Each completed drop has one event retaining the period’s last day; settled actions do not duplicate events.", "provenance": "proposed", "source": [ "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", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights" ] } ]
Expected
Each completed drop has one event retaining the period’s last day; settled actions do not duplicate events.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
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,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights
17 Abort both event and renewal when enabled resolution failsinteractionapinegativeproposed
Proves
BR-CAP-MBR-MEM-014-07 BR-CAP-MBR-MEM-020-01
Preconditions
An expiring member has an item, and enabled attention resolution rejects the renewal.
Steps
[ { "do": "Attempt renewal, then inspect saved periods, lifecycle and published business events.", "expect": "The refused transaction leaves no renewal period, renewal lifecycle entry or commitment event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
The refused transaction leaves no renewal period, renewal lifecycle entry or commitment event.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term

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.