feat(api): include project health in dashboard detail
This commit is contained in:
@@ -257,6 +257,42 @@ describe("dashboard procedure support", () => {
|
||||
watchlist: [],
|
||||
month: "2026-03",
|
||||
});
|
||||
vi.mocked(getDashboardProjectHealth).mockResolvedValue([
|
||||
{
|
||||
id: "project_1",
|
||||
projectName: "Apollo",
|
||||
shortCode: "APO",
|
||||
status: "ACTIVE",
|
||||
clientId: "client_1",
|
||||
clientName: "Acme",
|
||||
budgetHealth: 62,
|
||||
staffingHealth: 55,
|
||||
timelineHealth: 48,
|
||||
compositeScore: 54,
|
||||
budgetUtilizationPercent: 81,
|
||||
remainingBudgetCents: 45_000,
|
||||
demandHeadcountTotal: 5,
|
||||
demandHeadcountFilled: 3,
|
||||
demandHeadcountOpen: 2,
|
||||
demandRequirementCount: 2,
|
||||
plannedEndDate: new Date("2026-07-31T00:00:00.000Z"),
|
||||
daysUntilEndDate: 138,
|
||||
timelineStatus: "DUE_SOON",
|
||||
derivation: {
|
||||
periodStart: "2026-03-01",
|
||||
periodEnd: "2026-06-30",
|
||||
calendarContextCount: 1,
|
||||
holidayAwareAssignmentCount: 3,
|
||||
fallbackAssignmentCount: 0,
|
||||
baseSpentCents: 170_000,
|
||||
adjustedSpentCents: 165_000,
|
||||
publicHolidayDayEquivalent: 1,
|
||||
publicHolidayCostDeductionCents: 5_000,
|
||||
absenceDayEquivalent: 0.5,
|
||||
absenceCostDeductionCents: 3_000,
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
try {
|
||||
const result = await getDashboardDetail(createContext(), { section: "all" });
|
||||
@@ -354,6 +390,33 @@ describe("dashboard procedure support", () => {
|
||||
},
|
||||
},
|
||||
],
|
||||
projectHealth: [
|
||||
{
|
||||
project: "Apollo (APO)",
|
||||
status: "ACTIVE",
|
||||
overall: 54,
|
||||
rating: "at_risk",
|
||||
budget: 62,
|
||||
staffing: 55,
|
||||
timeline: 48,
|
||||
timelineStatus: "DUE_SOON",
|
||||
daysUntilEndDate: 138,
|
||||
demandHeadcountOpen: 2,
|
||||
explainability: {
|
||||
demandHeadcountTotal: 5,
|
||||
demandHeadcountFilled: 3,
|
||||
demandHeadcountOpen: 2,
|
||||
demandRequirementCount: 2,
|
||||
plannedEndDate: "2026-07-31T00:00:00.000Z",
|
||||
budgetUtilizationPercent: 81,
|
||||
remainingBudgetCents: 45_000,
|
||||
calendarContextCount: 1,
|
||||
holidayAwareAssignmentCount: 3,
|
||||
publicHolidayCostDeductionCents: 5_000,
|
||||
absenceCostDeductionCents: 3_000,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(getDashboardChargeabilityOverview).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user