feat(export): customizable export templates with live preview (epic #28)#38
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "export it your way" feature. Define columns, rename headers, pick the format — Excel, CSV, or JSON.
What
ClosedXMLfor.xlsx, plus CSV and JSON.Bug fixed (surfaced by tests)
The not-found re-execute now skips
/apiroutes, so a JSON 404 no longer surfaces as 405.Proof
dotnet formatclean ·dotnet test25 unit + 9 integration green · e2e 3/3.Refs #28