Per-category export configuration system controlling which sections appear in exported reports. Use when modifying export section visibility, adding toggleable sections, or debugging missing report sections.
Per-category export configuration system. Controls which sections appear in exported reports (Overview, Financial Statements, Financial Analysis). Use this skill when modifying export section visibility, adding new toggleable sections, or debugging why a report section is missing.
| Layer | File | Purpose |
|---|---|---|
| Type definition | client/src/lib/exportConfig.ts | ExportConfig interface, DEFAULT_EXPORT_CONFIG, loadExportConfig(), saveExportConfig() |
| Server schema | server/routes/admin/exports.ts | Zod schemas, GET/PUT /api/admin/export-config endpoints |
| Admin UI | client/src/components/admin/ExportsTab.tsx | Three-tab settings panel |
| Consumer | client/src/components/dashboard/exportRenderers.ts | Reads config to gate section rendering |
| DB persistence |
global_assumptions.exportConfig |
JSONB column in global_assumptions table |
| Category | Sections |
|---|---|
| overview | kpiMetrics, revenueChart, projectionTable, compositionTables, compositionCharts, waterfallTable, propertyInsights, aiInsights |
| statements | incomeStatement, incomeChart, cashFlow, cashFlowChart, balanceSheet, balanceSheetChart, detailedLineItems |
| analysis | kpiSummaryCards, returnChart, freeCashFlowTable, propertyIrrTable, dcfAnalysis, performanceTrend |
Each category also carries 6 format fields: allowLandscape, allowPortrait, allowShort, allowExtended, allowPremium, densePagination.
Admin saves → PUT /api/admin/export-config
→ Zod validates → merges with defaults
→ stores in global_assumptions.exportConfig (JSONB)
→ admin UI also calls saveExportConfig() → localStorage
User exports → loadExportConfig() reads from localStorage (falls back to defaults)
→ exportRenderers check cfg.{category}.{section}
→ skips disabled sections
Note: loadExportConfig() reads from localStorage (not API). The Admin ExportsTab fetches from API on mount, then saves to both API and localStorage via saveExportConfig().
ExportConfig (in exportConfig.ts)DEFAULT_EXPORT_CONFIG (both client and server copies)server/routes/admin/exports.tsSectionToggle component in the matching tab in ExportsTab.tsxexportRenderers.ts with if (cfg.{category}.{field})DEFAULT_EXPORT_CONFIG objects must stay in sync