feat(webui): add aggregate Campaign reports

This commit is contained in:
2026-07-22 08:44:15 +02:00
parent 06125cc0e8
commit fc36aee6c0
4 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const api = readFileSync("src/api/campaigns.ts", "utf8");
const page = readFileSync("src/features/reports/AggregateReportsPage.tsx", "utf8");
assert(api.includes('"/api/v1/campaigns/aggregate-reports"'), "the report list uses the safe aggregate collection");
assert(api.includes("/api/v1/campaigns/aggregate-reports/${encodeURIComponent(campaignId)}"), "the selected report uses the safe aggregate projection");
assert(page.includes("listAggregateReportCampaigns"), "the page loads only the safe Campaign selector projection");
assert(page.includes("getAggregateCampaignReport"), "the page loads only the safe aggregate report projection");
assert(!page.includes("getCampaignReport"), "the aggregate page cannot load the recipient-aware full report");
assert(!page.includes("getCampaignJobs"), "the aggregate page cannot cache recipient jobs");
assert(!page.includes("getCampaignJobDetail"), "the aggregate page has no detail route");
assert(!page.includes("downloadCampaignJobsCsv"), "the aggregate page has no export path");
assert(!page.includes("localStorage"), "the aggregate page does not persist report data in local storage");
assert(!page.includes("sessionStorage"), "the aggregate page does not persist report data in session storage");
assert(page.includes("TableActionGroup"), "campaign selection uses the central icon-only table action group");
assert(page.includes("disabled: campaign.id === selectedFromUrl"), "the selected row action stays visible and disabled");
console.log("aggregate report UI structure checks passed");