Skip to content

ATS-MBR-STR-004Close units or remove units without retained dependencies: Capability Test Specification

Markdown

ATS-MBR-STR-004

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

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaMembershipModuleOrganizational Structure, Membership Configuration and TermsRevision2

Read atservices-membership 5994c270react-console baf6dae3

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

Test Scenarios

10 scenarios proving CAP-MBR-STR-004; 6 bound to an existing test.

01 Closing a parent preserves its existing branchtransitionapitest
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.
Data
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
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
02 Ended affiliations still protect unit identityinvariantapinegativetest
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.
Data
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
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
03 Structural references prevent removalvalidationapinegativetest
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.
Data
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
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
04 Other membership records protect unit identityinteractionapinegativetest
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.
Data
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
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
05 Removing a free leaf clears its owned datatransitionapitest
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.
Data
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
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
06 Repeated closure preserves the current versionedgeapinegativeproposed
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.
Data
Separate fixture records for the accepted and refused operations.
Source
services-membership:modules/structure/services/tree/tree-edits.ts:deactivateUnit
07 Merge history prevents source removalinteractionapitest
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.
Data
Separate fixture records for the accepted and refused operations.
Bound to
services-membership:tests/e2e/s13-unit-merge.e2e.spec.ts#refuses to delete Savannah while affiliations name it (unit_has_affiliations)
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)
08 Ending an organization link does not release unit identityinteractionapiproposed
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.
Data
Separate fixture records for the accepted and refused operations.
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
09 Dues keep a closed unit referencedinteractionapiproposed
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.
Data
Separate fixture records for the accepted and refused operations.
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
10 Workspace authority gates this capabilitypermissionapinegativeproposed
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.
Data
Separate fixture records for the accepted and refused operations.
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

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.