feat(api): expose demand pipeline explainability

This commit is contained in:
2026-03-31 23:24:14 +02:00
parent 92e94f43a7
commit fc12a5739e
4 changed files with 57 additions and 1 deletions
@@ -276,6 +276,17 @@ export async function getDashboardDetail(ctx: DashboardProcedureContext, input:
allocatedResources: row.resourceCount,
allocatedHours: row.allocatedHours,
calendarLocations: row.derivation?.calendarLocations ?? [],
explainability: row.derivation
? {
periodStart: row.derivation.periodStart,
periodEnd: row.derivation.periodEnd,
periodWorkingHoursBase: row.derivation.periodWorkingHoursBase,
requiredHours: row.derivation.requiredHours,
fillPct: row.derivation.fillPct,
demandSource: row.derivation.demandSource,
calendarContextCount: row.derivation.calendarLocations.length,
}
: null,
}))
.filter((row) => row.needed > 0)
.sort((left, right) => right.needed - left.needed)