feat(templates): layered invoice/v2 skeleton on the extracted core#257
Merged
Conversation
Stand up an invoice/v2 family that renders on templates.core + a BrandTheme, mirroring the cv.v2 layered shape. ModernInvoice (DocumentTemplate<InvoiceDocumentSpec>) composes the hero panel, the FROM / BILL TO parties, the line-items table, and the notes / payment-terms footer through the canonical DSL. - core.theme: add invoiceModern() factories to BrandTheme / Palette / Typography / Spacing (additive — no existing caller changes). - invoice/v2/presets/ModernInvoice + package-info, reusing the existing templates.data.invoice model. Parties render inline (two-party layout with optional contact fields), not through the CV-shaped PartyIdentity. - examples: ModernInvoiceV2Example + a GenerateAllExamples row. - smoke test: identity, both factory variants, theme-independence, and an empty invoice. The exact cinematic pixel-port (BusinessTheme.modern() colours, visual snapshots, migrating the invoice examples off builtins.InvoiceTemplateV2) is the follow-up.
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.
Why
Stage-1 extracted a neutral
templates.core.*(theme / identity / text / widgets). The next step brings the invoice family onto it. This PR stands up aninvoice/v2layered family — the skeleton the cinematic pixel-port (2.1b) builds on — so an invoice renders oncore+ aBrandThemethe same way thecv.v2presets do.What
invoiceModern()factories onBrandTheme/Palette/Typography/Spacing— new static factories only, zero existing-caller changes.DocumentTemplate<InvoiceDocumentSpec>,create()/create(BrandTheme)): composes the hero panel, FROM / BILL TO parties, line-items table, and notes / payment-terms footer through the canonical DSL, reading every value from the theme.ModernInvoiceV2Example+ aGenerateAllExamplesrow.Three deliberate choices (vs the original plan bullet):
templates.data.invoice.*instead of duplicating intoinvoice/v2/data— that model is already render-neutral, builder-driven, and shared with the proven builtin; forking it would be the smell.core.identity.PartyIdentity—Contactmandates a non-blank phone/email/address triple (a one-person CV masthead), but invoice party fields are optional and an invoice shows two side-by-side parties.DocumentTableColumn.auto()/.fixed()) —core.widgets.TableWidgetis equal-width only (no header/zebra/total row), so it can't express it.Follow-up (2.1b): exact pixel-port of
builtins.InvoiceTemplateV2's look (BusinessTheme.modern()colours), visual snapshots, and migrating the invoice examples off the builtin.Tests
./mvnw verify javadoc:javadoc -pl .→ BUILD SUCCESS, 1617 tests, 0 failures; javadoc clean. The example renders a clean one-page invoice atexamples/target/generated-pdfs/templates/invoice/invoice-modern-v2.pdf.