---
id: ATS-MBR-MEM-019
scope: CAP-MBR-MEM-019
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-019-01
    title: 'The live datasets answer today''s status, type, episodes and units'
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-01
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Query the memberships and affiliation views as the application role.
        expect: >-
          Today's status, current type, episode count, primary unit by type and
          every unit with its ancestors once.
        provenance: test
        source:
          - >-
            services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#answers
            the query layer’s picks from memberships_for_queries: status today,
            current type, episode count
          - >-
            services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#answers
            the dataset’s views as the application role: the primary unit today,
            every unit with its ancestors once
    expected: >-
      Today's status, current type, episode count, primary unit by type and
      every unit with its ancestors once.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-020
      - TST-MBR-MEM-024
    provenance: test
    source: >-
      services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#answers
      the query layer’s picks from memberships_for_queries: status today,
      current type, episode count
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-020
        source: >-
          services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#answers
          the query layer’s picks from memberships_for_queries: status today,
          current type, episode count
      - suite: TST-MBR-MEM-024
        source: >-
          services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#answers
          the dataset’s views as the application role: the primary unit today,
          every unit with its ancestors once
  - id: ATS-MBR-MEM-019-02
    title: A month's snapshot is known at the month's end
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-02
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Plan, dispatch and run September for a workspace with a member entered
          in October.
        expect: >-
          September is planned once, published as known at its end in the
          workspace's zone, and does not hold the October member.
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#plans
            September’s first version for the tenant, once
          - >-
            services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#publishes
            the planned run as the captured version, known at the month’s end in
            the tenant’s zone
          - >-
            services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#captures
            nothing recorded after the month’s end: the membership entered in
            October is not in September
    expected: >-
      September is planned once, published as known at its end in the
      workspace's zone, and does not hold the October member.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-041
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#plans
      September’s first version for the tenant, once
    category: boundary
    binding_evidence:
      - suite: TST-MBR-MEM-041
        source: >-
          services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#plans
          September’s first version for the tenant, once
      - suite: TST-MBR-MEM-041
        source: >-
          services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#publishes
          the planned run as the captured version, known at the month’s end in
          the tenant’s zone
      - suite: TST-MBR-MEM-041
        source: >-
          services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#captures
          nothing recorded after the month’s end: the membership entered in
          October is not in September
  - id: ATS-MBR-MEM-019-03
    title: 'Each member row is described by its term, and ties by their tree then'
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-03
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Generate September for FAA.
        expect: >-
          Each row describes the covering, latest or next term; Jo's two
          chapters are filed with the Eastern Region among their ancestors.
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#describes
            each member row by its term: the covering one, else the latest
            before, else the first after
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#files
            each affiliation with its unit and every ancestor the unit had at
            the period end, nearest first
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#files
            Jo’s two chapters with the Eastern Region among their ancestors
    expected: >-
      Each row describes the covering, latest or next term; Jo's two chapters
      are filed with the Eastern Region among their ancestors.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-040
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#describes
      each member row by its term: the covering one, else the latest before,
      else the first after
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#describes
          each member row by its term: the covering one, else the latest before,
          else the first after
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#files
          each affiliation with its unit and every ancestor the unit had at the
          period end, nearest first
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#files
          Jo’s two chapters with the Eastern Region among their ancestors
  - id: ATS-MBR-MEM-019-04
    title: Counts group the rows and count the month's movements
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-04
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: 'Generate a month with joins, renewals, lapses and reinstatements.'
        expect: >-
          Groups by type, package, status, grace and origin, with each movement
          counted.
        provenance: proposed
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#counts
          the member rows by type, package, status, grace and origin
    expected: >-
      Groups by type, package, status, grace and origin, with each movement
      counted.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to: []
    provenance: proposed
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#counts
      the member rows by type, package, status, grace and origin
    category: rule
    binding_gap: FND-MBR-MEM-103
  - id: ATS-MBR-MEM-019-05
    title: A failing check publishes nothing
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-05
      - INV-DOM-MBR-MEM-006-05
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Run a month whose counts do not add up.
        expect: >-
          The run fails, nothing is published, and the earlier version stays
          current.
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#fails
            the run on the counts check, publishes nothing, and leaves the
            current version current
          - >-
            services-membership:modules/snapshots/tests/unit/membership-snapshot-checks.spec.ts#fails
            the counts check when a group’s count is not its member rows
          - >-
            services-membership:modules/snapshots/tests/unit/membership-snapshot-checks.spec.ts#fails
            the affiliation check when an affiliation row has no member row
    expected: >-
      The run fails, nothing is published, and the earlier version stays
      current.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-040
      - TST-MBR-MEM-043
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#fails
      the run on the counts check, publishes nothing, and leaves the current
      version current
    category: failure
    binding_evidence:
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#fails
          the run on the counts check, publishes nothing, and leaves the current
          version current
      - suite: TST-MBR-MEM-043
        source: >-
          services-membership:modules/snapshots/tests/unit/membership-snapshot-checks.spec.ts#fails
          the counts check when a group’s count is not its member rows
      - suite: TST-MBR-MEM-043
        source: >-
          services-membership:modules/snapshots/tests/unit/membership-snapshot-checks.spec.ts#fails
          the affiliation check when an affiliation row has no member row
  - id: ATS-MBR-MEM-019-06
    title: Reruns reproduce a month or restate it by exactly the corrections
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-06
      - INV-DOM-MBR-MEM-006-06
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Rerun September with the original instant and with a later one after a
          correction.
        expect: >-
          Identical rows, then rows differing only by the corrected member; each
          published as the next version.
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#writes
            identical member, affiliation and count rows with the original
            known_at
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#differs,
            with a later known_at, by exactly the corrected membership
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#publishes
            each rerun as the next version and keeps the earlier ones readable
          - >-
            services-membership:tests/acceptance/history/MBR-ACC-0548.acceptance.ts#MBR-ACC-0548
    expected: >-
      Identical rows, then rows differing only by the corrected member; each
      published as the next version.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-040
      - TST-MBR-MEM-170
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#writes
      identical member, affiliation and count rows with the original known_at
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#writes
          identical member, affiliation and count rows with the original
          known_at
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#differs,
          with a later known_at, by exactly the corrected membership
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#publishes
          each rerun as the next version and keeps the earlier ones readable
      - suite: TST-MBR-MEM-170
        source: >-
          services-membership:tests/acceptance/history/MBR-ACC-0548.acceptance.ts#MBR-ACC-0548
  - id: ATS-MBR-MEM-019-07
    title: The workspace chooses what each month freezes
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-07
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Configure a captured rank and a reconstructed membership field,
          reorder them and drop one.
        expect: >-
          The run freezes the configured characteristics; a dropped one is
          deactivated.
        provenance: test
        source:
          - >-
            services-membership:tests/e2e/s10-historical-dimension.e2e.spec.ts#configures
            rank__c as a captured dimension of the tenant’s snapshots
          - >-
            services-membership:tests/acceptance/history/MBR-ACC-0543.acceptance.ts#MBR-ACC-0543
    expected: >-
      The run freezes the configured characteristics; a dropped one is
      deactivated.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-253
      - TST-MBR-MEM-165
    provenance: test
    source: >-
      services-membership:tests/e2e/s10-historical-dimension.e2e.spec.ts#configures
      rank__c as a captured dimension of the tenant’s snapshots
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-253
        source: >-
          services-membership:tests/e2e/s10-historical-dimension.e2e.spec.ts#configures
          rank__c as a captured dimension of the tenant’s snapshots
      - suite: TST-MBR-MEM-165
        source: >-
          services-membership:tests/acceptance/history/MBR-ACC-0543.acceptance.ts#MBR-ACC-0543
  - id: ATS-MBR-MEM-019-08
    title: Captured values are taken once and carried forward
    level: unit
    proves:
      - BR-CAP-MBR-MEM-019-08
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Plan the capture for the latest month, a rerun of a published month,
          and a back-fill of an older month.
        expect: 'Read live, carried forward, not captured.'
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#reads
            the live contact for the first capture of the latest completed month
          - >-
            services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#carries
            the superseded version’s rows forward on a rerun of a published
            month
          - >-
            services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#captures
            nothing for an older month with no published version: today’s value
            is not the period end’s
          - >-
            services-membership:tests/e2e/s10-historical-dimension.e2e.spec.ts#keeps
            September’s rank as captured when it is rerun after the contact
            changed
    expected: 'Read live, carried forward, not captured.'
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-042
      - TST-MBR-MEM-253
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#reads
      the live contact for the first capture of the latest completed month
    category: edge
    binding_evidence:
      - suite: TST-MBR-MEM-042
        source: >-
          services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#reads
          the live contact for the first capture of the latest completed month
      - suite: TST-MBR-MEM-042
        source: >-
          services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#carries
          the superseded version’s rows forward on a rerun of a published month
      - suite: TST-MBR-MEM-042
        source: >-
          services-membership:modules/snapshots/tests/unit/dimension-plan.spec.ts#captures
          nothing for an older month with no published version: today’s value is
          not the period end’s
      - suite: TST-MBR-MEM-253
        source: >-
          services-membership:tests/e2e/s10-historical-dimension.e2e.spec.ts#keeps
          September’s rank as captured when it is rerun after the contact
          changed
  - id: ATS-MBR-MEM-019-09
    title: Reports read the current published version only
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-09
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Read the published views after two versions of a month.
        expect: 'Only the current version is read, inside the workspace.'
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#reads
            the current published version alone through the published view, in
            the tenant
    expected: 'Only the current version is read, inside the workspace.'
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-040
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#reads
      the current published version alone through the published view, in the
      tenant
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#reads
          the current published version alone through the published view, in the
          tenant
  - id: ATS-MBR-MEM-019-10
    title: A month is filed under its own month-end tree
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-10
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Restate September after Atlanta moved in October.
        expect: Atlanta is still under the Eastern Region in September.
        provenance: test
        source:
          - >-
            services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#still
            files Atlanta under the Eastern Region in a September restated after
            the move: the period end’s tree
          - >-
            services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#still
            holds Atlanta among the Eastern Region’s descendants as of the
            period end
    expected: Atlanta is still under the Eastern Region in September.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-252
    provenance: test
    source: >-
      services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#still files
      Atlanta under the Eastern Region in a September restated after the move:
      the period end’s tree
    category: interaction
    binding_evidence:
      - suite: TST-MBR-MEM-252
        source: >-
          services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#still
          files Atlanta under the Eastern Region in a September restated after
          the move: the period end’s tree
      - suite: TST-MBR-MEM-252
        source: >-
          services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#still
          holds Atlanta among the Eastern Region’s descendants as of the period
          end
  - id: ATS-MBR-MEM-019-11
    title: Snapshot rows are purged only from a workspace being deleted
    level: api
    proves:
      - BR-CAP-MBR-MEM-019-13
      - INV-DOM-MBR-MEM-006-09
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: 'Purge a live workspace, then one being deleted.'
        expect: >-
          The first is refused before any row goes; the second removes the rows
          in batches.
        provenance: test
        source:
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#refuses
            to purge the tenant while Platform holds it active, before any row
            is removed (DEF-MBR-0010)
          - >-
            services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#removes
            the tenant’s snapshot rows through membership.snapshots, in batches
    expected: >-
      The first is refused before any row goes; the second removes the rows in
      batches.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-040
    provenance: test
    source: >-
      services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#refuses
      to purge the tenant while Platform holds it active, before any row is
      removed (DEF-MBR-0010)
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#refuses
          to purge the tenant while Platform holds it active, before any row is
          removed (DEF-MBR-0010)
      - suite: TST-MBR-MEM-040
        source: >-
          services-membership:modules/snapshots/tests/integration/membership-snapshot.integration.spec.ts#removes
          the tenant’s snapshot rows through membership.snapshots, in batches
  - id: ATS-MBR-MEM-019-12
    title: Freeze resolved standing at month end
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-005-01
      - BR-CAP-MBR-MEM-019-02
    interacts_with:
      - CAP-MBR-MEM-005
    workflows: []
    relies_on:
      - ATS-MBR-MEM-005-01
      - ATS-MBR-MEM-019-02
    preconditions: A member expires near month end and the status cache is stale.
    steps:
      - do: >-
          Generate the monthly snapshot and compare its member row with the
          resolver at month end.
        expect: The row has the month-end standing rather than the stale cached value.
        provenance: proposed
        source: &ref_0
          - >-
            services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#answers
            Sam grace, lapsed, then active across the lapse and rejoin (scenario
            4)
          - >-
            services-membership:modules/snapshots/tests/integration/snapshot-pipeline.integration.spec.ts#plans
            September’s first version for the tenant, once
    expected: The row has the month-end standing rather than the stale cached value.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_0
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-101'
  transition: 'gap: FND-MBR-MEM-101'
  validation: 'gap: FND-MBR-MEM-101'
  permission: 'gap: FND-MBR-MEM-101'
  edge: covered
  failure: covered
  boundary: covered
  concurrency: 'gap: FND-MBR-MEM-101'
  invariant: 'gap: FND-MBR-MEM-101'
  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.
