Merge branch 'worktree-agent-a2939317'

This commit is contained in:
2026-04-09 14:44:51 +02:00
14 changed files with 48 additions and 48 deletions
@@ -0,0 +1,67 @@
import { AllocationStatus, UpdateAllocationSchema } from "@capakraken/shared";
export { toIsoDate, round1, averagePerWorkingDay } from "@capakraken/shared";
import { z } from "zod";
import { PROJECT_BRIEF_SELECT, RESOURCE_BRIEF_SELECT, ROLE_BRIEF_SELECT } from "../../db/selects.js";
export const DEMAND_INCLUDE = {
project: { select: PROJECT_BRIEF_SELECT },
roleEntity: { select: ROLE_BRIEF_SELECT },
assignments: {
include: {
resource: { select: RESOURCE_BRIEF_SELECT },
project: { select: PROJECT_BRIEF_SELECT },
roleEntity: { select: ROLE_BRIEF_SELECT },
},
},
} as const;
export const ASSIGNMENT_INCLUDE = {
resource: { select: RESOURCE_BRIEF_SELECT },
project: { select: PROJECT_BRIEF_SELECT },
roleEntity: { select: ROLE_BRIEF_SELECT },
demandRequirement: {
select: {
id: true,
projectId: true,
startDate: true,
endDate: true,
hoursPerDay: true,
percentage: true,
role: true,
roleId: true,
headcount: true,
status: true,
},
},
} as const;
export type AllocationListFilters = {
projectId?: string | undefined;
resourceId?: string | undefined;
status?: AllocationStatus | undefined;
};
export type AllocationEntryUpdateInput = z.infer<typeof UpdateAllocationSchema>;
export type AssignmentResolutionInput = {
assignmentId?: string | undefined;
resourceId?: string | undefined;
projectId?: string | undefined;
startDate?: Date | undefined;
endDate?: Date | undefined;
selectionMode?: "WINDOW" | "EXACT_START" | undefined;
excludeCancelled?: boolean | undefined;
};
export type CreateDemandDraftInput = {
projectId: string;
role?: string | undefined;
roleId?: string | undefined;
headcount?: number | undefined;
hoursPerDay: number;
startDate: Date;
endDate: Date;
budgetCents?: number | undefined;
metadata?: Record<string, unknown> | undefined;
};