feat(platform): harden access scoping and delivery baseline

This commit is contained in:
2026-03-30 00:27:31 +02:00
parent 00b936fa1f
commit 819345acfa
109 changed files with 26142 additions and 8081 deletions
@@ -1,4 +1,5 @@
import type { PrismaClient } from "@capakraken/db";
import { VacationStatus } from "@capakraken/db";
import { AllocationStatus } from "@capakraken/shared";
import { buildSplitAllocationReadModel } from "../allocation/build-split-allocation-read-model.js";
import { calculateInclusiveDays } from "./shared.js";
@@ -25,6 +26,8 @@ export async function getDashboardOverview(db: PrismaClient) {
budgetAssignments,
recentActivity,
allResources,
approvedVacations,
totalEstimates,
] = await Promise.all([
db.resource.count(),
db.resource.count({ where: { isActive: true } }),
@@ -95,6 +98,8 @@ export async function getDashboardOverview(db: PrismaClient) {
db.resource.findMany({
select: { chapter: true, chargeabilityTarget: true },
}),
db.vacation.count({ where: { status: VacationStatus.APPROVED } }),
db.estimate.count(),
]);
const planningReadModel = buildSplitAllocationReadModel({
@@ -200,6 +205,8 @@ export async function getDashboardOverview(db: PrismaClient) {
totalAllocations,
activeAllocations,
cancelledAllocations,
approvedVacations,
totalEstimates,
budgetSummary: {
totalBudgetCents,
totalCostCents,