---
id: ATS-MBR-STR-004
scope: CAP-MBR-STR-004
product_area: membership
module: structure
revision: 2
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-MBR-STR-004-01
    title: Closing a parent preserves its existing branch
    level: api
    proves:
      - BR-CAP-MBR-STR-004-01
    preconditions: >-
      An isolated Membership-licensed workspace contains the relevant records, with caller permissions
      selected for the case.
    steps: Deactivate a populated chapter and attempt a new child and affiliation.
    expected: Existing sections stay active and the new relationships are rejected.
    negative: false
    data_needs: The FAA example records or equivalent records prepared within the isolated workspace.
    bound_to:
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › deactivates it instead
      - >-
        services-membership:tests/acceptance/structure/MBR-ACC-0020.acceptance.ts#MBR-ACC-0020
        deactivating a chapter freezes it, and there is no way back
      - TST-MBR-STR-008
      - TST-MBR-STR-079
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
      tree edits affiliations bind › delete and deactivate › deactivates it instead
    category: transition
  - id: ATS-MBR-STR-004-02
    title: Ended affiliations still protect unit identity
    level: api
    proves:
      - BR-CAP-MBR-STR-004-04
      - INV-DOM-MBR-STR-002-07
    preconditions: >-
      An isolated Membership-licensed workspace contains the relevant records, with caller permissions
      selected for the case.
    steps: >-
      Attempt deletion of a unit referenced only by ended affiliations and a source with transferred
      affiliation history.
    expected: Both responses refuse removal and report the affiliation count.
    negative: true
    data_needs: The FAA example records or equivalent records prepared within the isolated workspace.
    bound_to:
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
        affiliation names, 409 unit_has_affiliations with the count
      - >-
        services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts#a unit merge moves its members: Savannah
        into Atlanta › refuses to delete Savannah while affiliations name it (unit_has_affiliations)
      - >-
        services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
        delete › refuses 409 unit_has_affiliations while an affiliation names the unit, before deleting
      - TST-MBR-STR-008
      - TST-MBR-STR-099
      - TST-MBR-STR-010
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
      tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
      affiliation names, 409 unit_has_affiliations with the count
    category: invariant
  - id: ATS-MBR-STR-004-03
    title: Structural references prevent removal
    level: api
    proves:
      - BR-CAP-MBR-STR-004-05
    preconditions: >-
      An isolated Membership-licensed workspace contains the relevant records, with caller permissions
      selected for the case.
    steps: >-
      Test deletion while children, retained parent periods, organization links or survivor references
      remain.
    expected: Each response identifies retained use and preserves the unit.
    negative: true
    data_needs: The FAA example records or equivalent records prepared within the isolated workspace.
    bound_to:
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational
        units in the database › the refusals › refuses to delete a unit that has children
      - TST-MBR-STR-100
      - TST-MBR-STR-006
    provenance: test
    source: >-
      services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process ›
      refuses to delete a unit in use, 409 unit_in_use
    category: validation
  - id: ATS-MBR-STR-004-04
    title: Other membership records protect unit identity
    level: api
    proves:
      - BR-CAP-MBR-STR-004-06
    preconditions: >-
      An isolated Membership-licensed workspace contains the relevant records, with caller permissions
      selected for the case.
    steps: Attempt deletion of a program-owning unit and a membership-identifying unit.
    expected: Each refusal identifies the reference and keeps the unit.
    negative: true
    data_needs: The FAA example records or equivalent records prepared within the isolated workspace.
    bound_to:
      - >-
        services-membership:tests/e2e/database-refusals.e2e.spec.ts#mistakes only the database catches,
        through the API › DEF-MBR-0084: a structure delete a program’s reference blocks › refuses
        deleting a unit a program is owned by 409 unit_in_use, and keeps it
      - >-
        services-membership:tests/e2e/database-refusals.e2e.spec.ts#mistakes only the database catches,
        through the API › DEF-MBR-0012: a structure delete an identity-bound membership blocks › refuses
        deleting a unit a membership is identified by 409 unit_in_use naming the reference, and keeps it
      - >-
        services-membership:tests/acceptance/structure/MBR-ACC-0037.acceptance.ts#MBR-ACC-0037 what other
        parts of Membership name in the structure
      - TST-MBR-STR-095
      - TST-MBR-STR-094
    provenance: test
    source: >-
      services-membership:tests/e2e/database-refusals.e2e.spec.ts#mistakes only the database catches,
      through the API › DEF-MBR-0084: a structure delete a program’s reference blocks › refuses deleting
      a unit a program is owned by 409 unit_in_use, and keeps it
    category: interaction
  - id: ATS-MBR-STR-004-05
    title: Removing a free leaf clears its owned data
    level: api
    proves:
      - BR-CAP-MBR-STR-004-07
    preconditions: >-
      An isolated Membership-licensed workspace contains the relevant records, with caller permissions
      selected for the case.
    steps: 'Remove a leaf whose references are all absent, then inspect its owned rows.'
    expected: 'The unit and its current pairs, parent periods, custom values and finance settings are absent.'
    negative: false
    data_needs: The FAA example records or equivalent records prepared within the isolated workspace.
    bound_to:
      - >-
        services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
        delete › deletes a unit no affiliation and nothing else names
      - TST-MBR-STR-010
    provenance: test
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
      delete › deletes a unit no affiliation and nothing else names
    category: transition
  - id: ATS-MBR-STR-004-06
    title: Repeated closure preserves the current version
    category: edge
    level: api
    proves:
      - BR-CAP-MBR-STR-004-02
    preconditions: An isolated workspace contains the records and current versions needed for the case.
    steps: >-
      Close an active leaf; close it again without a version; retry with a stale version and try closing
      a merged source.
    expected: >-
      Repeated unversioned closure returns the unchanged inactive record; the stale and merged requests
      fail.
    negative: true
    data_needs: Separate fixture records for the accepted and refused operations.
    bound_to: []
    provenance: proposed
    source:
      - 'services-membership:modules/structure/services/tree/tree-edits.ts:deactivateUnit'
  - id: ATS-MBR-STR-004-07
    title: Merge history prevents source removal
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-STR-003-04
      - BR-CAP-MBR-STR-004-04
    preconditions: An isolated workspace contains the records and current versions needed for the case.
    steps: 'Merge a source whose member affiliation transfers to the survivor, then attempt source deletion.'
    expected: The retained source affiliation prevents deletion even though the current roster has moved.
    negative: false
    data_needs: Separate fixture records for the accepted and refused operations.
    bound_to:
      - TST-MBR-STR-099
      - >-
        services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts#refuses to delete Savannah while
        affiliations name it (unit_has_affiliations)
    provenance: test
    source:
      - 'services-membership:docs/migrations/unit-merge/README.md#The behaviour'
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
        affiliation names, 409 unit_has_affiliations with the count
      - >-
        services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts#refuses to delete Savannah while
        affiliations name it (unit_has_affiliations)
    exercises:
      - CAP-MBR-STR-004
      - CAP-MBR-STR-003
  - id: ATS-MBR-STR-004-08
    title: Ending an organization link does not release unit identity
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-STR-004-05
      - BR-CAP-MBR-STR-007-04
    preconditions: An isolated workspace contains the records and current versions needed for the case.
    steps: 'Add a legal organization link, end it and attempt unit deletion.'
    expected: The ended link remains as history and removal is refused.
    negative: false
    data_needs: Separate fixture records for the accepted and refused operations.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:modules/structure/services/persistence/organizational-unit-organizations.ts:unlinkOrganization
    exercises:
      - CAP-MBR-STR-004
      - CAP-MBR-STR-007
  - id: ATS-MBR-STR-004-09
    title: Dues keep a closed unit referenced
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-STR-004-05
      - BR-CAP-MBR-STR-008-01
    preconditions: An isolated workspace contains the records and current versions needed for the case.
    steps: 'Give a chapter a dues extension, close the chapter and attempt deletion.'
    expected: Closure preserves the extension and deletion reports retained use.
    negative: false
    data_needs: Separate fixture records for the accepted and refused operations.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:tests/e2e/packages-as-products.e2e.spec.ts#packages as products, through the
        API › extends a product of type chapter_dues as a unit’s dues product, under the product’s id,
        with the product’s name
    exercises:
      - CAP-MBR-STR-004
      - CAP-MBR-STR-008
  - id: ATS-MBR-STR-004-10
    title: Workspace authority gates this capability
    category: permission
    level: api
    proves:
      - BR-CAP-MBR-STR-019-01
    preconditions: An isolated workspace contains the records and current versions needed for the case.
    steps: >-
      Exercise the capability’s exposed operations with its read-only and management callers, then repeat
      with application access removed, an unlicensed workspace and an unavailable workspace.
    expected: >-
      Each named operation requires its declared authority; admission failures occur before any record or
      calculated result is exposed.
    negative: true
    data_needs: Separate fixture records for the accepted and refused operations.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-membership:tests/unit/route-authorization.spec.ts#route authorization: every Membership
        operation names its permission › requires membership.structure.read of every structure read and
        membership.structure.manage of every change
      - >-
        services-membership:modules/configuration/aws/api/configuration.routes.ts:configurationModuleRoutes
      - >-
        services-membership:tests/e2e/terms-api.e2e.spec.ts#the terms API, end to end in process ›
        refuses a caller who holds no key in the tenant
    exercises:
      - CAP-MBR-STR-004
      - CAP-MBR-STR-019
