EBL 3.0: SD-2434: Add metadata to correlate TransportDocuments#633
Conversation
Review Summary by QodoAdd metadata schemas for Transport Document correlation
WalkthroughsDescription• Add metadata schemas to correlate Transport Documents • Support tracking of Transport Document amendments and splits • Enable linking issued documents to previous versions • Define TransportDocumentReplacements and TransportDocumentRelation objects Diagramflowchart LR
IssuanceRequest["IssuanceRequest"]
TDReplacements["TransportDocumentReplacements"]
OldRefs["oldTransportDocumentReferences"]
NewRefs["newTransportDocumentReferences"]
TDRelation["TransportDocumentRelation"]
IssuanceRequest -- "includes" --> TDReplacements
TDReplacements -- "contains" --> OldRefs
TDReplacements -- "contains" --> NewRefs
OldRefs -- "references" --> TDRelation
NewRefs -- "references" --> TDRelation
File Changes1. ebl/v3/issuance/EBL_ISS_v3.0.4.yaml
|
Code Review by Qodo
1. Empty replacements allowed
|
| TransportDocumentReplacements: | ||
| type: object | ||
| title: Transport Document Replacements | ||
| description: | | ||
| This object provides the possibility to link the issued `Transport Document` to one or more previously issued `Transport Document(s)`. | ||
| If this issuance request is the result of a previous **Surrender for Amendments** (because of an update to the `Transport Document`), the `oldTransportDocumentReferences` list would contain a single `transportDocumentReference` (and optionally a `transportDocumentSubReference`). | ||
| If the issued `Transport Document` is a "combination" of multiple `Transport Documents`, the `oldTransportDocumentReferences` list would contain the `transportDocumentReferences` being combined into the issued `Transport Document`. | ||
| The issued `Transport Document` can also be part of a split. In this case, the `newTransportDocumentReferences` list would contain all `transportDocumentReferences` that the `Transport Document(s)` specified in `oldTransportDocumentReferences` have been split into. | ||
| properties: | ||
| oldTransportDocumentReferences: | ||
| type: array | ||
| description: | | ||
| A list of `transportDocumentReference` values and optional `transportDocumentSubReference` values from which the issued `Transport Document` originated. | ||
| If the list contains more than one item, the issuance is the result of a "combination" of multiple `Transport Documents`. | ||
| This property is only relevant if a previous **Surrender for Amendments** has been performed. | ||
| items: | ||
| $ref: '#/components/schemas/TransportDocumentRelation' | ||
| newTransportDocumentReferences: | ||
| type: array | ||
| description: | | ||
| A list of `transportDocumentReference` values and optional `transportDocumentSubReference` values into which the issued `Transport Document` has been split. | ||
| This property is only relevant if a previous **Surrender for Amendments** has resulted in a split of `Transport Documents`. | ||
| items: | ||
| $ref: '#/components/schemas/TransportDocumentRelation' |
There was a problem hiding this comment.
1. Empty replacements allowed 🐞 Bug ≡ Correctness
TransportDocumentReplacements has no required properties and no minItems, so
transportDocumentReplacements: {} or empty arrays validate even though the description says it
links to one or more Transport Documents, producing ambiguous/invalid lineage data.
Agent Prompt
### Issue description
`TransportDocumentReplacements` currently permits an empty object and empty reference lists. This contradicts the schema’s own description (“link … to one or more previously issued Transport Document(s)”) and makes the new field semantically unreliable.
### Issue Context
The spec already uses `minItems: 1` to prevent meaningless empty arrays (e.g., `Response.errors`). The new replacement-correlation structure should follow the same practice.
### Fix Focus Areas
- ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[495-519]
### Suggested change
- Add `required: [oldTransportDocumentReferences]` to `TransportDocumentReplacements`.
- Add `minItems: 1` to `oldTransportDocumentReferences`.
- Add `minItems: 1` to `newTransportDocumentReferences` (so if it is provided, it cannot be empty).
- (Optional) Clarify in descriptions that `oldTransportDocumentReferences` is mandatory when `transportDocumentReplacements` is present.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
Adds optional metadata to the EBL Issuance API to correlate a newly issued Transport Document with previously issued documents (e.g., replacements, combines, splits), supporting SD-2434.
Changes:
- Adds
transportDocumentReplacementstoIssuanceRequest. - Introduces
TransportDocumentReplacementsandTransportDocumentRelationschemas to model old/new document references.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SD-2434: Add meta data to correlate Transport Documents