Generate GOBL→UBL converter mapping docs - #57
Open
alvarolivie wants to merge 1 commit into
Open
Conversation
Adds a Converters section to the docs, starting with GOBL→UBL. The mapping table is generated deterministically by joining two data legs on the shared EN16931 Business Term: - GOBL→BT: this repo's terms/en16931.yaml (the semantic leg) - BT→UBL: imported from github.com/invopop/gobl.ubl's new terms package Neither leg is derived from converter code: both are curated, BT-keyed data, so GOBL→UBL is their composition rather than a hand-maintained third table. - cmd/generate/converters.go: load both legs, join on BT id, render the table - new phase in main.go; Converters nav group in docs.json - converters/overview.mdx + generated converters/ubl.mdx (139 rows) Base case only: per-context overlays (Peppol/XRechnung/France re-pathing) and the sentinel test that verifies the YAML against actual Convert() output are follow-ups. Refs GBL-68. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
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.
Linear: GBL-68
Adds a Converters section to the docs, starting with GOBL → UBL. See the Converters → GOBL to UBL page in the preview deploy.
How the mapping is built
The table is generated deterministically, not hand-written, by joining two data legs on the shared EN16931 Business Term:
terms/en16931.yamlgobl.ubl/termsCrucially, neither leg is derived from the converter's Go code — both are curated, BT-keyed YAML, so
GOBL → UBLis their composition (GOBL field → BT-xx → UBL XPath) rather than a third table that could drift. Because BT is the join key, future EN16931-family converters (CII, FacturX) reuse the same GOBL→BT leg and only add their own BT→target leg.Changes
cmd/generate/converters.go— load both legs, join on BT id, render the table (139 rows where both legs map a path).main.go; Converters nav group indocs.json.converters/overview.mdx(hand-written) + generatedconverters/ubl.mdx.gobl.ubladds atermspackage that embeds its mapping YAML and exposes a typed parser (gobl.ubl@cb8797c, pinned here).Scope / follow-ups
Base case only. Deliberately not in this PR:
gobl.ubl— set a GOBL field to a unique value, runConvert(), assert it lands at the declared XPath — to keep the YAML honest against the code.Independent of the external-addons PR (#56) and based on
main, so it carries no #847 dependency.🤖 Generated with Claude Code