evidence:
  - >-
    services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts
  - 'services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts'
  - 'services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts'
  - 'services-membership:tests/acceptance/structure/MBR-ACC-0020.acceptance.ts'
  - 'services-membership:tests/acceptance/structure/MBR-ACC-0037.acceptance.ts'
  - 'services-membership:tests/e2e/database-refusals.e2e.spec.ts'
  - 'services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts'
  - 'services-membership:tests/e2e/structure-api.e2e.spec.ts'
  - >-
    services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
    tree edits affiliations bind › delete and deactivate › deactivates it instead
  - 'services-membership:modules/structure/services/tree/tree-edits.ts:deactivateUnit'
  - 'services-membership:modules/structure/aws/api/structure-requests.ts:unitReplaceBody'
  - >-
    services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
    tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed affiliation
    names, 409 unit_has_affiliations with the count
  - >-
    services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process ›
    refuses to delete a unit in use, 409 unit_in_use
  - >-
    services-membership:tests/e2e/database-refusals.e2e.spec.ts#mistakes only the database catches,
    through the API › DEF-MBR-0084: a structure delete a program’s reference blocks › refuses deleting a
    unit a program is owned by 409 unit_in_use, and keeps it
  - >-
    services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › delete
    › deletes a unit no affiliation and nothing else names
  - 'services-membership:docs/migrations/unit-merge/README.md#The behaviour'
  - >-
    services-membership:modules/structure/services/persistence/organizational-unit-organizations.ts:unlinkOrganization
  - >-
    services-membership:tests/e2e/packages-as-products.e2e.spec.ts#packages as products, through the API
    › extends a product of type chapter_dues as a unit’s dues product, under the product’s id, with the
    product’s name
  - membership.structure.manage
  - membership.application.access
  - >-
    services-membership:tests/unit/route-authorization.spec.ts#route authorization: every Membership
    operation names its permission › requires membership.structure.read of every structure read and
    membership.structure.manage of every change
  - 'services-membership:modules/configuration/aws/api/configuration.routes.ts:configurationModuleRoutes'
  - >-
    services-membership:tests/e2e/terms-api.e2e.spec.ts#the terms API, end to end in process › refuses a
    caller who holds no key in the tenant
