CREATE OR REPLACE reporting.fn_inc_dashboard (supersedes 09) adding
metrics.by_owner — a closures-by-engineer leaderboard over the windowed closed
set: array of { owner, closed, breached, avg_mttr_min } sorted desc. owner is
CASE-NORMALIZED (initcap(lower(...))) to merge the offline closing system's
mixed-case duplicates (observed 102 -> 58 distinct engineers; e.g.
'Elikana Mabonga' + 'ELIKANA MABONGA' -> one). owner on the open/closed GeoJSON
features is normalized the same way so the leaderboard and per-ticket drill-down
agree. Everything else unchanged; the dashboard_api route is a passthrough so no
API change is needed. Validated in a rolled-back tx against prod.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| 01_tickets_schema.sql | ||
| 02_import_meta.sql | ||
| 03_inc_columns.sql | ||
| 04_inc_latlng.sql | ||
| 05_inc_geography.sql | ||
| 06_inc_mttr_minutes.sql | ||
| 07_inc_drop_service_type.sql | ||
| 08_inc_open_sla_view.sql | ||
| 09_inc_dashboard_fn.sql | ||
| 10_inc_history_capture.sql | ||
| 12_inc_dashboard_by_owner.sql | ||