Skip to content

ATS-MBR-STR-002Restructure units while preserving dated placement: Acceptance Test Set

Markdown

ATS-MBR-STR-002

Restructure units while preserving dated placement: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-MBR-STR-002

KindAcceptance test setProduct areaMembershipModuleOrganizational Structure, Membership Configuration and TermsRevision1

Read atservices-membership 5994c270react-console baf6dae3

Test Scenarios

11 scenarios proving CAP-MBR-STR-002; 11 bound to an existing test.

01 Placement checks also guard direct writesapinegativetest
Proves
BR-CAP-MBR-STR-002-01 AS-JNY-MBR-STR-001-01
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Try a chapter under a disallowed region and as a disallowed root, then attempt invalid parentage through the database.
Expected
Both service cases fail and the database rejects the direct placement.
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 a parent of a type not allowed, 409 parent_type_not_allowed
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a root of a type that may not be one
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses, in the database itself, a parent of a type not allowed (the constraint trigger)
services-membership:tests/acceptance/structure/MBR-ACC-0010.acceptance.ts#MBR-ACC-0010 every illegal placement of a new unit is refused
Source
services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process › refuses a parent of a type not allowed, 409 parent_type_not_allowed
02 Opposing concurrent moves preserve an acyclic treeapinegativetest
Proves
BR-CAP-MBR-STR-002-02
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Try moving a region beneath its chapter, then submit opposing moves concurrently.
Expected
The cycle fails; one concurrent move succeeds and the final ancestry matches a fresh parent walk.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a move under the unit’s own descendant as a cycle
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a move under the unit itself as a cycle
services-membership:modules/structure/tests/integration/services/tree/tree-scale.integration.spec.ts#the tree at scale › serialises two concurrent moves of one tenant by the tree lock, the second validating against the first’s closure
services-membership:tests/e2e/structure-api.e2e.spec.ts#the structure API, end to end in process › refuses a move under the unit’s own descendant, 409 move_creates_cycle
services-membership:tests/acceptance/structure/MBR-ACC-0016.acceptance.ts#MBR-ACC-0016 two staff reorganise the same chapters at once
Source
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a move under the unit’s own descendant as a cycle
03 Closed parents reject incoming childrenapinegativetest
Proves
BR-CAP-MBR-STR-002-03
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Try creation below an inactive unit and relocation below a merged unit.
Expected
Each attempt returns an inactive-parent refusal.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a new child under an inactive unit
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › refuses an inactive parent
Source
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the refusals › refuses a new child under an inactive unit
04 Only eligible units can change parentapinegativetest
Proves
BR-CAP-MBR-STR-002-04
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Attempt relocation of inactive and merged units and relocation to an unchanged parent.
Expected
All attempts fail with the corresponding structural refusal and preserve earlier records.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
Source
services-membership:tests/acceptance/structure/MBR-ACC-0014.acceptance.ts#MBR-ACC-0014 every move the tree refuses
05 Depth checks reject the complete editunitnegativetest
Proves
BR-CAP-MBR-STR-002-05
Preconditions
Explicit inputs or a recording fixture represent the cases exercised below.
Steps
Propose a branch reaching depth 32 and separately simulate a rebuild at that depth.
Expected
Both paths reject the excessive depth.
Data
Recording tree-store fixtures and controlled operation inputs.
Bound to
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › refuses a move that would put the subtree at the depth cap, before any write
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › refuses the whole edit when the rebuilt tree reaches depth 32 (a cycle past validation)
services-membership:tests/acceptance/structure/MBR-ACC-0015.acceptance.ts#MBR-ACC-0015 thirty-one levels, a moved subtree and a second root
Source
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › refuses a move that would put the subtree at the depth cap, before any write
06 Move dates use the workspace calendarapinegativetest
Proves
BR-CAP-MBR-STR-002-06
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Compare omitted dates with a date before current placement and a date after today.
Expected
Omission selects the workspace date and the out-of-range dates fail.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the parent history and the as-of tree › refuses a move dated before the current parent began
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the parent history and the as-of tree › refuses a move dated after today
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › records the history from the tenant’s business date
Source
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the parent history and the as-of tree › refuses a move dated before the current parent began
07 Successive parent periods meet without overlapapitest
Proves
BR-CAP-MBR-STR-002-07
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Relocate a unit after its current placement’s first day.
Expected
The earlier period finishes the preceding day and one open attributed period remains.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the parent history and the as-of tree › closes the open row at the day before the new one and keeps one open row per unit
services-membership:tests/acceptance/structure/MBR-ACC-0013.acceptance.ts#MBR-ACC-0013 a backdated move and a same-day correction
Source
services-membership:modules/structure/tests/integration/services/persistence/organizational-units.integration.spec.ts#organizational units in the database › the parent history and the as-of tree › closes the open row at the day before the new one and keeps one open row per unit
08 Same-day corrections retain one current periodapitest
Proves
BR-CAP-MBR-STR-002-08
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Submit two parent changes effective on the same date.
Expected
Current history names the later parent and retained versions explain the earlier change.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:tests/acceptance/structure/MBR-ACC-0013.acceptance.ts#MBR-ACC-0013 a backdated move and a same-day correction
Source
services-membership:tests/acceptance/structure/MBR-ACC-0013.acceptance.ts#MBR-ACC-0013 a backdated move and a same-day correction
09 Large branch moves leave coherent ancestryapitest
Proves
BR-CAP-MBR-STR-002-09
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Relocate a 68-unit branch within a 500-unit structure and compare the result with a parent walk.
Expected
The edit preserves its checked operation order and the rebuilt ancestry matches the independent walk.
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 › move › locks, validates against the current closure, changes the parent, records history, rebuilds, updates depths and checks the cap, in that order
services-membership:modules/structure/tests/integration/services/tree/tree-scale.integration.spec.ts#the tree at scale › leaves a closure equal to a fresh walk of the parents after the concurrent moves
services-membership:modules/structure/tests/integration/services/tree/tree-scale.integration.spec.ts#the tree at scale › answers the moved subtree under its new parent
services-membership:modules/structure/tests/unit/services/tree-statements.spec.ts#the tree statements › the closure rebuild › walks every unit down from itself at depth 0, one level per step, under the cap of 32, in every statement but the depths
services-membership:modules/structure/tests/unit/services/tree-statements.spec.ts#the tree statements › the closure rebuild › removes the tenant’s pairs the walk no longer has, at their depth, and only the tenant’s
Source
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › locks, validates against the current closure, changes the parent, records history, rebuilds, updates depths and checks the cap, in that order
10 Parent changes publish their contextunittest
Proves
BR-CAP-MBR-STR-002-11
Preconditions
Explicit inputs or a recording fixture represent the cases exercised below.
Steps
Submit a valid unit relocation and inspect its business event.
Expected
The event identifies the unit, previous and new parents, effective date and attribution.
Data
Recording tree-store fixtures and controlled operation inputs.
Bound to
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › states membership.unit.reparented with the old and the new parent and the business date
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › builds the reparented payload from the move and the transaction’s attribution
Source
services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move › states membership.unit.reparented with the old and the new parent and the business date
11 Regional membership views follow placementapitest
Proves
BR-CAP-MBR-STR-002-14 AS-JNY-MBR-STR-002-01 AS-JNY-MBR-STR-002-02
Preconditions
An isolated Membership-licensed workspace contains the relevant records, with caller permissions selected for the case.
Steps
Move Atlanta from Southeast to Pacific and inspect Jo’s affiliation and regional views.
Expected
The affiliation is unchanged while current and period-end views use their respective regions.
Data
The FAA example records or equivalent records prepared within the isolated workspace.
Bound to
services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#scenario 9: organizational restructuring › rewrites no affiliation: Jo’s row is the same row, version and unit
services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#scenario 9: organizational restructuring › shows Jo under the Western Region and the Pacific Zone today, and no longer under the Eastern Region
services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#scenario 9: organizational restructuring › still holds Atlanta among the Eastern Region’s descendants as of the period end
services-membership:tests/acceptance/structure/MBR-ACC-0012.acceptance.ts#MBR-ACC-0012 scenario 9: Atlanta moves to the Pacific Zone
Source
services-membership:tests/e2e/s09-restructuring.e2e.spec.ts#scenario 9: organizational restructuring › rewrites no affiliation: Jo’s row is the same row, version and unit

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.