Sd 2925 update tnt implementation#514
Conversation
Review Summary by QodoUpdate TNT 3.0.0 schema with eventClassifier validation and expanded enums
WalkthroughsDescription• Add eventClassifier field validation to TNT schema • Update TNT schema with expanded enum values and improved documentation • Refactor event type checks using Map-based supplier pattern • Enhance reefer and IoT details with additional measurement and status fields Diagramflowchart LR
A["TNT Schema Updates"] --> B["EventClassifier Validation"]
A --> C["Enum Value Expansion"]
A --> D["Field Additions"]
B --> E["New Checks Added"]
C --> F["Renamed Properties"]
C --> G["Updated Descriptions"]
D --> H["Reefer Details"]
D --> I["IoT Details"]
D --> J["Event Routing"]
File Changes1. core/src/main/java/org/dcsa/conformance/core/check/JsonAttribute.java
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Pull request overview
Updates the TNT v3.0.0 Track & Trace artifacts (OpenAPI schema, example messages, and conformance checks) to reflect newer event-classification semantics and additional domain fields.
Changes:
- Refactors the OpenAPI description text and extends multiple schemas (e.g., reefer/IoT-related additions, new objects).
- Adds
eventClassifiervalidation in the TNT v3.0.0 conformance checks. - Updates TNT 3.0.0 request/response JSON fixtures to include
eventClassifier.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tnt/src/main/resources/standards/tnt/schemas/TNT_v3.0.0.yaml | Updates/extends the TNT 3.0.0 OpenAPI schema and documentation content. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json | Updates example response payload to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json | Updates paginated example response payload to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-transport.json | Updates transport request example to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-shipment.json | Updates shipment request example to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-reefer.json | Updates reefer request example to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-iot.json | Updates IoT request example to include eventClassifier. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json | Updates equipment request example to include eventClassifier. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntEventAttributes.java | Adds the EVENT_CLASSIFIER attribute constant. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntDataSets.java | Adds a valid set for event classifier values. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntChecks.java | Adds checks for eventClassification presence and eventClassifier validity; refactors event-type check selection. |
| core/src/main/java/org/dcsa/conformance/core/check/JsonAttribute.java | Improves matchedMustBeOneOf error messaging and makes allowed-values output deterministic. |
Comments suppressed due to low confidence (2)
tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntDataSets.java:16
- With the OpenAPI schema update,
EventClassificationnow documents values likeshipmentEventType: APPROVED,transportEventType: ARRIVED, etc. However the validation data sets still contain the legacy short codes (APPR,ARRI,DEPA, ...). This will make the conformance checks reject payloads that follow the updated schema. Please update theVALID_*sets to the new values (or allow both old+new during a migration).
static final Set<String> VALID_EVENT_CLASSIFIERS = Set.of("ACTUAL", "ESTIMATED", "PLANNED");
static final Set<String> VALID_SHIPMENT_EVENT_TYPE_CODES =
Set.of(
"AMCF", "AMCN", "AMDC", "AMPR", "AMRE", "APPR", "CACF", "CADC", "CANC", "CARE", "CMPL",
"CONF", "DECL", "DRFT", "HOLD", "ISSU", "PENA", "PENM", "PENU", "PSAM", "PSDL", "RECE",
"REJE", "RELS", "REQS", "SUAM", "SUBM", "SUDL");
tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntEventAttributes.java:18
TNT_v3.0.0.yamlnow defineseventClassification.eventType(noteventTypeCode) and several other renamed fields (e.g.,DocumentReference.type). HoweverTntEventAttributesstill hard-codes legacy names likeeventTypeCodeandtypeCode, so the checks will validate the wrong JSON paths. Please align these attribute constants (and dependent checks/fixtures) with the updated schema, or explicitly support both old+new names during a transition.
static final String EVENT_CLASSIFICATION = "eventClassification";
static final String EVENT_TYPE_CODE = "eventTypeCode";
static final String EVENT_CLASSIFIER = "eventClassifier";
static final String SHIPMENT_EVENT_TYPE_CODE = "shipmentEventTypeCode";
static final String SHIPMENT_DETAILS = "shipmentDetails";
static final String DOCUMENT_REFERENCE = "documentReference";
static final String TYPE_CODE = "typeCode";
static final String REFERENCE = "reference";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the TNT v3.0.0 (Track & Trace) conformance assets to align with the SD-2925 TNT implementation updates, including renamed attributes/enums in the schema, updated example payloads, and updated validator logic/error messaging.
Changes:
- Updated TNT v3.0.0 OpenAPI schema definitions and event filtering/pagination documentation.
- Updated v3.0.0 example request/response JSON payloads to reflect renamed attributes/enums (e.g.,
eventType,eventClassifier,originatingParties). - Updated v3.0.0 Java conformance checks/datasets/constants to validate the new field names and allowed values; improved “oneOf” validation error messaging.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tnt/src/main/resources/standards/tnt/schemas/TNT_v3.0.0.yaml | Schema updates: new/renamed fields and enums; expanded reefer/IoT structures; updated markdown sections. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json | Updated v300 response example to new attribute names/enums. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json | Partial update (currently inconsistent with new v300 schema/validators). |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-transport.json | Updated v300 transport request example to new attribute names/enums. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-shipment.json | Updated v300 shipment request example to new attribute names/enums. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-reefer.json | Updated v300 reefer request example to new attribute names/enums. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-iot.json | Updated v300 IoT request example to new attribute names/enums. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json | Updated v300 equipment request example to new attribute names/enums. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/party/TntConstants.java | Updated constant for event type attribute (now points at eventType). |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntEventAttributes.java | Renamed JSON attribute constants to match the updated v300 schema. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntDataSets.java | Updated allowed value sets to match new v300 enums. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntChecks.java | Updated validation logic for renamed fields; added validation for event classification + classifier. |
| core/src/main/java/org/dcsa/conformance/core/check/JsonAttribute.java | Improved matchedMustBeOneOf messages with sorted allowed values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the TNT v3.0.0 conformance artifacts (schema, example payloads, and validation logic) to align with the newer TNT 3.0.0 field names/enumerations and additional reefer/IoT semantics.
Changes:
- Updates the OpenAPI schema with revised field names/enums (e.g.,
eventType,eventClassifier, expanded event subtypes) and new reefer/IoT-related schemas/attributes. - Updates v300 Java conformance checks/datasets to validate the renamed/expanded event classification fields and classifiers.
- Migrates the v300 example request/response JSON payloads toward the new schema structure (event routing, classification, document reference types, facility types, etc.).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tnt/src/main/resources/standards/tnt/schemas/TNT_v3.0.0.yaml | Updates TNT v3 schema structure, enums, and adds new reefer/IoT-related schemas/attributes. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json | Updates v300 response example to new routing/classification/document reference naming. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json | Updates v300 “next page” response example to new routing/classification/document reference naming. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-transport.json | Updates v300 transport request example to new routing/classification/document reference naming. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-shipment.json | Updates v300 shipment request example to new routing/classification/document reference naming. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-reefer.json | Updates v300 reefer request example to new routing/classification naming. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-iot.json | Updates v300 IoT request example to new routing/classification naming and iot details structure. |
| tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json | Updates v300 equipment request example to new routing/classification naming. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/party/TntProducer.java | Aligns event type filtering logic with the renamed eventType attribute. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/party/TntConstants.java | Removes the obsolete EVENT_TYPE_CODE constant and retains EVENT_TYPE. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntEventAttributes.java | Renames JSON attribute constants to match schema (e.g., eventType, eventClassifier, etc.). |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntDataSets.java | Updates allowed value sets to match the expanded enums in v3.0.0. |
| tnt/src/main/java/org/dcsa/conformance/standards/tnt/v300/checks/TntChecks.java | Updates v300 conformance checks to use new attribute names and validate event classifier values. |
| core/src/main/java/org/dcsa/conformance/core/check/JsonAttribute.java | Improves matchedMustBeOneOf error messages and uses sorted allowed values for deterministic output. |
Comments suppressed due to low confidence (4)
tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json:130
- This example still uses legacy
equipmentDetailsattribute names (emptyIndicatorCode,movementType). The v3.0.0 schema was updated toemptyIndicatorandtransportPhase, so this payload will no longer match the schema (and may fail schema-based validation).
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "45G1",
"emptyIndicatorCode": "EMPTY",
"movementType": "IMPORT"
}
tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json:39
- This example still uses legacy
equipmentDetailsattribute names (emptyIndicatorCode,movementType). The v3.0.0 schema was updated toemptyIndicatorandtransportPhase, so this request example should be migrated to the new attribute names to remain schema-compliant.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "EXPORT"
}
tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json:118
- This response example still uses legacy
equipmentDetailsattribute names (emptyIndicatorCode,movementType). The v3.0.0 schema was updated toemptyIndicatorandtransportPhase, so this payload will not validate against the updated schema.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "TRANSSHIPMENT"
}
tnt/src/main/resources/standards/tnt/schemas/TNT_v3.0.0.yaml:463
- The
Event.eventIDdescription still referenceseventRouting.originatingParty.*as part of the composite key, butEventRoutingwas updated to useoriginatingParties(array). Please update the description to reference the new field name/path so the schema documentation matches the actual schema.
Routing of an event from the originating party (or parties), optionally via one or more forwarding parties, to the destination party (or parties).
allOf:
- $ref: "#/components/schemas/EventRouting"
eventID:
maxLength: 500
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…mance-Gateway into SD-2925_update-tnt-schema
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (3)
tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json:130
- In
equipmentDetails, the payload still uses the old attribute namesemptyIndicatorCodeandmovementType, but the updated v3.0.0 schema defines these asemptyIndicatorandtransportPhase. As-is, this example no longer validates againstTNT_v3.0.0.yamland will fail schema-based conformance checks; please rename the fields (and keep the same values).
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "45G1",
"emptyIndicatorCode": "EMPTY",
"movementType": "IMPORT"
}
tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json:116
- This example still uses
equipmentDetails.emptyIndicatorCodeandequipmentDetails.movementType, but the v3.0.0 schema expectsemptyIndicatorandtransportPhase. Please update these attribute names so the next-page example conforms to the updated schema and can be used for pagination validation.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "TRANSSHIPMENT"
tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json:38
equipmentDetailsuses legacy fieldsemptyIndicatorCodeandmovementType, but the updated v3.0.0 schema definesemptyIndicatorandtransportPhase. Update this request example accordingly; otherwise the POST payload example will not validate againstTNT_v3.0.0.yaml.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "EXPORT"
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
tnt/src/main/resources/standards/tnt/messages/tnt-300-response.json:130
- This equipment event example still uses the legacy attribute names
emptyIndicatorCodeandmovementType, but the v3.0.0 schema in this PR renames them toemptyIndicatorandtransportPhase. Updating this template to the new attribute names will keep the sample payload aligned with the published schema and avoid implementers copying outdated fields.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "45G1",
"emptyIndicatorCode": "EMPTY",
"movementType": "IMPORT"
}
tnt/src/main/resources/standards/tnt/messages/tnt-300-response-nextpage.json:117
- This equipment event example still uses the legacy attribute names
emptyIndicatorCodeandmovementType, but the v3.0.0 schema in this PR renames them toemptyIndicatorandtransportPhase. Updating this template to the new attribute names will keep the sample payload aligned with the published schema and avoid implementers copying outdated fields.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "TRANSSHIPMENT"
}
tnt/src/main/resources/standards/tnt/messages/tnt-300-request-equipment.json:39
- This equipment event request template still uses the legacy attribute names
emptyIndicatorCodeandmovementType, but the v3.0.0 schema in this PR renames them toemptyIndicatorandtransportPhase. Updating this template keeps the emitted conformance payload aligned with the schema.
"equipmentDetails": {
"equipmentReference": "APZU4812090",
"ISOEquipmentCode": "22GP",
"emptyIndicatorCode": "LADEN",
"movementType": "EXPORT"
}
No description provided.