From ed021947adeda82d484a8e0ee0463687154a9c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Wed, 1 Apr 2026 00:42:43 +0200 Subject: [PATCH] test(api): add assistant timeline allocation mutation helpers --- ...meline-allocation-mutation-test-helpers.ts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 packages/api/src/__tests__/assistant-tools-timeline-allocation-mutation-test-helpers.ts diff --git a/packages/api/src/__tests__/assistant-tools-timeline-allocation-mutation-test-helpers.ts b/packages/api/src/__tests__/assistant-tools-timeline-allocation-mutation-test-helpers.ts new file mode 100644 index 0000000..106ad31 --- /dev/null +++ b/packages/api/src/__tests__/assistant-tools-timeline-allocation-mutation-test-helpers.ts @@ -0,0 +1,55 @@ +export const baseAvailability = { + monday: 8, + tuesday: 8, + wednesday: 8, + thursday: 8, + friday: 8, + saturday: 0, + sunday: 0, +}; + +export function buildBaseProject() { + return { + id: "project_1", + name: "Gelddruckmaschine", + shortCode: "GDM", + status: "ACTIVE", + responsiblePerson: null, + }; +} + +export function buildBaseResource(id = "resource_1") { + return { + id, + eid: id === "resource_1" ? "E-001" : `E-${id}`, + displayName: id === "resource_1" ? "Alice" : `Resource ${id}`, + lcrCents: 5000, + availability: { + ...baseAvailability, + }, + }; +} + +export function buildBaseAssignment() { + return { + id: "assignment_1", + demandRequirementId: null, + resourceId: "resource_1", + projectId: "project_1", + startDate: new Date("2026-03-16"), + endDate: new Date("2026-03-20"), + hoursPerDay: 4, + percentage: 50, + role: "Compositor", + roleId: "role_comp", + dailyCostCents: 20000, + status: "PROPOSED", + metadata: {}, + createdAt: new Date("2026-03-13"), + updatedAt: new Date("2026-03-13"), + resource: buildBaseResource(), + project: { id: "project_1", name: "Project One", shortCode: "PRJ" }, + roleEntity: { id: "role_comp", name: "Compositor", color: "#111111" }, + demandRequirement: null, + }; +}