Add Resource Planning: team capacity, utilisation, workload overview
Build & Auto-Repair / build (push) Has been cancelled
Build & Auto-Repair / build (push) Has been cancelled
- Migration 024: adds capacity_hours column to users (default 40h/week) - /api/resource-planning: aggregates hours from time_entries, open tasks, active projects per user with utilisation calculations - /resource-planning page: overview stats cards, per-member capacity bars with colour-coded status (green=available, yellow=busy, orange=near capacity, red=overloaded) - Sidebar: new Resources nav item (BarChart3 icon)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- ============================================================================
|
||||
-- Resource Planning — Team capacity, utilisation rates, availability
|
||||
-- ============================================================================
|
||||
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS capacity_hours DECIMAL(5,2) NOT NULL DEFAULT 40;
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_url TEXT;
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS password_encrypted TEXT;
|
||||
|
||||
-- Set default capacities for existing users
|
||||
UPDATE users SET capacity_hours = 40 WHERE capacity_hours IS NULL;
|
||||
@@ -88,5 +88,8 @@ BEGIN;
|
||||
\echo '=== Running 023_client_portal.sql (Client Portal) ==='
|
||||
\i ../../src/app/client-portal/database/020_client_portal.sql
|
||||
|
||||
\echo '=== Running 024_resource_planning.sql (Resource Planning) ==='
|
||||
\i 024_resource_planning.sql
|
||||
|
||||
\echo '=== Migration Complete ==='
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user