Skip to content

Workforce Management Business Logic

The workforce management system provides comprehensive employee lifecycle management within the Stratpoint Timesheet Application. It manages everything from hiring and onboarding through career development, promotions, and workforce planning, providing strategic human resource capabilities essential for organizational growth and talent management.

How Workforce Management Works

For HR Teams: 1. Manage complete employee lifecycle from hire to retirement 2. Track promotions, salary adjustments, and career progression 3. Maintain skill inventories and competency mapping 4. Monitor employment status changes and compliance 5. Generate workforce analytics and planning reports

For People Managers: 1. Review team composition and skill distribution 2. Plan career development and promotion paths 3. Identify skill gaps and training needs 4. Manage team assignments and resource allocation 5. Monitor employee performance and development

For Executive Leadership: 1. Access workforce analytics and strategic insights 2. Review organizational structure and reporting lines 3. Monitor talent costs and resource optimization 4. Plan workforce capacity and future hiring needs 5. Make strategic decisions based on workforce data

System Features: - Complete employee lifecycle management with audit trails - Sophisticated promotion and compensation tracking - Multi-dimensional skill and competency management - Employment status and compliance monitoring - Organizational hierarchy and reporting structure - Comprehensive workforce analytics and reporting

Employee Lifecycle Management

Employment Journey Framework

stateDiagram-v2
    [*] --> PreEmployment: Hired
    PreEmployment --> Employed: Start Date
    Employed --> Resigning: Resignation Notice
    Employed --> Inactive: Temporary Leave
    Resigning --> Resigned: End Date
    Inactive --> Employed: Return to Work
    Resigned --> [*]: Employment Ended

Employment Status Categories

  • Pre-Employment: Hired but not yet started
  • Employed: Active employee with full access
  • Inactive: Temporarily unavailable (leave, suspension)
  • Resigning: Notice period, transitioning out
  • Resigned: Employment ended, historical record

Employee Data Management

The system maintains comprehensive employee information:

Core Employee Data: - Personal Information: Name, contact details, identification - Employment Details: Start date, end date, employment type - Organizational Assignment: Business unit, reporting structure - Compensation: Current hourly cost, pay grade level - Position Information: Job title, skill requirements, level

Employment Type Classifications

  • Regular Employees: Full-time permanent staff
  • Project-Based: Contract employees for specific projects
  • Interns: Temporary learning positions
  • Consultants: External expertise and specialized roles
  • Part-Time: Reduced hour permanent positions

Career Development and Promotions

Promotion Management System

The system provides sophisticated promotion tracking:

Promotion Components: - Position Changes: New job titles and responsibilities - Compensation Adjustments: Salary and hourly cost changes - Effective Dates: When changes take effect - Job Family Progression: Career path advancement - Designation Updates: Level and rank progressions

Career Progression Framework

flowchart TD
    A[Performance Review] --> B[Promotion Consideration]
    B --> C[Position Evaluation]
    C --> D[Compensation Analysis]
    D --> E[Approval Process]
    E --> F[Promotion Effective]
    F --> G[System Updates]
    G --> H[Notification Distribution]

Promotion History Tracking

  • Complete Audit Trail: Every promotion recorded with timestamps
  • Cost Evolution: Historical salary and cost progression
  • Position Progression: Career path and advancement tracking
  • Effective Date Management: Precise timing of changes
  • Creator Attribution: Who initiated each promotion

Compensation Management

  • Encrypted Storage: Sensitive compensation data protected
  • Historical Tracking: Complete salary history maintenance
  • Effective Dating: Time-based compensation changes
  • Cost Analysis: Resource cost planning and budgeting
  • Performance Integration: Merit-based compensation adjustments

Skills and Competency Management

Skill Set Framework

The system maintains a comprehensive skill inventory:

Skill Categories: - Technical Skills: Programming, tools, technologies - Domain Expertise: Industry knowledge and specializations - Soft Skills: Communication, leadership, management - Certifications: Professional qualifications and credentials

Skill Assignment System

  • Primary Skills: Main competency areas for each employee
  • Secondary Skills: Additional capabilities and knowledge
  • Skill Levels: Proficiency ratings and experience levels
  • Skill Verification: Validation and assessment tracking

Competency Analytics

flowchart LR
    A[Skills Distribution] --> B[Technical: 45%]
    A --> C[Domain: 30%]
    A --> D[Leadership: 15%]
    A --> E[Certified: 10%]

    style A fill:#374151,stroke:#4b5563,color:#fff
    style B fill:#2563eb,stroke:#1e40af,color:#fff
    style C fill:#10b981,stroke:#059669,color:#fff
    style D fill:#f59e0b,stroke:#d97706,color:#fff
    style E fill:#8b5cf6,stroke:#7c3aed,color:#fff

