MEDIUM story-org-structure-management-organization-administrator-005 5 pts
5
Story Points
Medium
Priority
Organization Structure Management
Feature

User Story

As a administrator
I want to delete an organizational unit with the system preventing deletion of units that still have child nodes or active members assigned
So that So that the organizational hierarchy remains consistent and no data is orphaned by accidental structural removals

Acceptance Criteria

  • Given I am an authorized administrator, when I tap the Delete action on a unit detail screen, then a confirmation dialog appears before any data is modified
  • Given a unit has child associations, when I attempt to confirm deletion, then the system rejects it with an error message listing the child units that must be removed first
  • Given a unit has active coordinators assigned, when I attempt to delete it, then the system rejects the deletion and prompts me to reassign or remove those coordinators first
  • Given all cascade validation checks pass and I confirm deletion, when the operation completes, then the unit is removed and the parent unit's child count decrements correctly
  • Given the deletion succeeds, when I return to the organization tree, then the deleted unit no longer appears at any level of the hierarchy

Business Value

Cascade validation on deletion prevents the most common class of data integrity errors in hierarchical systems — orphaned child records and broken role assignments. For a system where organizational structure directly drives access control and Bufdir reporting, unguarded deletions could silently corrupt financial grant data.