feat(print): feeder resolves line-item to-one relations — {{Unit}} renders in items columns (#6501) - #6502
Merged
Merged
Conversation
…} / {{Unit.Name}} render in items columns (#6501)
The generated PrintFeeder's items map carried only the line's scalar
fields, so an invoice line could not print its unit or product - while
header relations DID get resolved maps + __label. Each line-item to-one
relation is now fed the same way: PrintFeederSupport contributes
itemNodes (the composition back-reference to the document excluded -
that is the header itself), and the template loads the target per row
through its generated repository (validations + the multilingual
translation overlay apply), caches lookups per DISTINCT key rather than
per row, and hangs a map carrying __label + the target's fields under
the relation's own key - so {{Unit}} renders the label and {{Unit.Name}}
descends. Same-model targets name their fields one by one (the audit);
a cross-model target is copied reflectively per the #6422 rule, so this
project's committed gen/ survives the owner retiring a field.
Covered by PrintFeederSupportTest (item nodes: back-ref exclusion,
Settings perspective, prefixed variables, cross-model no-named-fields)
and IntentEmissionCoverageIT (BillLine gains a Unit relation; the
generated BillPrintFeeder's lookup/cache/__label emission is asserted
and the whole app compiles and publishes end-to-end - green locally).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
delchev
force-pushed
the
feat/print-feeder-item-relations
branch
from
August 4, 2026 15:06
e7e3eec to
3c05c84
Compare
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.
Closes #6501.
What
The generated
<Entity>PrintFeederfed each line-item row only its scalar fields, so a print template's items table could not render the line's unit or product — while header relations resolved to full maps +__label. Line-item to-one relations now resolve the same way:PrintFeederSupportcontributesitemNodes— one per to-one relation of the line-items entity, the composition back-reference to the document excluded (that is the header itself). Same shapes as the header nodes: a same-model target names its fields one by one (the generated Java stays the audit of what a print receives); a cross-model target is copied reflectively per the Intent: removing a field silently invalidates cross-model consumers' generated code #6422 rule, so this project's committedgen/survives the owner retiring a field. Item variables areitem-prefixed so a header relation of the same name (Customer on both) cannot collide.__label) under the relation's own key — so{{Unit}}renders the label and{{Unit.Name}}descends, exactly like the header relations.generateUtils.jspasses the new collection through with the same gen-folder/package derivation as the header nodes.Tests
PrintFeederSupportTest.itemToOneRelationsAreFedWithLabelAndFields— back-ref exclusion, Settings-perspective routing, prefixed variables, same-model named fields vs cross-model none (5/5 green).IntentEmissionCoverageIT—BillLinegains aUnitrelation (the multilingual setting — the literal "1 month" case); the generatedBillPrintFeederis asserted to contain the distinct-key cache, the repository load, the__labelput and the row-key hang — and the fixture app compiles and publishes end-to-end (1/1 green locally), so the emitted Java went through realjavac.🤖 Generated with Claude Code