feat(planning): ship holiday-aware planning and assistant upgrades
This commit is contained in:
@@ -290,4 +290,83 @@ describe("timeline allocation entry resolution", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("returns resolved holiday overlays for assigned resources", async () => {
|
||||
const db = {
|
||||
demandRequirement: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
assignment: {
|
||||
findMany: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: "assignment_1",
|
||||
kind: "assignment",
|
||||
resourceId: "resource_by",
|
||||
projectId: "project_1",
|
||||
startDate: new Date("2026-01-01"),
|
||||
endDate: new Date("2026-01-31"),
|
||||
hoursPerDay: 8,
|
||||
status: AllocationStatus.CONFIRMED,
|
||||
metadata: {},
|
||||
project: {
|
||||
id: "project_1",
|
||||
name: "Project One",
|
||||
shortCode: "PRJ",
|
||||
status: "ACTIVE",
|
||||
startDate: new Date("2026-01-01"),
|
||||
endDate: new Date("2026-03-31"),
|
||||
orderType: "CHARGEABLE",
|
||||
clientId: null,
|
||||
},
|
||||
resource: {
|
||||
id: "resource_by",
|
||||
displayName: "Alice",
|
||||
eid: "E-001",
|
||||
chapter: null,
|
||||
},
|
||||
},
|
||||
]),
|
||||
},
|
||||
resource: {
|
||||
findMany: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: "resource_by",
|
||||
countryId: "country_de",
|
||||
federalState: "BY",
|
||||
metroCityId: null,
|
||||
country: { code: "DE" },
|
||||
metroCity: null,
|
||||
},
|
||||
]),
|
||||
},
|
||||
project: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
holidayCalendar: {
|
||||
findMany: vi.fn().mockResolvedValue([]),
|
||||
},
|
||||
country: {
|
||||
findUnique: vi.fn(),
|
||||
},
|
||||
metroCity: {
|
||||
findUnique: vi.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
const caller = createManagerCaller(db);
|
||||
const overlays = await caller.getHolidayOverlays({
|
||||
startDate: new Date("2026-01-01"),
|
||||
endDate: new Date("2026-01-31"),
|
||||
});
|
||||
|
||||
expect(overlays).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
resourceId: "resource_by",
|
||||
type: "PUBLIC_HOLIDAY",
|
||||
note: "Heilige Drei Könige",
|
||||
}),
|
||||
]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user