PAUMS v2.0 is a production-ready enterprise system that provides authoritative, audit-safe utilization reporting across multiple regions with heterogeneous data sources. The system has evolved from a basic dashboard to a hierarchy-driven capacity planning system with executive-grade reporting.
The system is built using FastAPI, MariaDB, and a lightweight HTML/JS frontend, with immutable snapshots as the core architectural principle.
The PAUMS database consists of 9 core tables that implement the dual-region, snapshot-based architecture. All tables use InnoDB engine with appropriate indexing for performance.
Stores audit trail for all system events including snapshot rebuilds, data uploads, and admin actions. Critical for compliance and traceability.
| Field | Type | Description |
|---|---|---|
| id | int(11) | Primary key, auto-increment |
| event_type | varchar(255) | Type of audit event |
| username | varchar(255) | User who performed the action |
Stores EMEA region allocation data. Contains monthly FTE allocation percentages that are converted to hours during snapshot creation.
Master employee table containing workforce data. Includes FTE defaults, region, and role classification information.
Core immutable snapshot table. Contains frozen monthly metrics at both organization and employee levels. This is the source of truth for all reporting.
Canonical project hierarchy table extracted from EMEA allocation files. Supports multi-level rollup reporting and drilldowns.
Staging table for raw APAC timesheet data imported from Clockify exports. Used for data validation before processing into timesheets.
employees (1) —— (many) timesheets
employees (1) —— (many) emea_allocations
employees (1) —— (many) monthly_snapshot (scope='EMPLOYEE')
projects (1) —— (many) timesheets
projects (1) —— (many) emea_allocations
project_hierarchy (1) —— (1) projects (via project_code)
| Enhancement | Description |
|---|---|
| Dual Region Calculation Model | APAC: Actual hours from timesheets, EMEA: FTE allocation percentages |
| Immutable Snapshot Layer | Monthly snapshots with controlled rebuild capability |
| Project Hierarchy System | Canonical hierarchy storage with multi-level rollup |
| Executive Reporting Engine | 6-page PDF reports with narrative + KPI layers |
| Role | Description | Capabilities |
|---|---|---|
| Admin | System administrator | Snapshot rebuild, uploads, exports, audit overrides |
| Viewer | Read-only user | Dashboards, reports, PDF exports |
| Executive | Leadership user | Executive summaries, narrative views |
Bearer <token>The monthly_snapshot table is the single source of truth for all reporting.
Represents workforce master data including region, job title, FTE defaults. Leadership classification via deterministic rules.
project_hierarchytimesheets tableemea_allocations tableallocation_pct × FTE hours| Metric | Definition | Source |
|---|---|---|
| Available Hours | FTE default hours | monthly_snapshot.available_hours |
| Utilized Hours | Billable hours excluding TPMO | monthly_snapshot.utilized_hours |
| TPMO Hours | Project code 27290 hours | monthly_snapshot.tpmo_hours |
| Billable Hours | All project hours (including TPMO) | monthly_snapshot.billable_hours |
Utilization % = (Utilized Hours / Available Hours) × 100
Billable % = (Billable Hours / Available Hours) × 100
TPMO % of Available = (TPMO Hours / Available Hours) × 100
Idle Hours = Available Hours − Utilized Hours
Leadership Definition:
1. job_title IN LEADERSHIP_TITLES
OR
2. full_name IN LEADERSHIP_NAME_EXCEPTIONS
All other employees → Project Managers
| Endpoint | Description | Version |
|---|---|---|
| /api/v1/dashboard/summary | Monthly KPIs and metrics | v1/v2 |
| /api/v1/dashboard/trends/exec/narrative | Executive narrative and alerts | v2 only |
| /api/v1/dashboard/yearly-summary | Yearly aggregated view | v2 only |
| Endpoint | Output | Purpose |
|---|---|---|
| /api/v1/reports/executive-summary/pdf | 6-page PDF report | Executive review |
| /api/v1/exports/yearly-csv | CSV export | Data analysis |
| /api/v1/exports/employee-drilldown | Excel format | Detailed review |
monthly_snapshot table| Symptom | Root Cause |
|---|---|
| "Cannot set properties of null" errors | HTML ID changed but JS references old ID |
| Executive KPIs stuck at "Loading…" | Narrative API failed or no data |
| Single green bar in APAC charts | Backend aggregating into "Billable Work" category |
-- Allocation validation (EMEA)
SELECT employee_id, year, month,
alloc_control,
SUM(allocation) AS summed
FROM emea_allocations
GROUP BY employee_id, year, month
HAVING ABS(alloc_control - SUM(allocation)) > 0.001;
-- Snapshot vs project mismatch detection
SELECT s.employee_id, s.year, s.month,
s.utilized_hours,
SUM(p.billable_hours + p.tpmo_hours) AS project_total
FROM monthly_snapshot s
JOIN employee_project_monthly p USING (employee_id, year, month)
GROUP BY s.employee_id, s.year, s.month
HAVING ABS(s.utilized_hours - project_total) > 0.01;
| File | Purpose | Status |
|---|---|---|
| dashboard.html | Main dashboard UI, charts, modals | ✅ Stable |
| dashboard.js | Dashboard controller, API calls | ✅ Stable |
| org_trend_chart.js | Org utilization trend chart | ✅ Existing |
| org_billable_tpmo_chart.js | Billable vs TPMO chart | ✅ Existing |
| File | Purpose | Status |
|---|---|---|
| dashboard_service.py | Monthly summaries, resource list | ✅ |
| dashboard_trends_service.py | Org & employee trends | ✅ |
| yearly_summary_service.py | Executive yearly aggregation | ✅ |
| data_health_service.py | Missing data / anomalies | ✅ |