feat(platform): checkpoint current implementation state

This commit is contained in:
2026-04-01 07:42:03 +02:00
parent 3e53471f05
commit 8c5be51251
125 changed files with 10269 additions and 17808 deletions
@@ -1,9 +1,17 @@
import type { PrismaClient } from "@capakraken/db";
import { emitAllocationUpdated } from "../sse/event-bus.js";
import {
emitAllocationCreated,
emitAllocationDeleted,
emitAllocationUpdated,
} from "../sse/event-bus.js";
import {
createTimelineBatchQuickAssignments,
createTimelineQuickAssignment,
} from "./timeline-allocation-assignment-procedure-support.js";
import {
carveTimelineAllocationRange,
extractTimelineAllocationFragment,
} from "./timeline-allocation-fragment-support.js";
import { applyTimelineInlineAllocationUpdate } from "./timeline-allocation-inline-support.js";
import { shiftTimelineAllocations } from "./timeline-allocation-procedure-support.js";
@@ -67,3 +75,68 @@ export async function applyTimelineAllocationBatchShiftMutation(
) {
return shiftTimelineAllocations(db, input);
}
export async function carveTimelineAllocationRangeMutation(input: {
db: PrismaClient;
allocationId: string;
startDate: Date;
endDate: Date;
}) {
const result = await carveTimelineAllocationRange({
db: input.db,
allocationId: input.allocationId,
startDate: input.startDate,
endDate: input.endDate,
});
for (const allocationId of result.updatedAllocationIds) {
emitAllocationUpdated({
id: allocationId,
projectId: result.projectId,
resourceId: result.resourceId,
});
}
for (const allocationId of result.createdAllocationIds) {
emitAllocationCreated({
id: allocationId,
projectId: result.projectId,
resourceId: result.resourceId,
});
}
for (const allocationId of result.deletedAllocationIds) {
emitAllocationDeleted(allocationId, result.projectId, result.resourceId);
}
return result;
}
export async function extractTimelineAllocationFragmentMutation(input: {
db: PrismaClient;
allocationId: string;
startDate: Date;
endDate: Date;
}) {
const result = await extractTimelineAllocationFragment({
db: input.db,
allocationId: input.allocationId,
startDate: input.startDate,
endDate: input.endDate,
});
for (const allocationId of result.updatedAllocationIds) {
emitAllocationUpdated({
id: allocationId,
projectId: result.projectId,
resourceId: result.resourceId,
});
}
for (const allocationId of result.createdAllocationIds) {
emitAllocationCreated({
id: allocationId,
projectId: result.projectId,
resourceId: result.resourceId,
});
}
return result;
}