Workforce Planning Applications

  • Resource Allocation: Matching skills to project needs
  • Training Planning: Identifying skill development requirements
  • Hiring Strategy: Understanding capability gaps
  • Cost Optimization: Skill-based resource costing
  • Team Formation: Optimal skill mix for projects

Organizational Structure

Hierarchical Management

The system supports complex organizational structures:

Organizational Dimensions: - Business Units: Major organizational divisions - Business Lines: Service offerings and specializations - Job Families: Career progression paths - Reporting Lines: Management and approval hierarchies

Position and Role Management

  • Position Definitions: Standardized job descriptions and requirements
  • Pay Grade Levels: Compensation bands and progression
  • Skill Requirements: Required and preferred competencies
  • Cost Standards: Standard hourly costs and billing rates

Mentorship and Development

  • Career Mentors: Professional development relationships
  • Technical Mentors: Skill development and guidance
  • Approval Hierarchies: Management and oversight structure
  • Development Planning: Career progression and growth paths

Employment Compliance and Monitoring

Status Monitoring

The system provides real-time employment status tracking:

Compliance Features: - Employment Date Validation: Start and end date management - Status Transitions: Proper workflow for status changes - Notification Systems: Alerts for important status changes - Audit Compliance: Complete history for regulatory requirements

Regularization Management

  • Cadet Programs: Probationary period tracking
  • Regularization Dates: Conversion to permanent status
  • Performance Milestones: Achievement tracking and validation
  • Automatic Processing: System-driven status updates

HR Analytics and Reporting

  • Headcount Analysis: Current and projected workforce size
  • Turnover Tracking: Resignation patterns and retention analysis
  • Skills Distribution: Competency mapping across organization
  • Cost Analysis: Workforce cost optimization and planning

Resource Planning and Optimization

Workforce Analytics

The system provides comprehensive workforce intelligence:

Key Metrics: - Utilization Rates: Employee productivity and efficiency - Skill Utilization: How skills are being deployed - Cost Per Skill: Economic analysis of different competencies - Bench Management: Available resources and capacity

Strategic Planning Support

  • Demand Forecasting: Future resource needs prediction
  • Supply Planning: Hiring and development requirements
  • Gap Analysis: Current vs. required capabilities
  • Investment Planning: Training and development priorities

Performance Management Integration

  • Individual Performance: Personal achievement tracking
  • Team Performance: Collective productivity metrics
  • Skill Development: Learning and growth progression
  • Career Planning: Professional development pathways

Technical Implementation Details

For developers and system administrators

Core API Endpoints

Employee Management:

// Employee lifecycle management
POST /api/v2/users
{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john.doe@company.com",
  "position_id": 15,
  "businessUnit_id": 2,
  "startDate": "2024-01-15",
  "employmentType_id": 1,
  "currentHourlyCost": "75.00"
}

// Employment status updates
PUT /api/v2/users/{id}/status
{
  "employmentStatus": "Resigned",
  "endDate": "2024-06-30",
  "reason": "Career advancement"
}

Promotion Management:

// Create promotion record
POST /api/v2/promotions
{
  "user_id": 123,
  "position_id": 20,
  "currentHourlyCost": "85.00",
  "hourlyCostEffectiveDate": "2024-07-01",
  "job_family_id": 3,
  "designation_id": 12,
  "paygradeLevel": "L4"
}

// Get promotion history
GET /api/v2/users/{id}/promotions

Skills Management:

// Assign skills to employee
POST /api/v2/users/{id}/skills
{
  "skill_set_id": 25,
  "is_primary": true,
  "proficiency_level": "Expert"
}

// Workforce skills analysis
POST /api/v2/analytics/workforce-skills
{
  "businessUnit_id": 2,
  "endDate": "2024-06-30",
  "groupBy": "job_level_category"
}

Database Schema

User Model Structure:

// Core employee information
'firstname' => 'First name (required)',
'midname' => 'Middle name (nullable)',
'lastname' => 'Last name (required)',
'email' => 'Email address (required, unique)',
'position_id' => 'Current position assignment (required)',
'businessUnit_id' => 'Business unit assignment (required)',
'businessLine_id' => 'Line of business (nullable)',
'startDate' => 'Employment start date (required)',
'endDate' => 'Employment end date (nullable)',
'employmentType_id' => 'Employment classification (required)',
'currentHourlyCost' => 'Current hourly cost (encrypted)',
'paygradeLevel' => 'Pay grade level (nullable)',
'regularizationDate' => 'Permanent status date (nullable)',
'isCadet' => 'Probationary status flag',
'isActive' => 'Active employment flag',
'approverUser_id' => 'Direct manager/mentor (nullable)',
'techMentorUserId' => 'Technical mentor (nullable)',
'designation_id' => 'Job designation (nullable)',
'job_family_id' => 'Career path (nullable)',
'capability_id' => 'Core capability area (nullable)'

Promotion Model:

// Promotion and advancement tracking
'user_id' => 'Employee ID (required)',
'position_id' => 'New position (required)',
'currentHourlyCost' => 'New hourly cost (encrypted)',
'hourlyCostEffectiveDate' => 'Effective date (required)',
'paygradeLevel' => 'New pay grade (nullable)',
'job_family_id' => 'Career family (nullable)',
'designation_id' => 'New designation (nullable)',
'createdByUser_id' => 'Who created promotion (required)',
'note' => 'Promotion notes (nullable)'

UserSkillSet Model:

// Employee skill assignments
'user_id' => 'Employee ID (required)',
'skill_set_id' => 'Skill identifier (required)',
'is_primary' => 'Primary skill flag (boolean)',
'proficiency_level' => 'Skill level (nullable)',
'last_verified' => 'Verification date (nullable)',
'certified' => 'Certification status (boolean)'

Employment Status Management

Status Determination Logic:

// Employment status calculation
public function getEmploymentStatus($user, $asOfDate)
{
    $today = $asOfDate ?? now()->format('Y-m-d');

    if (!$user->isActive) {
        return 'Inactive';
    }

    if ($user->endDate && $user->endDate < $today) {
        return 'Resigned';
    }

    if ($user->startDate > $today) {
        return 'Pre-Employment';
    }

    if ($user->endDate && $user->endDate <= date('Y-m-d', strtotime('+30 days'))) {
        return 'Resigning';
    }

    return 'Employed';
}

Status Transition Validation:

// Valid status transitions
private $validTransitions = [
    'Pre-Employment' => ['Employed', 'Resigned'],
    'Employed' => ['Inactive', 'Resigning', 'Resigned'],
    'Inactive' => ['Employed', 'Resigned'],
    'Resigning' => ['Resigned', 'Employed'],
    'Resigned' => [] // Terminal status
];

public function validateStatusTransition($fromStatus, $toStatus)
{
    return in_array($toStatus, $this->validTransitions[$fromStatus] ?? []);
}

Promotion History Tracking

Historical Cost Calculation:

// Get employee cost at specific date
public function getEmployeeCostAtDate($userId, $date)
{
    $promotion = Promotion::where('user_id', $userId)
        ->where('hourlyCostEffectiveDate', '<=', $date)
        ->orderBy('hourlyCostEffectiveDate', 'desc')
        ->orderBy('created_at', 'desc')
        ->first();

    if ($promotion) {
        return decryptCustom($promotion->currentHourlyCost);
    }

    // Fall back to user's current cost
    $user = User::find($userId);
    return decryptCustom($user->currentHourlyCost);
}

Promotion Analytics:

