feat(api): expose demand pipeline explainability
This commit is contained in:
@@ -231,6 +231,15 @@ describe("assistant dashboard tools detail aggregation", () => {
|
|||||||
allocatedHours: 120,
|
allocatedHours: 120,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
explainability: {
|
||||||
|
periodStart: "2026-01-01",
|
||||||
|
periodEnd: "2026-06-30",
|
||||||
|
periodWorkingHoursBase: 1040,
|
||||||
|
requiredHours: 2080,
|
||||||
|
fillPct: 50,
|
||||||
|
demandSource: "DEMAND_REQUIREMENTS",
|
||||||
|
calendarContextCount: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
chargeabilityByChapter: [
|
chargeabilityByChapter: [
|
||||||
|
|||||||
@@ -202,7 +202,16 @@ describe("dashboard procedure support", () => {
|
|||||||
requiredFTEs: 3,
|
requiredFTEs: 3,
|
||||||
resourceCount: 1,
|
resourceCount: 1,
|
||||||
allocatedHours: 80,
|
allocatedHours: 80,
|
||||||
derivation: { calendarLocations: [{ countryCode: "DE", countryName: "Germany" }] },
|
derivation: {
|
||||||
|
periodStart: "2026-03-01",
|
||||||
|
periodEnd: "2026-06-30",
|
||||||
|
periodWorkingHoursBase: 672,
|
||||||
|
requiredHours: 2016,
|
||||||
|
requiredFTEs: 3,
|
||||||
|
fillPct: 40,
|
||||||
|
demandSource: "DEMAND_REQUIREMENTS",
|
||||||
|
calendarLocations: [{ countryCode: "DE", countryName: "Germany" }],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -251,6 +260,15 @@ describe("dashboard procedure support", () => {
|
|||||||
allocatedResources: 1,
|
allocatedResources: 1,
|
||||||
allocatedHours: 80,
|
allocatedHours: 80,
|
||||||
calendarLocations: [{ countryCode: "DE", countryName: "Germany" }],
|
calendarLocations: [{ countryCode: "DE", countryName: "Germany" }],
|
||||||
|
explainability: {
|
||||||
|
periodStart: "2026-03-01",
|
||||||
|
periodEnd: "2026-06-30",
|
||||||
|
periodWorkingHoursBase: 672,
|
||||||
|
requiredHours: 2016,
|
||||||
|
fillPct: 40,
|
||||||
|
demandSource: "DEMAND_REQUIREMENTS",
|
||||||
|
calendarContextCount: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
chargeabilityByChapter: [
|
chargeabilityByChapter: [
|
||||||
|
|||||||
@@ -791,9 +791,17 @@ describe("dashboard router", () => {
|
|||||||
requiredFTEs: 4,
|
requiredFTEs: 4,
|
||||||
resourceCount: 2,
|
resourceCount: 2,
|
||||||
derivation: {
|
derivation: {
|
||||||
|
periodStart: "2026-01-01",
|
||||||
|
periodEnd: "2026-06-30",
|
||||||
|
periodWorkingHoursBase: 1040,
|
||||||
|
requiredHours: 2080,
|
||||||
|
requiredFTEs: 4,
|
||||||
|
fillPct: 50,
|
||||||
|
demandSource: "DEMAND_REQUIREMENTS",
|
||||||
calendarLocations: [
|
calendarLocations: [
|
||||||
{
|
{
|
||||||
countryCode: "DE",
|
countryCode: "DE",
|
||||||
|
countryName: "Germany",
|
||||||
federalState: "BY",
|
federalState: "BY",
|
||||||
metroCityName: "Augsburg",
|
metroCityName: "Augsburg",
|
||||||
resourceCount: 2,
|
resourceCount: 2,
|
||||||
@@ -851,12 +859,22 @@ describe("dashboard router", () => {
|
|||||||
calendarLocations: [
|
calendarLocations: [
|
||||||
{
|
{
|
||||||
countryCode: "DE",
|
countryCode: "DE",
|
||||||
|
countryName: "Germany",
|
||||||
federalState: "BY",
|
federalState: "BY",
|
||||||
metroCityName: "Augsburg",
|
metroCityName: "Augsburg",
|
||||||
resourceCount: 2,
|
resourceCount: 2,
|
||||||
allocatedHours: 120,
|
allocatedHours: 120,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
explainability: {
|
||||||
|
periodStart: "2026-01-01",
|
||||||
|
periodEnd: "2026-06-30",
|
||||||
|
periodWorkingHoursBase: 1040,
|
||||||
|
requiredHours: 2080,
|
||||||
|
fillPct: 50,
|
||||||
|
demandSource: "DEMAND_REQUIREMENTS",
|
||||||
|
calendarContextCount: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
chargeabilityByChapter: [
|
chargeabilityByChapter: [
|
||||||
|
|||||||
@@ -276,6 +276,17 @@ export async function getDashboardDetail(ctx: DashboardProcedureContext, input:
|
|||||||
allocatedResources: row.resourceCount,
|
allocatedResources: row.resourceCount,
|
||||||
allocatedHours: row.allocatedHours,
|
allocatedHours: row.allocatedHours,
|
||||||
calendarLocations: row.derivation?.calendarLocations ?? [],
|
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)
|
.filter((row) => row.needed > 0)
|
||||||
.sort((left, right) => right.needed - left.needed)
|
.sort((left, right) => right.needed - left.needed)
|
||||||
|
|||||||
Reference in New Issue
Block a user