Skip to content

feat(export): customizable export templates with live preview (epic #28)#38

Merged
xt0n1-t3ch merged 1 commit into
mainfrom
feat/epic-28-export-templates
Jun 14, 2026
Merged

feat(export): customizable export templates with live preview (epic #28)#38
xt0n1-t3ch merged 1 commit into
mainfrom
feat/epic-28-export-templates

Conversation

@xt0n1-t3ch

Copy link
Copy Markdown
Owner

The "export it your way" feature. Define columns, rename headers, pick the format — Excel, CSV, or JSON.

What

  • Template model: ordered columns, each mapping a canonical field or a line-item table column to a custom header, plus a format. A column that matches a line-item header is pulled per row; document-level fields repeat across rows.
  • Built-ins (seeded, read-only): Canonical CSV · Bordereau line items (Excel) · Lloyd's CRS 5.2 core (Excel) · Full record (JSON). Duplicate to customize.
  • Export templates page: list / create / edit / duplicate / delete, with a live preview rendered against a real document.
  • Review export menu lists every template; one click downloads the file. Quick JSON/CSV kept.
  • Engine: ClosedXML for .xlsx, plus CSV and JSON.

Bug fixed (surfaced by tests)

The not-found re-execute now skips /api routes, so a JSON 404 no longer surfaces as 405.

Proof

  • build 0 warnings · dotnet format clean · dotnet test 25 unit + 9 integration green · e2e 3/3.
  • Browser 1440px: Templates page + live preview rendering the hero bordereau through the template; zero console errors.

Refs #28

…e preview

Lets the company define exactly how data leaves Reve. A template is an ordered set of
columns, each mapping a canonical field or a line-item table column to a custom header, plus
an output format. Built-in templates (Canonical CSV, Bordereau line items, Lloyd's CRS 5.2
core, Full JSON) ship seeded and read-only; users create, edit, duplicate, and delete their
own.

- Core: ExportFormat + ExportColumn/ExportTemplate/ExportTemplateDraft/ExportPreview/ExportFile.
- Infrastructure: ExportTemplateRecord + migration; IExportTemplateStore (CRUD, idempotent
  built-in seeding by fixed Id); IDocumentExporter renders preview + CSV/Excel(ClosedXML)/JSON.
  A column matching a line-item header is pulled per row; document-level fields repeat.
- Web: /api/templates CRUD + /export?templateId; an Export-templates page with a live preview
  against a real document; the review screen's Export menu lists templates; rail nav entry.
- Tests: exporter (preview, line-item vs document scope, CSV/JSON/Excel) + template API CRUD
  + export-with-template. 25 unit + 9 integration green.

Also fixes an API bug surfaced by the tests: the not-found re-execute now skips /api routes,
so JSON 404s no longer surface as 405.

Refs #28
@xt0n1-t3ch xt0n1-t3ch merged commit a93772a into main Jun 14, 2026
2 checks passed
@xt0n1-t3ch xt0n1-t3ch deleted the feat/epic-28-export-templates branch June 14, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant