Skip to content

EBL 3.0: SD-2434: Add metadata to correlate TransportDocuments#633

Merged
HenrikHL merged 2 commits into
masterfrom
sd-2434_Add-TD-metadata
May 21, 2026
Merged

EBL 3.0: SD-2434: Add metadata to correlate TransportDocuments#633
HenrikHL merged 2 commits into
masterfrom
sd-2434_Add-TD-metadata

Conversation

@HenrikHL
Copy link
Copy Markdown
Contributor

@HenrikHL HenrikHL commented May 21, 2026

SD-2434: Add meta data to correlate Transport Documents

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add metadata schemas for Transport Document correlation

✨ Enhancement

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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

Loading

File Changes

1. ebl/v3/issuance/EBL_ISS_v3.0.4.yaml ✨ Enhancement +51/-0

Add Transport Document correlation metadata schemas

• Added transportDocumentReplacements property to IssuanceRequest schema
• Created TransportDocumentReplacements schema with oldTransportDocumentReferences and
 newTransportDocumentReferences arrays
• Created TransportDocumentRelation schema to link transport document references with optional
 sub-references
• Enables tracking of document amendments, combinations, and splits

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml


2. .stoplight/styleguide.json ⚙️ Configuration changes +1/-1

Update styleguide configuration

• Configuration file modified

.stoplight/styleguide.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 21, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Empty replacements allowed 🐞 Bug ≡ Correctness
Description
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.
Code

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[R495-518]

Evidence
The new schema defines both arrays as optional and without minItems, allowing {} or empty
arrays; elsewhere in this same spec, arrays that must be meaningful use minItems: 1, showing this
omission will allow invalid-but-schema-valid payloads.

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[495-519]
ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[405-411]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### 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



Remediation recommended

2. Unsigned replacement metadata 🐞 Bug ⛨ Security
Description
IssuanceRequest now includes transportDocumentReplacements, but issuanceManifestSignedContent
(a JWS over IssuanceManifest) provides checksums for all other IssuanceRequest parts and not this
new field, so replacement lineage can be altered without invalidating the signature.
Code

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[R478-479]

Evidence
The file shows issuanceManifestSignedContent is a JWS intended to protect payload integrity, and
IssuanceManifest covers checksums for the other IssuanceRequest fields but not the newly added
transportDocumentReplacements. This makes the new metadata the only IssuanceRequest content not
protected by the manifest/signature scheme.

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[468-494]
ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[484-488]
ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[572-605]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`issuanceManifestSignedContent` is described as enabling integrity validation that the payload matches what the carrier issued. Prior to this change, every IssuanceRequest “content” field (`document`, `issueTo`, optional `eBLVisualisationByCarrier`) had a corresponding checksum in `IssuanceManifest`. After adding `transportDocumentReplacements`, it is the only IssuanceRequest content field without a checksum, weakening integrity for the new correlation metadata.

### Issue Context
`IssuanceManifest` currently includes:
- `documentChecksum`
- `eBLVisualisationByCarrierChecksum`
- `issueToChecksum`

### Fix Focus Areas
- ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[468-494]
- ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[572-605]

### Suggested change
- Add a new optional property to `IssuanceManifest`, e.g. `transportDocumentReplacementsChecksum`.
- Document a **Condition** that it must be provided when `transportDocumentReplacements` is present.
- Ensure the checksum computation guidance matches the existing pattern (RFC 8785 canonical form + SHA-256).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines +495 to +518
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'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 transportDocumentReplacements to IssuanceRequest.
  • Introduces TransportDocumentReplacements and TransportDocumentRelation schemas to model old/new document references.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ebl/v3/issuance/EBL_ISS_v3.0.4.yaml
Comment thread ebl/v3/issuance/EBL_ISS_v3.0.4.yaml
Comment thread ebl/v3/issuance/EBL_ISS_v3.0.4.yaml
Comment thread ebl/v3/issuance/EBL_ISS_v3.0.4.yaml
@HenrikHL HenrikHL merged commit 7981cd9 into master May 21, 2026
2 checks passed
@HenrikHL HenrikHL deleted the sd-2434_Add-TD-metadata branch May 21, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants