Skip to content

Approval Workflows Business Logic

The approval system controls how time entries, leave requests, and other submissions get reviewed and approved by managers within the Stratpoint Timesheet Application.

How Approvals Work

For Employees: 1. Submit time entries, leave requests, or other items 2. System automatically routes to your assigned approver 3. Wait for approval notification 4. Fix and resubmit if rejected

For Managers: 1. Receive notifications of pending approvals 2. Review submissions in your approval dashboard 3. Approve, reject, or request changes 4. Can process multiple items at once for efficiency

System Features: - Automatic routing based on organizational hierarchy - Bulk approval capabilities for efficiency - Standardized rejection reasons - Complete audit trail of all decisions - Escalation when approvers are unavailable

Approval Process Details

Simple Workflow

flowchart TD
    A[Employee Submits] --> B[Goes to Manager]
    B --> C{Manager Reviews}
    C -->|✅ Approve| D[Item Approved]
    C -->|❌ Reject| E[Back to Employee]
    C -->|📝 Bulk Action| F[Multiple Items]
    F --> D

Who Approves What

  • Time Entries: Your direct manager or project manager
  • Leave Requests: Manager with leave approval permissions
  • Special Items: May require higher-level approval

Manager Tools

  • Individual Review: Check each item one by one
  • Bulk Actions: Approve/reject multiple items at once
  • Rejection Reasons: Standardized categories for consistency
  • Notes: Add explanations for rejected items

Common Rejection Reasons

  1. Employee on Leave - You were on vacation/sick that day
  2. Wrong Project Code - Time should be charged to a different project
  3. Other Issues - Various business reasons with detailed explanation

What Happens After

  • Approved: Item is finalized and counts toward records
  • Rejected: You get notified to fix and resubmit
  • System tracks everything for audit and compliance

Organizational Hierarchy

How the System Determines Your Approver

  1. Direct Manager: Usually your immediate supervisor
  2. Project Manager: For project-specific items
  3. Department Head: For special cases or escalation
  4. System Backup: Automatic fallback if primary approver unavailable

Career Mentorship Integration

  • Your career mentor is often your primary approver
  • Mentors can approve time entries and leave requests
  • System tracks mentor-mentee relationships
  • Used for performance and development tracking

Approval Authority

  • Managers must have specific permissions to approve different types of items
  • System prevents unauthorized approvals
  • Higher-level items may require multiple approvals
  • Emergency override capabilities for urgent situations

Leave Approval Process

How Leave Requests Work

flowchart TD
    A[Employee Requests Leave] --> B[System Checks Balance]
    B --> C{Enough Leave?}
    C -->|Yes| D[Goes to Manager]
    C -->|No| E[Balance Error]
    D --> F[Manager Approves/Rejects]
    F --> G[Leave Balance Updated]

Leave-Specific Rules

  • Balance Validation: System automatically checks if you have enough leave days
  • Calendar Integration: Prevents conflicts with work schedules
  • Manager Approval: Same process as regular time entries
  • Balance Adjustment: Approved leave automatically deducted from your balance

Special Leave Considerations

  • Different leave types may require different approvers
  • Some leave requires advance notice
  • Emergency leave may have expedited approval process
  • System tracks accruals and usage for compliance

Escalation and Special Cases

When Approvals Get Escalated

  1. Approver Unavailable: Automatically routes to backup approver
  2. Permission Issues: Escalates to someone with proper authority
  3. Conflict of Interest: Prevents self-approval scenarios
  4. Time-Based: Auto-escalates if not handled within deadlines

Administrative Overrides

  • Super Users: Can approve across departments for special situations
  • System Admins: Can force approvals for system maintenance
  • Emergency Procedures: Expedited approval for urgent business needs
  • All overrides tracked for audit and compliance purposes

Backup Systems

  • Multiple approvers can be assigned for redundancy
  • Department heads serve as fallback approvers
  • Holiday/absence coverage automatically handled
  • System ensures approvals never get stuck

Business Rules and Timing

Important Deadlines

  • Submission Cutoffs: Time entries must be submitted by specific dates
  • Approval Deadlines: Managers must approve by payroll processing dates
  • Late Submissions: Require special approval and justification

Approval Timing

  • Most approvals can be done 24/7 through the system
  • Some special approvals may be restricted to business hours
  • Emergency approvals available for urgent business needs
  • Weekend/holiday approvals handled through automated routing

Delegation and Coverage

  • Temporary Delegation: Managers can delegate approval authority during absence
  • Project Coverage: Project-specific approval delegation available
  • Emergency Procedures: Automatic escalation when primary approver unavailable
  • Multiple Approvers: Some items may require multiple levels of approval

Reporting and Tracking