coverage:
  rule: 'gap: FND-MBR-STR-057'
  transition: covered
  validation: covered
  permission: covered
  edge: covered
  failure: 'gap: FND-MBR-STR-057'
  boundary: 'gap: FND-MBR-STR-057'
  concurrency: 'gap: FND-MBR-STR-057'
  invariant: covered
  interaction: covered
coverage_notes:
  rule: >-
    No dedicated scenario establishes this category across the capability’s declared operations and
    design obligations.
  failure: >-
    No dedicated scenario establishes this category across the capability’s declared operations and
    design obligations.
  boundary: >-
    No dedicated scenario establishes this category across the capability’s declared operations and
    design obligations.
  concurrency: >-
    No dedicated scenario establishes this category across the capability’s declared operations and
    design obligations.
unproved_rules: []
coverage_obligations:
  permissions:
    - key: membership.structure.manage
      scenario_ids:
        - ATS-MBR-STR-019-01
      local_scenario_ids:
        - ATS-MBR-STR-004-10
      coverage: partial
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
      note: >-
        These cases establish declared authority or representative admission; exhaustive operation and
        caller combinations remain open.
    - key: membership.application.access
      scenario_ids:
        - ATS-MBR-STR-019-04
      local_scenario_ids:
        - ATS-MBR-STR-004-10
      coverage: partial
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
      note: >-
        These cases establish declared authority or representative admission; exhaustive operation and
        caller combinations remain open.
  state_models:
    - id: STATE-MBR-STR-001
      transitions:
        - from: active
          to: inactive
          trigger: Staff close the unit.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids:
            - ATS-MBR-STR-004-01
          coverage: specified
          gap: null
        - from: inactive
          to: inactive
          trigger: Staff repeat closure of an inactive unit.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids:
            - ATS-MBR-STR-004-06
          coverage: specified
          gap: null
        - from: active
          to: merged
          trigger: Staff combine the source into a surviving unit.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids: []
          coverage: gap
          gap: FND-MBR-STR-057
        - from: inactive
          to: merged
          trigger: Staff merge an inactive source.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids: []
          coverage: gap
          gap: FND-MBR-STR-057
        - from: active
          to: removed
          trigger: Staff remove an unused active unit.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids:
            - ATS-MBR-STR-004-05
          coverage: specified
          gap: null
        - from: inactive
          to: removed
          trigger: Staff remove an unused inactive unit.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids: []
          coverage: gap
          gap: FND-MBR-STR-057
        - from: merged
          to: removed
          trigger: Staff request deletion of a merged source.
          provenance: unknown
          source: FND-MBR-STR-057
          scenario_ids: []
          coverage: gap
          gap: FND-MBR-STR-057
      gap: FND-MBR-STR-057
  related:
    - capability: CAP-MBR-STR-003
      scenario: ATS-MBR-STR-004-07
      provenance: proposed
    - capability: CAP-MBR-STR-007
      scenario: ATS-MBR-STR-004-08
      provenance: proposed
    - capability: CAP-MBR-STR-008
      scenario: ATS-MBR-STR-004-09
      provenance: proposed
  invariants:
    - id: INV-DOM-MBR-STR-001-01
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-02
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-03
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-04
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-05
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-06
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-001-07
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-01
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-02
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-03
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-04
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-05
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-06
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-07
      scenario_ids:
        - ATS-MBR-STR-004-02
      coverage: specified
      gap: null
      provenance: documented
      source:
        - >-
          services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
          tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
          affiliation names, 409 unit_has_affiliations with the count
    - id: INV-DOM-MBR-STR-002-08
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
    - id: INV-DOM-MBR-STR-002-09
      scenario_ids: []
      coverage: gap
      gap: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
  workflows:
    - id: WF-MBR-STR-003
      scenarios:
        - ATS-MBR-STR-004-04
        - ATS-MBR-STR-004-07
        - ATS-MBR-STR-004-08
        - ATS-MBR-STR-004-09
      unproved_failure_and_concurrency: FND-MBR-STR-057
      provenance: unknown
      source: FND-MBR-STR-057
  workflow_interactions: []