// Promotion trend analysis
public function getPromotionTrends($startDate, $endDate)
{
    return Promotion::selectRaw('
            DATE_FORMAT(hourlyCostEffectiveDate, "%Y-%m") as period,
            COUNT(*) as promotion_count,
            AVG(paygradeLevel) as average_level,
            job_family_id
        ')
        ->whereBetween('hourlyCostEffectiveDate', [$startDate, $endDate])
        ->groupBy('period', 'job_family_id')
        ->orderBy('period')
        ->get();
}

Skills and Competency Framework

Skill Analysis Queries:

// Workforce skills distribution
public function getSkillsDistribution($filters)
{
    $query = UserSkillSet::selectRaw('
            rss.name as skill_name,
            rss.type as skill_type,
            d.job_level_category,
            COUNT(*) as employee_count,
            AVG(CASE WHEN uss.is_primary = 1 THEN 1 ELSE 0 END) as primary_ratio
        ')
        ->leftJoin('resource_skill_sets as rss', 'rss.id', '=', 'user_skill_sets.skill_set_id')
        ->leftJoin('users as u', 'u.id', '=', 'user_skill_sets.user_id')
        ->leftJoin('designations as d', 'd.id', '=', 'u.designation_id')
        ->where('u.isActive', 1);

    if (isset($filters['businessUnit_id'])) {
        $query->where('u.businessUnit_id', $filters['businessUnit_id']);
    }

    return $query->groupBy('skill_set_id', 'job_level_category')
        ->orderBy('skill_name')
        ->get();
}

Skill Gap Analysis:

// Identify skill gaps for projects
public function analyzeSkillGaps($projectRequirements, $availableResources)
{
    $gaps = [];

    foreach ($projectRequirements as $requirement) {
        $available = $availableResources->where('skill_set_id', $requirement['skill_id'])
            ->where('proficiency_level', '>=', $requirement['required_level'])
            ->count();

        if ($available < $requirement['required_count']) {
            $gaps[] = [
                'skill_id' => $requirement['skill_id'],
                'required' => $requirement['required_count'],
                'available' => $available,
                'gap' => $requirement['required_count'] - $available
            ];
        }
    }

    return $gaps;
}

Organizational Structure Management

Hierarchy Navigation:

// Get organization hierarchy
public function getOrganizationHierarchy($rootUserId = null)
{
    $query = User::select([
            'id', 'firstname', 'lastname', 'position_id',
            'businessUnit_id', 'approverUser_id'
        ])
        ->where('isActive', 1);

    if ($rootUserId) {
        $query->where('approverUser_id', $rootUserId);
    }

    $users = $query->get();

    return $this->buildHierarchyTree($users, $rootUserId);
}

private function buildHierarchyTree($users, $parentId = null)
{
    $tree = [];

    foreach ($users as $user) {
        if ($user->approverUser_id == $parentId) {
            $user->children = $this->buildHierarchyTree($users, $user->id);
            $tree[] = $user;
        }
    }

    return $tree;
}

Performance Optimization

Query Optimization:

-- Optimized indexes for workforce queries
CREATE INDEX idx_users_employment_status
ON users (isActive, startDate, endDate);

CREATE INDEX idx_promotions_user_date
ON promotions (user_id, hourlyCostEffectiveDate DESC);

CREATE INDEX idx_user_skills_primary
ON user_skill_sets (user_id, is_primary, skill_set_id);

CREATE INDEX idx_users_business_unit
ON users (businessUnit_id, isActive);

Caching Strategy: - Employee hierarchy cached for 4 hours - Skills distribution cached for 1 hour - Promotion history cached for 24 hours - Organizational structure cached for 2 hours

Workforce Analytics Engine

Headcount Analytics:

// Workforce size and composition analysis
public function getWorkforceAnalytics($asOfDate, $filters = [])
{
    $baseQuery = User::selectRaw('
            COUNT(*) as total_headcount,
            businessUnit_id,
            employmentType_id,
            designation_id,
            AVG(TIMESTAMPDIFF(MONTH, startDate, ?)) as avg_tenure
        ', [$asOfDate])
        ->where('startDate', '<=', $asOfDate)
        ->where(function($q) use ($asOfDate) {
            $q->whereNull('endDate')
              ->orWhere('endDate', '>', $asOfDate);
        });

    if (isset($filters['businessUnit_id'])) {
        $baseQuery->whereIn('businessUnit_id', $filters['businessUnit_id']);
    }

    return $baseQuery->groupBy('businessUnit_id', 'employmentType_id', 'designation_id')
        ->get();
}

Cost Analysis:

// Workforce cost analysis with promotions
public function getWorkforceCostAnalysis($startDate, $endDate)
{
    return User::selectRaw('
            u.businessUnit_id,
            d.job_level_category,
            COUNT(*) as headcount,
            AVG(IFNULL(pr.currentHourlyCost, u.currentHourlyCost)) as avg_cost,
            SUM(IFNULL(pr.currentHourlyCost, u.currentHourlyCost) * 8 * 22) as monthly_cost
        ')
        ->leftJoin('designations as d', 'd.id', '=', 'u.designation_id')
        ->leftJoin('promotions as pr', function($join) use ($endDate) {
            $join->on('pr.user_id', '=', 'u.id')
                 ->where('pr.hourlyCostEffectiveDate', '<=', $endDate)
                 ->whereRaw('pr.id = (
                     SELECT id FROM promotions p2
                     WHERE p2.user_id = u.id
                     AND p2.hourlyCostEffectiveDate <= ?
                     ORDER BY p2.hourlyCostEffectiveDate DESC
                     LIMIT 1
                 )', [$endDate]);
        })
        ->where('u.isActive', 1)
        ->groupBy('u.businessUnit_id', 'd.job_level_category')
        ->get();
}

This comprehensive workforce management system provides end-to-end employee lifecycle management with sophisticated career development tracking, skills management, and strategic workforce planning capabilities essential for enterprise human resource operations.