ATS-MBR-STR-002Restructure units while preserving dated placement: Acceptance Test Set
MarkdownRestructure units while preserving dated placement: Acceptance Test Set
Coverage
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
- 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
- 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
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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