refactor(api): extract timeline shift mutation routing

This commit is contained in:
2026-03-31 18:15:38 +02:00
parent 7b4c659922
commit 72b13dfaba
4 changed files with 110 additions and 33 deletions
@@ -0,0 +1,21 @@
import { PermissionKey, ShiftProjectSchema } from "@capakraken/shared";
import { managerProcedure, requirePermission } from "../trpc.js";
import { timelineAllocationMutationProcedures } from "./timeline-allocation-mutations.js";
import { applyTimelineProjectShiftMutation } from "./timeline-shift-router-support.js";
export const timelineMutationProcedures = {
...timelineAllocationMutationProcedures,
applyShift: managerProcedure
.input(ShiftProjectSchema)
.mutation(async ({ ctx, input }) => {
requirePermission(ctx, PermissionKey.MANAGE_ALLOCATIONS);
return applyTimelineProjectShiftMutation({
db: ctx.db,
projectId: input.projectId,
newStartDate: input.newStartDate,
newEndDate: input.newEndDate,
});
}),
};