feat(api): include skill gaps in dashboard detail

This commit is contained in:
2026-03-31 23:46:07 +02:00
parent 2de5a0eede
commit f2d511ebc8
5 changed files with 115 additions and 2 deletions
@@ -54,13 +54,13 @@ export const dashboardInsightsReportsToolDefinitions: ToolDef[] = withToolAccess
type: "function",
function: {
name: "get_dashboard_detail",
description: "Get detailed dashboard data: peak allocation times, top-value resources, demand pipeline, chargeability overview, and project health risks.",
description: "Get detailed dashboard data: peak allocation times, top-value resources, demand pipeline, chargeability overview, project health risks, and skill gap staffing pressure.",
parameters: {
type: "object",
properties: {
section: {
type: "string",
description: "Which section: peak_times, top_resources, demand_pipeline, chargeability_overview, project_health, or all",
description: "Which section: peak_times, top_resources, demand_pipeline, chargeability_overview, project_health, skill_gaps, or all",
},
},
},
@@ -477,6 +477,24 @@ export async function getDashboardDetail(ctx: DashboardProcedureContext, input:
}));
}
if (section === "all" || section === "skill_gaps") {
const skillGapSummary = await getDashboardSkillGapSummaryRead(ctx);
result.skillGaps = {
totalOpenPositions: skillGapSummary.totalOpenPositions,
roleGaps: skillGapSummary.roleGaps
.slice(0, 10)
.map((gap) => ({
role: gap.role,
gap: gap.gap,
needed: gap.needed,
filled: gap.filled,
fillRate: gap.fillRate,
})),
topSkillsInSupply: skillGapSummary.skillSupplyTop10.slice(0, 5),
resourcesByRole: skillGapSummary.resourcesByRole.slice(0, 5),
};
}
return result;
}