Skip to content

Auto Assignment Engine

Intelligent driver and zone assignment suggestions.

Features

  • Driver scoring based on distance, workload, shift status, zone permissions, fairness
  • Zone scoring based on utilization, compatibility, distance from gates, congestion
  • Three modes: Off, Suggest (show recommendations), Auto (pre-fill form)
  • Non-destructive: Only provides suggestions, never auto-saves assignments
  • Admin-configurable settings
  • Integration with shipment creation workflow

Permissions

  • Admin: Full access to settings and suggestions
  • Others: Read-only access to suggestions

Database Schema

Tables

  • auto_assign_settings: Auto-assignment mode settings

Key Functions

  • scoreDriver(driver, shipment): Score driver for shipment
  • scoreZone(zone, shipment): Score zone for shipment
  • getBestDriver(shipment, tenant_id): Get best driver suggestion
  • getBestZone(shipment, tenant_id): Get best zone suggestion
  • getAutoAssignSettings(): Get current settings
  • updateAutoAssignSettings(): Update settings

Assignment Engine Scoring Logic

mermaid
flowchart TD
    A[New Shipment Created] --> B[Get Available Drivers]
    B --> C[Get Available Zones]
    C --> D[Score Each Driver]
    C --> E[Score Each Zone]
    
    D --> D1[Distance Score]
    D --> D2[Workload Score]
    D --> D3[Shift Status Score]
    D --> D4[Zone Permissions Score]
    D --> D5[Fairness Score]
    D1 --> D6[Calculate Driver Total Score]
    D2 --> D6
    D3 --> D6
    D4 --> D6
    D5 --> D6
    
    E --> E1[Utilization Score]
    E --> E2[Compatibility Score]
    E --> E3[Distance from Gates Score]
    E --> E4[Congestion Score]
    E1 --> E5[Calculate Zone Total Score]
    E2 --> E5
    E3 --> E5
    E4 --> E5
    
    D6 --> F[Rank Drivers]
    E5 --> G[Rank Zones]
    F --> H[Best Driver Suggestion]
    G --> I[Best Zone Suggestion]
    H --> J[Return Suggestions]
    I --> J
    
    style A fill:#3b82f6,color:#fff
    style D6 fill:#10b981,color:#fff
    style E5 fill:#f59e0b,color:#fff
    style J fill:#8b5cf6,color:#fff

Integration

  • Shipment Creation: Provides suggestions during shipment creation
  • AI Module: Uses existing AI scoring logic
  • Zone Permissions: Considers driver zone permissions in scoring

Released under Commercial License