What Gets Tracked

  • All approval actions with timestamps and approver identification
  • Rejection reasons and explanations for audit purposes
  • Approval turnaround times for performance monitoring
  • Escalation events and reasons for process improvement

Manager Reports

  • Pending Approvals: What's waiting for your review
  • Team Performance: Approval patterns and compliance
  • Deficiency Reports: Missing or rejected submissions from your team
  • Historical Analysis: Trends and patterns over time

Compliance Features

  • Complete audit trail for regulatory requirements
  • Data retention policies automatically enforced
  • Export capabilities for external audits
  • Integration with HR and payroll systems

Technical Implementation Details

For developers and system administrators

Core API Endpoints

Approval Operations:

// Bulk approval/rejection
POST /api/v2/timelogs/changeStatus
{
  "id": "12345,12346,12347,12348",
  "status": "Approved"
}

// Rejection with business reasons
{
  "id": "12345,12346",
  "status": "Rejected",
  "rejectReasonType": "Re-classify to Other Charge Code",
  "note": {
    "note": "Please reclassify this work as internal training",
    "rejectReasonType": "Re-classify to Other Charge Code"
  }
}

Reporting Endpoints:

// Approver reports
POST /api/v2/users/getDeficiencySnapshotReportByApprover
POST /api/v2/timelogs/approverDetailedTaskReport

Permission-Based System

Core Concept: Unlike traditional role-based systems, Stratpoint uses numeric permission IDs to control approval capabilities.

Key Permissions: - Permission 103: Timelog approval authority - Permission 126: Can approve leave requests for others - Permission 72: Can view all user data (super approver) - Permission 134: Can activate/deactivate user access

Database Relationships

Approver Hierarchy:

// Primary hierarchy from User model
users.approverUser_id -> users.id (Career Mentor)

Approval Path Resolution: 1. Check direct approverUser_id relationship 2. If project-specific, check ProjectUser assignments 3. Validate approver has Permission 103 4. Fall back to department/business unit hierarchy if needed

Project-Specific Approvers:

-- Actual query pattern from codebase
SELECT pu.approverUser_id
FROM project_users pu
WHERE pu.user_id = ?
AND pu.project_id = ?
AND pu.isActive = 1

Escalation Logic

Automatic Escalation Conditions: 1. Approver has no Permission 103 2. Approver is inactive or unavailable 3. Conflict of interest (self-approval) 4. Time-based escalation (configurable)

Escalation Implementation:

// Pseudo-code from actual logic
if (!hasPermission($approver, 103)) {
    $escalatedApprover = getNextApproverInHierarchy($approver);
    if (!$escalatedApprover) {
        $escalatedApprover = getDepartmentHead($user);
    }
}

Mentor/Mentee Relationships

Career Mentorship: - Defined via approverUser_id field - Career mentors can approve mentee timelogs - Hierarchical escalation supported - Used in deficiency reporting and management

Technical Mentorship: - Defined via techMentorUserId field - Advisory role, not approval authority - Used for skill development tracking

Rejection Reason Implementation

Standard Rejection Types: 1. Employee on Leave - Used when employee was on official leave - Requires leave verification - May trigger leave balance adjustment

  1. Re-classify to Other Charge Code
  2. Work should be charged to different project/task
  3. Most common rejection reason
  4. Requires specific guidance in note

  5. Others

  6. Catch-all for other business reasons
  7. Requires detailed explanation in note
  8. May trigger escalation for review

Leave Approval Integration

Leave as Timelog Entries: Leave requests are actually timelog entries with special task types (isLeaveType = 1).

Leave-Specific Validation: - Balance checking via LeaveAdjustment records - Accrual validation based on employment history - Integration with calendar/scheduling systems

Performance and Scalability

Bulk Operations: - Bulk approval endpoints reduce database load - Batch processing for large approval volumes - Optimized queries for approval dashboard performance

Caching Strategy: - Approval hierarchy cached for performance - Permission checks cached per session - Dashboard data cached with refresh intervals

System Limits: - Maximum bulk operation size: 50 items - Rate limiting: 50 approval actions per minute - Timeout handling for long-running operations

Integration Architecture

NetSuite Integration: - Approved timelogs flow to NetSuite for billing - Rejection impacts financial reporting - Integration with project profitability analysis

Notification Systems: - Automated approval request notifications - Status change confirmations - Escalation alerts - Deadline reminders - Real-time dashboard updates

Audit and Compliance

Compliance Tracking: - All approval actions logged with timestamps - Approver identification recorded - Reason codes for all rejections - Integration with external audit systems

Data Retention: - Approval history maintained indefinitely - Supports regulatory compliance requirements - Export capabilities for external audits - Complete audit trail for business compliance

This approval workflow system is designed to handle enterprise-level approval volumes while maintaining strict business rules and comprehensive audit capabilities specific to Stratpoint's operational requirements.