feat: dashboard overhaul, chargeability reports, dispo import enhancements, UI polish
Dashboard: expanded chargeability widget, resource/project table widgets with sorting and filters, stat cards with formatMoney integration. Chargeability: new report client with filtering, chargeability-bookings use case, updated dashboard overview logic. Dispo import: TBD project handling, parse-dispo-matrix improvements, stage-dispo-projects resource value scores, new tests. Estimates: CommercialTermsEditor component, commercial-terms engine module, expanded estimate schemas and types. UI: AppShell navigation updates, timeline filter/toolbar enhancements, role management improvements, signin page redesign, Tailwind/globals polish, SystemSettings SMTP section, anonymization support. Tests: new router tests (anonymization, chargeability, effort-rule, entitlement, estimate, experience-multiplier, notification, resource, staffing, vacation). Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -3,6 +3,7 @@ import { createElement } from "react";
|
||||
import { NextResponse } from "next/server";
|
||||
import * as XLSX from "xlsx";
|
||||
import { buildSplitAllocationReadModel } from "@planarchy/application";
|
||||
import { anonymizeResource, getAnonymizationDirectory } from "@planarchy/api";
|
||||
import { prisma } from "@planarchy/db";
|
||||
import type { AllocationLike } from "@planarchy/shared";
|
||||
import { auth } from "~/server/auth.js";
|
||||
@@ -52,19 +53,23 @@ export async function GET(request: Request) {
|
||||
assignments,
|
||||
});
|
||||
const assignmentRows = allocationView.assignments.slice(0, 500);
|
||||
const directory = await getAnonymizationDirectory(prisma);
|
||||
|
||||
const rows = assignmentRows.map((a: AllocationLike & {
|
||||
resource?: { displayName?: string | null } | null;
|
||||
resource?: { id: string; displayName?: string | null } | null;
|
||||
project?: { shortCode: string; name: string } | null;
|
||||
}) => ({
|
||||
resourceName: a.resource?.displayName ?? "Unknown",
|
||||
projectName: a.project ? `${a.project.shortCode} — ${a.project.name}` : "Unknown project",
|
||||
role: a.role ?? "",
|
||||
startDate: new Date(a.startDate).toLocaleDateString("en-GB"),
|
||||
endDate: new Date(a.endDate).toLocaleDateString("en-GB"),
|
||||
hoursPerDay: a.hoursPerDay,
|
||||
dailyCostCents: a.dailyCostCents,
|
||||
}));
|
||||
}) => {
|
||||
const resource = a.resource ? anonymizeResource(a.resource, directory) : null;
|
||||
return {
|
||||
resourceName: resource?.displayName ?? "Unknown",
|
||||
projectName: a.project ? `${a.project.shortCode} — ${a.project.name}` : "Unknown project",
|
||||
role: a.role ?? "",
|
||||
startDate: new Date(a.startDate).toLocaleDateString("en-GB"),
|
||||
endDate: new Date(a.endDate).toLocaleDateString("en-GB"),
|
||||
hoursPerDay: a.hoursPerDay,
|
||||
dailyCostCents: a.dailyCostCents,
|
||||
};
|
||||
});
|
||||
|
||||
const ts = Date.now();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user