feat(templates): give an invoice line the mark its design draws - #636
Merged
Conversation
A design that opens each service line with a glyph — a card for a billing line, a shield for fraud screening, a globe for a hosted service — had nowhere to say which one, and deriving it from the description would have been guesswork dressed as a feature. InvoiceServiceLines.Line now carries icon, a plain string blank when absent, exactly as CvEntry.icon already works on the CV side: the token means something only to the preset that packages it, and a preset that draws no marks ignores it. It costs the layout nothing where nothing is set. Both constructors that predate it — the one before the per-line tax rate and the one before the mark — are kept explicitly, so existing calls compile and link unchanged and every line built through them still carries no mark.
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
The next invoice bundle in the promotion queue opens every service line with a glyph —
a card for a billing line, a shield for fraud screening, a globe for a hosted service.
InvoiceServiceLines.Linehad nowhere to say which one, and deriving it from thedescription would have been guesswork dressed as a feature.
What
Linecarriesicon, a plain string blank when absent, exactly asCvEntry.iconalready works on the CV side: the token means something only to the preset that
packages it, and a preset that draws no marks ignores it. It costs the layout nothing
where nothing is set.
Both constructors that predate it — the one before the per-line tax rate and the one
before the mark — are kept explicitly.
Tests
StructuredInvoiceCompatibilityTestgains three cases beside the existing one: thepre-tax-rate constructor leaves both the rate and the mark blank, the pre-mark
constructor keeps the rate and leaves the mark blank, a line carries the mark it is
given, and a null mark normalizes to blank like the fields beside it. 11 cases green.
./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -am