---
id: ATS-MBR-MEM-006
scope: CAP-MBR-MEM-006
product_area: membership
module: memberships
revision: 1
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-MBR-MEM-006-01
    title: Commit package grants with the source term
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-01
    preconditions: A selected package grants a section membership to the same owner.
    steps: Create the source membership and inspect its additional program membership after commit.
    expected: The additional membership and source-linked term exist after the same commit.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        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
    provenance: test
    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
  - id: ATS-MBR-MEM-006-02
    title: Compute grant periods for enrolment and renewal
    level: unit
    proves:
      - BR-CAP-MBR-MEM-006-02
    preconditions: 'Grant inputs include same-as-primary, own-rule and renewal cases.'
    steps: Plan initial and renewed grants using each supported date rule.
    expected: >-
      Mirroring retains source dates; own rules respect the source start; renewal plans the next target
      period.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the
        primary term’s dates for a grant same as primary
      - >-
        services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term by the
        grant’s own rule, never starting before the primary term
      - >-
        services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans the next granted term on a
        renewal of the granting package
    provenance: test
    source: >-
      services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the
      primary term’s dates for a grant same as primary
  - id: ATS-MBR-MEM-006-03
    title: Skip an overlapping target-program period
    level: unit
    proves:
      - BR-CAP-MBR-MEM-006-03
    preconditions: An effective target-program term overlaps a planned grant period.
    steps: Plan the grant against the already-held effective target period.
    expected: 'No duplicate period is planned, and the skipped result identifies the overlapping term.'
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#skips a grant the member already
        holds for those dates, naming the term
    provenance: test
    source: >-
      services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#skips a grant the member already
      holds for those dates, naming the term
  - id: ATS-MBR-MEM-006-04
    title: Select organizational contacts through qualifying roles
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-04
    preconditions: An organization has contacts with qualifying and nonqualifying roles.
    steps: Create the corporate period and inspect which contacts receive mirrored memberships.
    expected: Qualifying contacts receive mirrored coverage; contacts with unrelated roles receive none.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows
        down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type
      - >-
        services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#gives
        nothing to a contact whose role is not a flow-down role
    provenance: test
    source: >-
      services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows
      down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type
  - id: ATS-MBR-MEM-006-05
    title: Limit cascading to ten descendant levels
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-05
    preconditions: An eleven-level hierarchy contains eligible contacts at the tenth and eleventh depths.
    steps: Derive corporate coverage and inspect contacts at each depth.
    expected: Depth-ten contacts receive coverage and depth-eleven contacts do not.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#cascades
        to the contacts of child organizations down to depth 10 and no further
      - >-
        services-membership:tests/acceptance/affiliations/MBR-ACC-0274.acceptance.ts#MBR-ACC-0274: Acme's
        corporate membership reaches its CEO, its engineers and the people of its subsidiaries ten levels
        down, each with a mirrored employee term, and follows the parent through correction, termination,
        suspension and restore
    provenance: test
    source: >-
      services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#cascades
      to the contacts of child organizations down to depth 10 and no further
  - id: ATS-MBR-MEM-006-06
    title: Select assigned seats within the package cap
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-06
    preconditions: A decided organizational application names more contacts than the package’s seat allowance.
    steps: Recalculate the organization’s children from the decided application contacts.
    expected: >-
      Only contacts selected before the seat cap can receive assigned coverage; contacts already flowed down
      retain that coverage.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to: []
    provenance: proposed
    source: 'services-membership:modules/memberships/services/flowdown/organization-children.ts:wantedPeople'
  - id: ATS-MBR-MEM-006-07
    title: Update child periods after a parental correction
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-07
    preconditions: An organizational parent has mirrored child periods.
    steps: Correct the parent’s end to an earlier date and inspect dependent periods.
    expected: Child mirrors follow the corrected end.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to:
      - >-
        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
    provenance: test
    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
  - id: ATS-MBR-MEM-006-08
    title: Withdraw coverage after eligibility ends
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-08
    preconditions: An engineer’s qualifying CRM role has ended but the change has not yet been handled.
    steps: >-
      Deliver the role-change event and inspect the engineer’s term; separately exercise withdrawal before a
      child starts.
    expected: Started coverage closes on the handling day; not-yet-started coverage is cancelled.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to: []
    provenance: proposed
    source: >-
      services-membership:modules/memberships/services/flowdown/organization-children.ts:syncOrganizationChildren
  - id: ATS-MBR-MEM-006-09
    title: Converge after repeated CRM deliveries
    level: api
    proves:
      - BR-CAP-MBR-MEM-006-09
    preconditions: Current CRM relationships and existing child memberships differ after a role change.
    steps: 'Deliver a change again and in reordered batches, then inspect child periods and event counts.'
    expected: Recomputation follows current CRM state without creating duplicate withdrawal events.
    negative: false
    data_needs: >-
      Package grants or organizational parents, CRM relationships and controlled dates appropriate to this
      derivation.
    bound_to: []
    provenance: proposed
    source: 'services-membership:modules/memberships/services/flowdown/crm-change-events.ts:handleCrmChangeEvents'
evidence:
  - >-
    services-membership at 5994c270e8a37a30f848e99ba5b5ee6b87c08893: reviewed grant planning and application,
    organizational child derivation, current-CRM delivery handling, ownership constraints and the cited
    integration and acceptance assertions.
---

# Derive package grants and organizational child memberships: Acceptance Test Set

## Coverage

| Rule | Proved by |
|---|---|
| `BR-CAP-MBR-MEM-006-01` | `ATS-MBR-MEM-006-01` |
| `BR-CAP-MBR-MEM-006-02` | `ATS-MBR-MEM-006-02` |
| `BR-CAP-MBR-MEM-006-03` | `ATS-MBR-MEM-006-03` |
| `BR-CAP-MBR-MEM-006-04` | `ATS-MBR-MEM-006-04` |
| `BR-CAP-MBR-MEM-006-05` | `ATS-MBR-MEM-006-05` |
| `BR-CAP-MBR-MEM-006-06` | `ATS-MBR-MEM-006-06` |
| `BR-CAP-MBR-MEM-006-07` | `ATS-MBR-MEM-006-07` |
| `BR-CAP-MBR-MEM-006-08` | `ATS-MBR-MEM-006-08` |
| `BR-CAP-MBR-MEM-006-09` | `ATS-MBR-MEM-006-09` |
| `BR-CAP-MBR-MEM-006-10` | no scenario: `FND-MBR-MEM-019` |
