Org Structure and Hierarchy

Org Structure and Hierarchy

Organizational Structure and Accountability Matrix Design

📌 Overview

This document provides comprehensive guidance on implementing organizational hierarchy, user account management, and accountability relationships in the SumeruSuite recruitment application using the Flexbase framework's AccountableEntity system.


🎯 Business Requirements

Organizational Structure Needs:

  • Hierarchical Organization Management - Support for Company → Division → Department → Team structures

  • User Account Management - Centralized personal information for all users

  • Accountability Relationships - Flexible responsibility and reporting relationships

  • Multi-Role Support - Users can have multiple roles (Employee, Candidate, Contractor, etc.)

  • Organizational Assignment - Employees and entities belong to organizational units

  • Reporting Structures - Manager-subordinate relationships

  • Approval Hierarchies - Multi-level approval workflows based on org structure


🏗️ Core Architecture

1. AccountableEntity Base Class

The foundation of the organizational structure system is the AccountableEntity base class, which enables both individuals (UserAccount) and organizations (OrgAccount) to participate in accountability relationships.

Key Characteristics:

  • Both UserAccount and OrgAccount inherit from AccountableEntity

  • Enables flexible many-to-many relationships through AccountabilityMatrix

  • Supports role-based accountability (Employee, Candidate, Contractor, etc.)

  • Provides foundation for organizational hierarchy and reporting structures


👤 UserAccount Domain Model

Purpose:

UserAccount represents the canonical person identity, holding all personal information that is shared across different roles (Employee, Candidate, Contractor, etc.).

Domain Model Structure:

Key Design Principles:

  1. Composition Over Inheritance:

    • UserAccount contains personal information

    • Role-specific entities (Employee, Candidate) compose UserAccount via UserAccountId

    • Each role entity retains only its specific fields

  2. Single Source of Truth:

    • Personal information (name, email, phone, address) is stored once in UserAccount

    • Role entities reference UserAccount via foreign key

    • Eliminates data duplication and inconsistency

  3. Multi-Role Support:

    • One UserAccount can have multiple role entities (Employee, Candidate, etc.)

    • Each role entity has its own specific properties

    • Roles are independent and can coexist


🏢 OrgAccount Domain Model

Purpose:

OrgAccount represents organizational units in the hierarchy (Company, Division, Department, Team, etc.). It enables organizational structure management and accountability relationships.

Domain Model Structure:

OrgAccountType Enum:

Key Use Cases:

  1. Vendor Organizations:

    • Vendors have one OrgAccount representing the vendor company

    • Vendor name comes from OrgAccount.Name

    • Enables vendor lookup and management

  2. Department Hierarchy:

    • Companies contain Divisions

    • Divisions contain Departments

    • Departments contain Teams

    • Supports flexible organizational structures

  3. Cost Centers:

    • Financial tracking units

    • Can be associated with departments or projects

    • Enables budget and cost allocation


🔗 AccountabilityMatrix Domain Model

Purpose:

AccountabilityMatrix provides a flexible relationship system between any two AccountableEntity instances (UserAccount or OrgAccount), enabling complex organizational structures, reporting relationships, and responsibility assignments.

Domain Model Structure:

AccountabilityMatrixType Enum:

Key Relationship Patterns:

1. Reporting Relationships (Employee → Manager):

2. Organizational Assignment (Employee → Department):

3. Management Relationships (Manager → Department):

4. Approval Relationships (Director → Department):


🏗️ Organizational Hierarchy Implementation

1. Hierarchical Structure Example:

2. Implementation Pattern:

While OrgAccount doesn't have a direct ParentOrgId in the current implementation, hierarchical relationships can be managed through AccountabilityMatrix:

3. Querying Organizational Hierarchy:


👥 User-Role-Organization Relationships

1. Employee Assignment Pattern:

2. Manager-Department Relationship:

3. Querying User Relationships:


🎯 Use Cases and Examples

1. Vendor-OrgAccount Relationship:

2. Candidate Creation with Vendor Referral:

3. Organizational Approval Workflow:


📊 Benefits of This Architecture

1. Unified Accountability System:

  • Both UserAccount and OrgAccount participate in accountability matrices

  • Clear relationships between individuals and organizations

  • Flexible reporting structures

2. Clean Separation of Concerns:

  • UserAccount: Personal information and authentication

  • OrgAccount: Organizational structure and hierarchy

  • Role Entities: Role-specific information (Employee, Candidate, etc.)

  • AccountabilityMatrix: Relationship management

3. Flexible Relationships:

  • Employees can belong to multiple organizations (matrix organizations)

  • Clear manager-subordinate relationships

  • Organizational hierarchy support

  • Approval chain management

4. Scalability:

  • Easy to add new role types (Contractor, Vendor, etc.)

  • Support for complex organizational structures

  • Future-proof for additional accountability types

  • Extensible for new relationship types

5. Data Consistency:

  • Single source of truth for personal information

  • No data duplication across role entities

  • Consistent organizational structure management


🔄 Integration with Recruitment Workflows

1. Job Posting Department Assignment:

  • Job postings can be associated with departments via OrgAccount

  • Enables filtering and reporting by organizational unit

  • Supports department-specific approval workflows

2. Candidate-Organization Relationships:

  • Candidates can be associated with vendors via VendorReferral

  • Vendor information comes from OrgAccount

  • Enables vendor performance tracking

3. Employee Referral Tracking:

  • Employee referrals link employees (via UserAccount) to candidates

  • Enables referral source tracking

  • Supports referral bonus management

4. Approval Workflows:

  • Multi-level approvals based on organizational hierarchy

  • Manager → Director → VP → CEO approval chains

  • Department-specific approval rules


🚀 Implementation Summary

This organizational structure and accountability matrix design provides:

  • Unified System: All entities participate in accountability matrices

  • Clean Architecture: Clear separation between personal, organizational, and role-specific data

  • Flexible Relationships: Support for complex organizational structures and reporting hierarchies

  • Scalable Design: Easy to add new user types, organizational entities, and relationship types

  • Enterprise-Grade: Supports matrix organizations, multiple roles, and complex approval workflows

The AccountableEntity framework provides a robust foundation for managing both individual users and organizational structures while maintaining clear accountability relationships throughout the recruitment application.


This design showcases how the Flexbase framework's accountability system enables flexible, scalable organizational structure management with minimal complexity while maintaining enterprise-grade quality and consistency.

Last updated