Skip to content

ATS-MBR-MEM-013Bill renewals in runs, on demand or on a schedule: Capability Test Specification

Markdown

ATS-MBR-MEM-013

Bill renewals in runs, on demand or on a schedule: 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-095
  • Transition gap: FND-MBR-MEM-095
  • Validation covered
  • Permission gap: FND-MBR-MEM-095
  • Edge covered
  • Failure gap: FND-MBR-MEM-095
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-MBR-MEM-095
  • Interaction covered

Test Scenarios

17 scenarios proving CAP-MBR-MEM-013; 13 bound to an existing test.

01 Every wrong template, run or recurring run is refused and leaves nothingvalidationapinegativetest
Proves
BR-CAP-MBR-MEM-013-01
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Create templates with a drop and no drop reason, a reason of the wrong kind, and malformed filters.", "expect": "Each is refused with its reason; nothing is saved.", "provenance": "test", "source": [ "services-membership:tests/acceptance/billing/MBR-ACC-0402.acceptance.ts#MBR-ACC-0402" ] } ]
Expected
Each is refused with its reason; nothing is saved.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/acceptance/billing/MBR-ACC-0402.acceptance.ts#MBR-ACC-0402
02 A run copies its template so its plan is reproducibleinvariantapitest
Proves
BR-CAP-MBR-MEM-013-02
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Create a template, then a run from it, then change the template.", "expect": "The run keeps the documents it copied.", "provenance": "test", "source": [ "services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a template", "services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a run from the template", "services-membership:tests/acceptance/billing/MBR-ACC-0416.acceptance.ts#MBR-ACC-0416" ] } ]
Expected
The run keeps the documents it copied.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a template
03 Planning takes the right candidatesruleunittest
Proves
BR-CAP-MBR-MEM-013-03
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Plan over principal, flow-down, renewed, never-ending, suspended and filtered-out terms.", "expect": "Only permitted principal, unrenewed, ending and unsuspended terms enter the candidate set; planning records why other terms are excluded.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/unit/run-plan.spec.ts#takes a principal membership’s term in range", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves out a flow-down or assigned membership, which renews with its parent", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves out a term already renewed (a later effective or pending term)", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves out a term that never ends", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves out a suspended membership", "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#leaves out the renewed term and the suspended membership" ] } ]
Expected
Only permitted principal, unrenewed, ending and unsuspended terms enter the candidate set; planning records why other terms are excluded.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/unit/run-plan.spec.ts#takes a principal membership’s term in range
04 Candidates are classed renewing or lapsed by graceboundaryunittest
Proves
BR-CAP-MBR-MEM-013-04
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Class terms ending just inside and just outside the run's date less grace.", "expect": "Renewing and lapsed.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/unit/run-plan.spec.ts#classes a term ending on or after the date less its grace as renewing", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#classes a term ending before the date less its grace as lapsed" ] } ]
Expected
Renewing and lapsed.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/unit/run-plan.spec.ts#classes a term ending on or after the date less its grace as renewing
05 Each candidate is planned the right actionsruleunittest
Proves
BR-CAP-MBR-MEM-013-05
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Plan renewing members with and without a stored method, do-not-renew and do-not-drop members, and lapsed members.", "expect": "The plan distinguishes excluded candidates from suppressed actions: do-not-renew removes order work, do-not-drop removes drop work, and permitted notices and reminders remain.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans a renewing term’s renewal order, notice and each reminder", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans an auto-renewal order and the expiring card warning for a stored payment method", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans nothing for a renewing membership marked do not renew", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans the drop of a lapsed term, keyed by the term and its version", "services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans no drop for a membership marked do not drop" ] } ]
Expected
The plan distinguishes excluded candidates from suppressed actions: do-not-renew removes order work, do-not-drop removes drop work, and permitted notices and reminders remain.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans a renewing term’s renewal order, notice and each reminder
06 A plan's statistics add upruleunittest
Proves
BR-CAP-MBR-MEM-013-06
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Plan a population and read the statistics.", "expect": "Candidates, classes, exclusions and actions are counted.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/unit/run-plan.spec.ts#counts the candidates, their classes, the exclusions and the planned actions", "services-membership:tests/acceptance/billing/MBR-ACC-0422.acceptance.ts#MBR-ACC-0422" ] } ]
Expected
Candidates, classes, exclusions and actions are counted.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/unit/run-plan.spec.ts#counts the candidates, their classes, the exclusions and the planned actions
07 Execution acts once, refuses stale actions and repeats harmlesslyconcurrencyapitest
Proves
BR-CAP-MBR-MEM-013-07
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Correct a planned term, execute the run, then execute again.", "expect": "The corrected term’s action is stale; other attempted actions settle once, and another execution does not repeat settled actions even if it starts another job.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning", "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#does nothing on a second execution", "services-membership:tests/acceptance/billing/MBR-ACC-0408.acceptance.ts#MBR-ACC-0408" ] } ]
Expected
The corrected term’s action is stale; other attempted actions settle once, and another execution does not repeat settled actions even if it starts another job.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning
08 Execution places one order per renewing member and drops the lapsedinteractionapitest
Proves
BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Execute a planned run over the FAA population.", "expect": "One order per renewing member (Jo's with both chapters' dues), notices and reminders submitted, the lapsed terms dropped with the run's reason.", "provenance": "test", "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:tests/acceptance/billing/MBR-ACC-0400.acceptance.ts#MBR-ACC-0400" ] } ]
Expected
One order per renewing member (Jo's with both chapters' dues), notices and reminders submitted, the lapsed terms dropped with the run's reason.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
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
09 Run operations need the version read and an allowing statustransitionapinegativetest
Proves
BR-CAP-MBR-MEM-013-11
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Cancel a draft and a planned run, then try to plan, execute or cancel them again; act at a stale version.", "expect": "Cancelled runs keep their planned actions and refuse every later operation; the stale request is refused.", "provenance": "test", "source": [ "services-membership:tests/acceptance/billing/MBR-ACC-0406.acceptance.ts#MBR-ACC-0406", "services-membership:tests/acceptance/billing/MBR-ACC-0405.acceptance.ts#MBR-ACC-0405" ] } ]
Expected
Cancelled runs keep their planned actions and refuse every later operation; the stale request is refused.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/acceptance/billing/MBR-ACC-0406.acceptance.ts#MBR-ACC-0406
10 A recurring run creates one run per occurrenceinvariantapitest
Proves
BR-CAP-MBR-MEM-013-12
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Deliver an occurrence twice.", "expect": "One run, planned on the occurrence's business day.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#creates and plans one run per occurrence of a recurring run, a redelivered occurrence finding it", "services-membership:tests/acceptance/billing/MBR-ACC-0415.acceptance.ts#MBR-ACC-0415" ] } ]
Expected
One run, planned on the occurrence's business day.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#creates and plans one run per occurrence of a recurring run, a redelivered occurrence finding it
11 Concurrent recurring-run changes do not both applyconcurrencyapitest
Proves
BR-CAP-MBR-MEM-013-13 INV-DOM-MBR-MEM-005-09
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Send two changes at the same version on two connections.", "expect": "One applies; the other is refused version_mismatch.", "provenance": "test", "source": [ "services-membership:modules/billing/tests/integration/recurring-billing-run-concurrency.integration.spec.ts#applies one of two changes made at the same version and refuses the other with version_mismatch" ] } ]
Expected
One applies; the other is refused version_mismatch.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:modules/billing/tests/integration/recurring-billing-run-concurrency.integration.spec.ts#applies one of two changes made at the same version and refuses the other with version_mismatch
12 Readers read billing and cannot change itpermissionapinegativetest
Proves
BR-CAP-MBR-MEM-013-14
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "A reader reads a run and tries to plan it.", "expect": "The read succeeds; planning is refused.", "provenance": "test", "source": [ "services-membership:tests/e2e/billing-api.e2e.spec.ts#lets a reader read the run and refuses it the planning", "services-membership:tests/acceptance/billing/MBR-ACC-0411.acceptance.ts#MBR-ACC-0411" ] } ]
Expected
The read succeeds; planning is refused.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/e2e/billing-api.e2e.spec.ts#lets a reader read the run and refuses it the planning
13 Notices reach a person's first address and skip those without oneedgeapitest
Proves
BR-CAP-MBR-MEM-013-15
Preconditions
The well-known FAA workspace fixtures, or a workspace the test builds from them.
Steps
[ { "do": "Execute notices for a member with addresses, one without, and an organization member.", "expect": "One request per notice to the first address; the other two skipped as having no recipient.", "provenance": "test", "source": [ "services-membership:tests/acceptance/billing/MBR-ACC-0418.acceptance.ts#MBR-ACC-0418" ] } ]
Expected
One request per notice to the first address; the other two skipped as having no recipient.
Data
FAA programs, packages, units and members from the integration seed.
Bound to
Source
services-membership:tests/acceptance/billing/MBR-ACC-0418.acceptance.ts#MBR-ACC-0418
14 Make a planned billing action stale after correctioninteractionapinegativeproposed
Proves
BR-CAP-MBR-MEM-003-06 BR-CAP-MBR-MEM-013-07
Preconditions
A renewal action is planned from a current term.
Steps
[ { "do": "Correct the term, then execute the planned action.", "expect": "The action is stale and creates no renewal order for the corrected version.", "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/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning" ] } ]
Expected
The action is stale and creates no renewal order for the corrected version.
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/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning
15 Close dependent coverage through a billing dropinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-07 BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09
Preconditions
A lapsed organizational period has linked child periods and a planned drop.
Steps
[ { "do": "Execute the billing drop and inspect the source and linked child periods.", "expect": "The drop records its configured reason and closes the applicable linked coverage with the source.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#re-mirrors the children when the parent’s end is corrected: a child never outlasts the parent", "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 drop records its configured reason and closes the applicable linked coverage with the source.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#re-mirrors the children when the parent’s end is corrected: a child never outlasts the parent,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
16 Resolve an expiry item through a billing dropinteractionapiproposed
Proves
BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09 BR-CAP-MBR-MEM-014-07
Preconditions
Publication is enabled for a membership whose planned billing action is a drop.
Steps
[ { "do": "Execute the drop and read the closed period and the original attention item.", "expect": "The period records the billing reason and its item resolves as terminated.", "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/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction" ] } ]
Expected
The period records the billing reason and its item resolves as terminated.
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/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction
17 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

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.