Proposal: org.Package for shipped packages (UBL cac:Package) - #897
Draft
samlown wants to merge 1 commit into
Draft
Proposal: org.Package for shipped packages (UBL cac:Package)#897samlown wants to merge 1 commit into
samlown wants to merge 1 commit into
Conversation
Introduces org.Package based on the UBL cac:Package class, attached to bill lines as Line.Packages. Each package has a key for the type of package with mappings to UN/ECE Recommendation 21 codes (exposed via UNECERec21()), a count, identities (e.g. SSCC), and its own attributes for dimensions and gross weight using the bare attribute keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## items-en16931-proposal #897 +/- ##
==========================================================
+ Coverage 94.74% 94.75% +0.01%
==========================================================
Files 317 318 +1
Lines 17269 17334 +65
==========================================================
+ Hits 16361 16425 +64
Misses 561 561
- Partials 347 348 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Proposal for a structured
org.Packagemodel, following the discussion in #859 about multi-box shipments and the removal of thepackaging+*attribute keys.Design
org.Packageis based on the UBLcac:Packageclass, where packages are first-class objects with their own dimension list rather than prefixed attributes on the item:key— type of package (box,pallet,crate, …) instead of a raw code. Each pre-defined key maps to its UN/ECE Recommendation 21 code viacbc.Definition.Map(unece-rec21), withPackage.UNECERec21()resolving the code for converters (extended keys likebox+giftresolve via their base; unknown keys fall back toZZmutually defined). Keys must be based on one of the pre-defined keys, mirroringpay.HasValidMeansKey.count— number of identical packages of this type.identities— package-level identifiers such as a GS1 SSCC (≈ UBLcbc:ID).attributes— reusesorg.Attributewith bare keys (length,weight, …), context supplying the referent; duplicate keys rejected (≈ UBLcac:MeasurementDimension, whoseAttributeID/Measure+unitCodemaps to ourtype/amount+unit).bill.Line.Packages, following UBL/Peppol which hang packages off despatch lines; most useful inbill.Deliverydocuments but available on any line.The ES delivery example (
examples/es/delivery.yaml) shows the intended usage: 10 mugs shipped as 2 boxes of 3.5 kg each.Open questions
Line.Packages, as proposed) vs restricting to delivery documents only, vs also/instead onorg.Itemfor stable "ships as N boxes" catalogue data.countsemantics: number of identical packages (proposed) vs UBL'scbc:Quantity(item units contained in the package) — or both.ContainedPackage(boxes on a pallet); omitted here for simplicity.org.Unitpresentation unit names where they overlap;traymaps toDSto matchUnitTray'sXDS.Pre-Review Checklist
go generate .to ensure that the Schemas and Regime data are up to date.🤖 Generated with Claude Code