Employee Performance
Admin users can view employee performance metrics to understand workload distribution and efficiency.
Metrics
From analytics_employee_performance view:
struct EmployeePerformance: Codable, Identifiable {
let employeeName: String
let employeeId: String?
let ordersCompleted: Int
let avgFulfillmentSeconds: Double?
var avgFulfillmentMinutes: Double? // Computed: seconds / 60
}What’s Tracked
| Metric | Description |
|---|---|
| Orders Completed | Total orders this employee has completed |
| Avg Fulfillment Time | Average time from claimed_at to completed_at |
How Fulfillment Time Works
Fulfillment time is calculated from the timestamps on the order:
Fulfillment Time = completed_at - claimed_atThis measures the time from when a staff member claims an order to when it’s marked as completed (picked up by customer).
Data Source
The AnalyticsService.getEmployeePerformance() method queries the analytics_employee_performance database view, which aggregates data from the orders table using assigned_to to identify employees and profiles for employee names.