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
UserAccountandOrgAccountinherit fromAccountableEntityEnables flexible many-to-many relationships through
AccountabilityMatrixSupports 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:
Composition Over Inheritance:
UserAccountcontains personal informationRole-specific entities (
Employee,Candidate) composeUserAccountviaUserAccountIdEach role entity retains only its specific fields
Single Source of Truth:
Personal information (name, email, phone, address) is stored once in
UserAccountRole entities reference
UserAccountvia foreign keyEliminates data duplication and inconsistency
Multi-Role Support:
One
UserAccountcan 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:
Vendor Organizations:
Vendors have one
OrgAccountrepresenting the vendor companyVendor name comes from
OrgAccount.NameEnables vendor lookup and management
Department Hierarchy:
Companies contain Divisions
Divisions contain Departments
Departments contain Teams
Supports flexible organizational structures
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
UserAccountandOrgAccountparticipate in accountability matricesClear 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
OrgAccountEnables filtering and reporting by organizational unit
Supports department-specific approval workflows
2. Candidate-Organization Relationships:
Candidates can be associated with vendors via
VendorReferralVendor information comes from
OrgAccountEnables vendor performance tracking
3. Employee Referral Tracking:
Employee referrals link employees (via
UserAccount) to candidatesEnables 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