rule_coverage:
  - rule: BR-CAP-MBR-STR-004-01
    scenarios:
      - ATS-MBR-STR-004-01
    gap: null
    provenance: documented
    source:
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › deactivates it instead
  - rule: BR-CAP-MBR-STR-004-02
    scenarios:
      - ATS-MBR-STR-004-06
    gap: null
    provenance: documented
    source:
      - 'services-membership:modules/structure/services/tree/tree-edits.ts:deactivateUnit'
  - rule: BR-CAP-MBR-STR-004-04
    scenarios:
      - ATS-MBR-STR-004-02
      - ATS-MBR-STR-004-07
    gap: null
    provenance: documented
    source:
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
        affiliation names, 409 unit_has_affiliations with the count
      - 'services-membership:docs/migrations/unit-merge/README.md#The behaviour'
      - >-
        services-membership:modules/structure/tests/integration/services/tree/unit-merge.integration.spec.ts#the
        tree edits affiliations bind › delete and deactivate › refuses to delete a unit a closed
        affiliation names, 409 unit_has_affiliations with the count
      - >-
        services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts#refuses to delete Savannah while
        affiliations name it (unit_has_affiliations)
  - rule: BR-CAP-MBR-STR-004-05
    scenarios:
      - ATS-MBR-STR-004-03
      - ATS-MBR-STR-004-08
      - ATS-MBR-STR-004-09
    gap: null
    provenance: documented
    source:
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:modules/structure/services/persistence/organizational-unit-organizations.ts:unlinkOrganization
      - >-
        services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process
        › refuses to delete a unit in use, 409 unit_in_use
      - >-
        services-membership:tests/e2e/packages-as-products.e2e.spec.ts#packages as products, through the
        API › extends a product of type chapter_dues as a unit’s dues product, under the product’s id,
        with the product’s name
  - rule: BR-CAP-MBR-STR-004-06
    scenarios:
      - ATS-MBR-STR-004-04
    gap: null
    provenance: documented
    source:
      - >-
        services-membership:tests/e2e/database-refusals.e2e.spec.ts#mistakes only the database catches,
        through the API › DEF-MBR-0084: a structure delete a program’s reference blocks › refuses
        deleting a unit a program is owned by 409 unit_in_use, and keeps it
  - rule: BR-CAP-MBR-STR-004-07
    scenarios:
      - ATS-MBR-STR-004-05
    gap: null
    provenance: documented
    source:
      - >-
        services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
        delete › deletes a unit no affiliation and nothing else names
narrative_sources:
  - section: Coverage
    provenance: documented
    source:
      - CAP-MBR-STR-004
      - FND-MBR-STR-057
  - section: Interactions With Related Capabilities
    provenance: proposed
    source:
      - ATS-MBR-STR-004-04
      - ATS-MBR-STR-004-07
      - ATS-MBR-STR-004-08
      - ATS-MBR-STR-004-09
---

# Close units or remove units without retained dependencies: Capability Test Specification

## Coverage

The coverage map distinguishes specified examples from missing proof. A covered category means an expected case is specified; executable bindings and their run results remain separate evidence. Each required rule has a proof link or an explicit coverage finding in the structured rule ledger.

| Required Rule | Scenario or Finding |
|---|---|
| `BR-CAP-MBR-STR-004-01` | `ATS-MBR-STR-004-01` |
| `BR-CAP-MBR-STR-004-02` | `ATS-MBR-STR-004-06` |
| `BR-CAP-MBR-STR-004-04` | `ATS-MBR-STR-004-02`, `ATS-MBR-STR-004-07` |
| `BR-CAP-MBR-STR-004-05` | `ATS-MBR-STR-004-03`, `ATS-MBR-STR-004-08`, `ATS-MBR-STR-004-09` |
| `BR-CAP-MBR-STR-004-06` | `ATS-MBR-STR-004-04` |
| `BR-CAP-MBR-STR-004-07` | `ATS-MBR-STR-004-05` |

## Interactions With Related Capabilities

Merge history prevents source removal. Merge a source whose member affiliation transfers to the survivor, then attempt source deletion.

Ending an organization link does not release unit identity. Add a legal organization link, end it and attempt unit deletion.

Dues keep a closed unit referenced. Give a chapter a dues extension, close the chapter and attempt deletion.