---

# Report on membership now and month by month: Capability Test Specification

## Coverage

| Rule | Scenario or Finding |
|---|---|
| `BR-CAP-MBR-MEM-019-01` | `ATS-MBR-MEM-019-01` |
| `BR-CAP-MBR-MEM-019-02` | `ATS-MBR-MEM-019-02`, `ATS-MBR-MEM-019-12` |
| `BR-CAP-MBR-MEM-019-03` | `ATS-MBR-MEM-019-03` |
| `BR-CAP-MBR-MEM-019-04` | `ATS-MBR-MEM-019-04` |
| `BR-CAP-MBR-MEM-019-05` | `ATS-MBR-MEM-019-05` |
| `BR-CAP-MBR-MEM-019-06` | `ATS-MBR-MEM-019-06` |
| `BR-CAP-MBR-MEM-019-07` | `ATS-MBR-MEM-019-07` |
| `BR-CAP-MBR-MEM-019-08` | `ATS-MBR-MEM-019-08` |
| `BR-CAP-MBR-MEM-019-09` | `ATS-MBR-MEM-019-09` |
| `BR-CAP-MBR-MEM-019-10` | `ATS-MBR-MEM-019-10` |
| `BR-CAP-MBR-MEM-019-11` | no scenario: `FND-MBR-MEM-061` |
| `BR-CAP-MBR-MEM-019-12` | no scenario: `FND-MBR-MEM-062` |
| `BR-CAP-MBR-MEM-019-13` | `ATS-MBR-MEM-019-11` |

## 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.
