---
id: ATS-MBR-MEM-013
scope: CAP-MBR-MEM-013
product_area: membership
module: memberships
revision: 2
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-MBR-MEM-013-01
    title: 'Every wrong template, run or recurring run is refused and leaves nothing'
    level: api
    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.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-072
    provenance: test
    source: >-
      services-membership:tests/acceptance/billing/MBR-ACC-0402.acceptance.ts#MBR-ACC-0402
    category: validation
    binding_evidence:
      - suite: TST-MBR-MEM-072
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0402.acceptance.ts#MBR-ACC-0402
  - id: ATS-MBR-MEM-013-02
    title: A run copies its template so its plan is reproducible
    level: api
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-238
      - TST-MBR-MEM-086
    provenance: test
    source: 'services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a template'
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-238
        source: >-
          services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a
          template
      - suite: TST-MBR-MEM-238
        source: >-
          services-membership:tests/e2e/billing-api.e2e.spec.ts#creates a run
          from the template
      - suite: TST-MBR-MEM-086
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0416.acceptance.ts#MBR-ACC-0416
  - id: ATS-MBR-MEM-013-03
    title: Planning takes the right candidates
    level: unit
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-006
      - TST-MBR-MEM-004
    provenance: test
    source: >-
      services-membership:modules/billing/tests/unit/run-plan.spec.ts#takes a
      principal membership’s term in range
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#takes
          a principal membership’s term in range
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves
          out a flow-down or assigned membership, which renews with its parent
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves
          out a term already renewed (a later effective or pending term)
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves
          out a term that never ends
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#leaves
          out a suspended membership
      - suite: TST-MBR-MEM-004
        source: >-
          services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#leaves
          out the renewed term and the suspended membership
  - id: ATS-MBR-MEM-013-04
    title: Candidates are classed renewing or lapsed by grace
    level: unit
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-006
    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
    category: boundary
    binding_evidence:
      - suite: TST-MBR-MEM-006
        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
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#classes
          a term ending before the date less its grace as lapsed
  - id: ATS-MBR-MEM-013-05
    title: Each candidate is planned the right actions
    level: unit
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-006
    provenance: test
    source: >-
      services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans a
      renewing term’s renewal order, notice and each reminder
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans
          a renewing term’s renewal order, notice and each reminder
      - suite: TST-MBR-MEM-006
        source: >-
          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
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans
          nothing for a renewing membership marked do not renew
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans
          the drop of a lapsed term, keyed by the term and its version
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#plans
          no drop for a membership marked do not drop
  - id: ATS-MBR-MEM-013-06
    title: A plan's statistics add up
    level: unit
    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.'
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-006
      - TST-MBR-MEM-089
    provenance: test
    source: >-
      services-membership:modules/billing/tests/unit/run-plan.spec.ts#counts the
      candidates, their classes, the exclusions and the planned actions
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-006
        source: >-
          services-membership:modules/billing/tests/unit/run-plan.spec.ts#counts
          the candidates, their classes, the exclusions and the planned actions
      - suite: TST-MBR-MEM-089
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0422.acceptance.ts#MBR-ACC-0422
  - id: ATS-MBR-MEM-013-07
    title: 'Execution acts once, refuses stale actions and repeats harmlessly'
    level: api
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-004
      - TST-MBR-MEM-078
    provenance: test
    source: >-
      services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses
      as stale an action whose term changed after planning
    category: concurrency
    binding_evidence:
      - suite: TST-MBR-MEM-004
        source: >-
          services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses
          as stale an action whose term changed after planning
      - suite: TST-MBR-MEM-004
        source: >-
          services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#does
          nothing on a second execution
      - suite: TST-MBR-MEM-078
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0408.acceptance.ts#MBR-ACC-0408
  - id: ATS-MBR-MEM-013-08
    title: Execution places one order per renewing member and drops the lapsed
    level: api
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-004
      - TST-MBR-MEM-070
    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
    category: interaction
    binding_evidence:
      - suite: TST-MBR-MEM-004
        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
      - suite: TST-MBR-MEM-070
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0400.acceptance.ts#MBR-ACC-0400
  - id: ATS-MBR-MEM-013-09
    title: Run operations need the version read and an allowing status
    level: api
    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.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-076
      - TST-MBR-MEM-075
    provenance: test
    source: >-
      services-membership:tests/acceptance/billing/MBR-ACC-0406.acceptance.ts#MBR-ACC-0406
    category: transition
    binding_evidence:
      - suite: TST-MBR-MEM-076
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0406.acceptance.ts#MBR-ACC-0406
      - suite: TST-MBR-MEM-075
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0405.acceptance.ts#MBR-ACC-0405
  - id: ATS-MBR-MEM-013-10
    title: A recurring run creates one run per occurrence
    level: api
    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.'
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-004
      - TST-MBR-MEM-085
    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
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-004
        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
      - suite: TST-MBR-MEM-085
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0415.acceptance.ts#MBR-ACC-0415
  - id: ATS-MBR-MEM-013-11
    title: Concurrent recurring-run changes do not both apply
    level: api
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-005
    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
    category: concurrency
    binding_evidence:
      - suite: TST-MBR-MEM-005
        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
  - id: ATS-MBR-MEM-013-12
    title: Readers read billing and cannot change it
    level: api
    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.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-238
      - TST-MBR-MEM-081
    provenance: test
    source: >-
      services-membership:tests/e2e/billing-api.e2e.spec.ts#lets a reader read
      the run and refuses it the planning
    category: permission
    binding_evidence:
      - suite: TST-MBR-MEM-238
        source: >-
          services-membership:tests/e2e/billing-api.e2e.spec.ts#lets a reader
          read the run and refuses it the planning
      - suite: TST-MBR-MEM-081
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0411.acceptance.ts#MBR-ACC-0411
  - id: ATS-MBR-MEM-013-13
    title: Notices reach a person's first address and skip those without one
    level: api
    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.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-088
    provenance: test
    source: >-
      services-membership:tests/acceptance/billing/MBR-ACC-0418.acceptance.ts#MBR-ACC-0418
    category: edge
    binding_evidence:
      - suite: TST-MBR-MEM-088
        source: >-
          services-membership:tests/acceptance/billing/MBR-ACC-0418.acceptance.ts#MBR-ACC-0418
  - id: ATS-MBR-MEM-013-14
    title: Make a planned billing action stale after correction
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-003-06
      - BR-CAP-MBR-MEM-013-07
    interacts_with:
      - CAP-MBR-MEM-003
    workflows:
      - WF-MBR-MEM-004
      - WF-MBR-MEM-018
    relies_on:
      - ATS-MBR-MEM-003-04
      - ATS-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: &ref_0
          - >-
            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.
    negative: true
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_0
  - id: ATS-MBR-MEM-013-15
    title: Close dependent coverage through a billing drop
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-07
      - BR-CAP-MBR-MEM-013-08
      - BR-CAP-MBR-MEM-013-09
    interacts_with:
      - CAP-MBR-MEM-006
    workflows:
      - WF-MBR-MEM-004
    relies_on:
      - ATS-MBR-MEM-006-07
      - ATS-MBR-MEM-013-08
    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: &ref_1
          - >-
            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.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_1
  - id: ATS-MBR-MEM-013-16
    title: Resolve an expiry item through a billing drop
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-013-08
      - BR-CAP-MBR-MEM-013-09
      - BR-CAP-MBR-MEM-014-07
    interacts_with:
      - CAP-MBR-MEM-014
    workflows:
      - WF-MBR-MEM-004
    relies_on:
      - ATS-MBR-MEM-013-08
      - ATS-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: &ref_2
          - >-
            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.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_2
  - id: ATS-MBR-MEM-013-17
    title: State billing terminations with their last covered day
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-013-08
      - BR-CAP-MBR-MEM-013-09
      - BR-CAP-MBR-MEM-020-03
    interacts_with:
      - CAP-MBR-MEM-020
    workflows:
      - WF-MBR-MEM-004
    relies_on:
      - ATS-MBR-MEM-013-08
      - ATS-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: &ref_3
          - >-
            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.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_3
