feat(platform): harden access scoping and delivery baseline
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user