evidence:
  - >-
    services-membership at 5994c270e8a37a30f848e99ba5b5ee6b87c08893: the
    capability sources and the bound test files.
  - >-
    rhythm-v2-docs:specs/membership/memberships/design/: domain objects, state
    models and workflows reviewed for coverage.
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
coverage_notes:
  transition: >-
    The scenarios do not enumerate every applicable object transition; the
    finding preserves the remaining transition matrix.
  permission: >-
    The finding records named permissions without a complete positive and
    negative proof.
  invariant: >-
    Existing invariant examples do not cover every applicable domain-object
    constraint.
  interaction: >-
    Every related capability and each cross-capability workflow has an explicit
    composite scenario. Unbound composites remain proposed.
---

# Bill renewals in runs, on demand or on a schedule: Capability Test Specification

## Coverage

| Rule | Scenario or Finding |
|---|---|
| `BR-CAP-MBR-MEM-013-01` | `ATS-MBR-MEM-013-01` |
| `BR-CAP-MBR-MEM-013-02` | `ATS-MBR-MEM-013-02` |
| `BR-CAP-MBR-MEM-013-03` | `ATS-MBR-MEM-013-03` |
| `BR-CAP-MBR-MEM-013-04` | `ATS-MBR-MEM-013-04` |
| `BR-CAP-MBR-MEM-013-05` | `ATS-MBR-MEM-013-05` |
| `BR-CAP-MBR-MEM-013-06` | `ATS-MBR-MEM-013-06` |
| `BR-CAP-MBR-MEM-013-07` | `ATS-MBR-MEM-013-07`, `ATS-MBR-MEM-013-14` |
| `BR-CAP-MBR-MEM-013-08` | `ATS-MBR-MEM-013-08`, `ATS-MBR-MEM-013-15`, `ATS-MBR-MEM-013-16`, `ATS-MBR-MEM-013-17` |
| `BR-CAP-MBR-MEM-013-09` | `ATS-MBR-MEM-013-08`, `ATS-MBR-MEM-013-15`, `ATS-MBR-MEM-013-16`, `ATS-MBR-MEM-013-17` |
| `BR-CAP-MBR-MEM-013-10` | no scenario: `FND-MBR-MEM-048` |
| `BR-CAP-MBR-MEM-013-11` | `ATS-MBR-MEM-013-09` |
| `BR-CAP-MBR-MEM-013-12` | `ATS-MBR-MEM-013-10` |
| `BR-CAP-MBR-MEM-013-13` | `ATS-MBR-MEM-013-11` |
| `BR-CAP-MBR-MEM-013-14` | `ATS-MBR-MEM-013-12` |
| `BR-CAP-MBR-MEM-013-15` | `ATS-MBR-MEM-013-13` |

## Interactions With Related Capabilities

The interaction cases test how a shared holding, period, chapter connection or recorded change affects related work. Each case names its related capabilities and workflows in frontmatter. A composite case remains proposed until executable assertions establish every part of its expected outcome.
