diff --git a/ovs/src/main/resources/standards/ovs/messages/ovs-300beta1-response.json b/ovs/src/main/resources/standards/ovs/messages/ovs-300beta1-response.json deleted file mode 100644 index e4631079..00000000 --- a/ovs/src/main/resources/standards/ovs/messages/ovs-300beta1-response.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "carrierServiceName": "Great Lion Service", - "carrierServiceCode": "FE1", - "universalServiceReference": "SR12345A", - "vesselSchedules": [ - { - "vesselOperatorSMDGLinerCode": "HLC", - "vesselIMONumber": "9321483", - "vesselName": "King of the Seas", - "vesselCallSign": "NCVV", - "isDummyVessel": true, - "transportCalls": [ - { - "portVisitReference": "NLRTM1234589", - "transportCallReference": "987e4567", - "carrierImportVoyageNumber": "2103N", - "carrierExportVoyageNumber": "2103S", - "universalImportVoyageReference": "2103N", - "universalExportVoyageReference": "2103N", - "location": { - "UNLocationCode": "NLRTM", - "facilitySMDGCode": "RWG" - }, - "statusCode": "OMIT", - "timestamps": [ - { - "eventTypeCode": "ARRI", - "eventClassifierCode": "ACT", - "eventDateTime": "2025-01-14T09:21:00+01:00", - "delayReasonCode": "WEA", - "changeRemark": "Bad weather" - } - ] - } - ] - } - ] - } -] \ No newline at end of file diff --git a/ovs/src/main/resources/standards/ovs/schemas/ovs-300-publisher.json b/ovs/src/main/resources/standards/ovs/schemas/ovs-300-publisher.json index 5f7031bb..f9a94593 100644 --- a/ovs/src/main/resources/standards/ovs/schemas/ovs-300-publisher.json +++ b/ovs/src/main/resources/standards/ovs/schemas/ovs-300-publisher.json @@ -500,6 +500,7 @@ "example": "NLAMS" } }, + "additionalProperties": false, "description": "An interface used to express a location using a `Un Location Code`." }, "FacilitySMDGLocation": { diff --git a/ovs/src/main/resources/standards/ovs/schemas/ovs-300beta1-publisher.json b/ovs/src/main/resources/standards/ovs/schemas/ovs-300beta1-publisher.json deleted file mode 100644 index b1b2a801..00000000 --- a/ovs/src/main/resources/standards/ovs/schemas/ovs-300beta1-publisher.json +++ /dev/null @@ -1,1157 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "DCSA OpenAPI specification for Operational Vessel Schedules", - "description": "API specification issued by DCSA.org\n\nThis API supports OVS (Operational Vessel Schedules)\n\nOVS is used for sharing Vessel schedules. The Interface Standards for OVS can be read [here](https://dcsa.my.salesforce.com/sfc/p/#2o000000YvHJ/a/7T000000Daei/T7rrx6vrU0bpqX5EFaJGFtFrqgJ73yzxclN9IS8qRao).\n\nAll other documents related to the Operational Vessel Schedule publication can be found [here](https://knowledge.dcsa.org/s/publication?publicationId=a0r7T000000UYBOQA4)\n\nFor explanation to specific values or objects please refer to the Information Model v2022.2 *** Will be updated early July ***\n\nFor a changelog please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/blob/master/ovs/v3#v300B1). Please also [create a GitHub issue](https://github.com/dcsaorg/DCSA-OpenAPI/issues/new) if you have any questions/comments.\n", - "contact": { - "name": "Digital Container Shipping Association (DCSA)", - "url": "https://dcsa.org", - "email": "info@dcsa.org" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "3.0.0-Beta-1" - }, - "servers": [ - { - "url": "/" - } - ], - "tags": [ - { - "name": "Operational Vessel Schedules", - "description": "Operational Vessel Schedules operations" - } - ], - "paths": { - "/v3/service-schedules": { - "get": { - "tags": [ - "Operational Vessel Schedules" - ], - "summary": "Get a list of Schedules", - "description": "Get a list of service schedules. The result is `Vessel-Centric` - this means that the `Vessel` is in the top of the hierarchy of the response structure. A service is a heirarchical structure with the following elements:\n- One or more `Services` which can contain one or more `Vessels`\n- A `Vessel` which can call multiple `Ports` (`TransportCalls`).\n- A `Port` (`TransportCall`) can contain one or more `TimeStamps`.\n\nThe number of service schedules in the list can be narrowed down by providing filter parameters. The resulting payload will always include **entire voyage(s) being matched**. This means that even though a filter only matches a single `Port` in a `Voyage` or a single `Timestamp` within a `Port` in a `Voyage` - **the entire Voyage matched** is returned. If the `carrierImportVoyageNumber` of the `Port` differs from the `carrierExportVoyageNumber` of the `Port` then the **entire Voyage** for both these Voyage numbers are included.\n\nAn example of this is when `&UNLocationCode=DEHAM` is used as a filter parameter. In this case **entire Voyages** would be listed where `DEHAM` is a `Port`.\n\nBe aware that it is possible to specify filters that are mutially exclusive resulting in an empty response list. An example of this could be when both using `vesselIMONumber` and `vesselName` filters at the same time:\n\n &vesselIMONumber=9321483&vesselName=King of the Seas\n \nIf no `Vessel` exists where `vesselIMONumber` is **9321483** and `vesselName` is **King of the Seas** then the result will be an empty list\n\nIf no `startDate` filter is provided then **3 months** prior to the request data is used. If no `endDate` filters is provided then **6 months** after the request date is used.\n", - "parameters": [ - { - "name": "carrierServiceCode", - "in": "query", - "description": "The carrier specific service code to filter by. The result will only return schedules including the service code\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/carrierServiceCode" - } - }, - { - "name": "universalServiceReference", - "in": "query", - "description": "The **U**niversal **S**ervice **R**eference (`USR`) as defined by **DCSA** to filter by. The service code must match the regular expression pattern: `SR\\d{5}[A-Z]`. The letters `SR` followed by `5 digits`, followed by a checksum-character as a capital letter from `A to Z`. The result will only return schedules including the service reference\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/universalServiceReference" - } - }, - { - "name": "vesselIMONumber", - "in": "query", - "description": "The identifier of a vessel. The result will only return schedules including the vessel with the specified IMO number.\n\nIt is not a requirement for dummy vessels to have an `IMO Number`. In this case filtering by `vesselName` should be used.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/vesselIMONumber" - } - }, - { - "name": "vesselName", - "in": "query", - "description": "The name of a vessel. The result will only return schedules including the vessel with the specified name.\n\nBe aware that the `vesselName` is not unique and might match multiple vessels. If possible, filtering by `IMO Number` is preferred.\n\nIn case of dummy vessels an `IMO Number` might not exist in which case this filter is to be used.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/vesselName" - } - }, - { - "name": "carrierVoyageNumber", - "in": "query", - "description": "The carrier specific identifier of a `Voyage` - can be both **importVoyageNumber** and **exportVoyageNumber**. The result will only return schedules including the `Ports` where `carrierVoyageNumber` is either `carrierImportVoyageNumber` or `carrierExportVoyageNumber`\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/carrierVoyageNumber" - } - }, - { - "name": "universalVoyageReference", - "in": "query", - "description": "The Universal Reference of a `Voyage` - can be both **importUniversalVoyageReference** and **exportUniversalVoyageReference**. The result will only return schedules including the `Ports` where `universalVoyageReference` is either `importUniversalVoyageReference` or `exportUniversalVoyageReference`\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/universalVoyageReference" - } - }, - { - "name": "UNLocationCode", - "in": "query", - "description": "The `UN Location Code` specifying where a port is located.\n\nSpecifying this filter will only return schedules including **entire Voyages** related to this particular `UN Location Code`.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/UNLocationCode" - }, - "example": "NLRTM" - }, - { - "name": "facilitySMDGCode", - "in": "query", - "description": "The `facilitySMDGCode` specifying a specific facility (using SMDG Code). Be aware that the `facilitySMDGCode` does not contain a `UNLocationCode` - this must be specified in the `UNLocationCode` filter.\n\nSpecifying this filter will only return schedules including **entire Voyages** related to this particular `facilitySMDGCode`.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/UNLocationCode" - }, - "example": "APM" - }, - { - "name": "startDate", - "in": "query", - "description": "The start date of the period for which schedule information is requested. If a date of any Timestamp (`ATA`, `ETA` or `PTA`) inside a `PortCall` matches a date on or after (`≥`) the `startDate` the **entire Voyage** (import- and export-Voyage) matching the `PortCall` will be included in the result. All matching is done towards local Date at the place of the port call.\n\nIf this filter is not provided the default value is **3 months** prior to request time.\n\nThe value is populated in `ISO 8601` date format.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/startDate" - } - }, - { - "name": "endDate", - "in": "query", - "description": "The end date of the period for which schedule information is requested. If a date of any Timestamp (`ATA`, `ETA` or `PTA`) inside a `PortCall` matches a date on or before (`≤`) the `endDate` the **entire Voyage**(import- and export-Voyage) matching the `PortCall` will be included in the result. All matching is done towards local Date at the place of the port call.\n\nIf this filter is not provided the default value is **6 months** after request time.\n\nThe value is populated in `ISO 8601` date format.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/startDate" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of items to return.", - "required": false, - "schema": { - "minimum": 1, - "type": "integer", - "format": "int32", - "default": 100 - }, - "example": 100 - }, - { - "name": "cursor", - "in": "query", - "description": "A server generated value to specify a specific point in a collection result, used for pagination.", - "required": false, - "schema": { - "type": "string" - }, - "example": "fE9mZnNldHw9MTAmbGltaXQ9MTA=" - }, - { - "name": "API-Version", - "in": "header", - "description": "An API-Version header MAY be added to the request (optional); if added it MUST only contain MAJOR version. API-Version header MUST be aligned with the URI version.\n", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "example": "3" - } - } - ], - "responses": { - "200": { - "description": "Schedule successfully posted", - "headers": { - "API-Version": { - "$ref": "#/components/headers/API-Version" - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/serviceSchedule" - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "headers": { - "API-Version": { - "$ref": "#/components/headers/API-Version" - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "serviceSchedules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/serviceSchedule" - } - }, - "serviceSchedule": { - "required": [ - "carrierServiceName" - ], - "type": "object", - "allOf": [ - { - "type": "object", - "properties": { - "carrierServiceName": { - "allOf": [ - { - "$ref": "#/components/schemas/carrierServiceName" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "carrierServiceCode": { - "allOf": [ - { - "$ref": "#/components/schemas/carrierServiceCode" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "universalServiceReference": { - "allOf": [ - { - "$ref": "#/components/schemas/universalServiceReference" - } - ] - } - } - }, - { - "$ref": "#/components/schemas/vesselSchedules" - } - ] - }, - "vesselSchedules": { - "type": "object", - "properties": { - "vesselSchedules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/vesselSchedule" - } - } - } - }, - "vesselSchedule": { - "required": [ - "isDummyVessel", - "vesselOperatorSMDGLinerCode" - ], - "type": "object", - "allOf": [ - { - "type": "object", - "properties": { - "vesselOperatorSMDGLinerCode": { - "allOf": [ - { - "$ref": "#/components/schemas/vesselOperatorSMDGLinerCode" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "vesselIMONumber": { - "allOf": [ - { - "$ref": "#/components/schemas/vesselIMONumber" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "vesselIMONumber": { - "description": "The unique reference for a registered Vessel. The reference is the International Maritime Organisation (IMO) number, also sometimes known as the Lloyd's register code, which does not change during the lifetime of the vessel\n\n**Condition**: If the vessel is not dummy, there needs to be an IMO. If the vessel is dummy, the IMO is optional. \n" - } - } - }, - { - "type": "object", - "properties": { - "vesselName": { - "allOf": [ - { - "$ref": "#/components/schemas/vesselName" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "vesselCallSign": { - "allOf": [ - { - "$ref": "#/components/schemas/vesselCallSign" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "isDummyVessel": { - "allOf": [ - { - "$ref": "#/components/schemas/isDummyVessel" - } - ] - } - } - }, - { - "$ref": "#/components/schemas/transportCalls" - } - ] - }, - "transportCalls": { - "type": "object", - "properties": { - "transportCalls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/transportCall" - } - } - } - }, - "transportCall": { - "required": [ - "carrierImportVoyageNumber", - "transportCallReference" - ], - "type": "object", - "description": "A transportCall in the schedule. A transportCall can be either just a Port or further specified as a terminalCall.\n\nThe order of the list is the sequence of the list\n", - "allOf": [ - { - "type": "object", - "properties": { - "portVisitReference": { - "allOf": [ - { - "$ref": "#/components/schemas/portVisitReference" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "transportCallReference": { - "allOf": [ - { - "$ref": "#/components/schemas/transportCallReference" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "transportCallReference": { - "description": "The unique reference for a transport call. It’s the vessel operator responsibility to provide the Transport Call Reference, other parties are obliged to pick it up and use it. \n" - } - } - }, - { - "type": "object", - "properties": { - "carrierImportVoyageNumber": { - "allOf": [ - { - "$ref": "#/components/schemas/carrierImportVoyageNumber" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "carrierExportVoyageNumber": { - "allOf": [ - { - "$ref": "#/components/schemas/carrierExportVoyageNumber" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "universalImportVoyageReference": { - "allOf": [ - { - "$ref": "#/components/schemas/universalImportVoyageReference" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "universalExportVoyageReference": { - "allOf": [ - { - "$ref": "#/components/schemas/universalExportVoyageReference" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "location": { - "allOf": [ - { - "$ref": "#/components/schemas/location" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "statusCode": { - "type": "string", - "description": "The set of codes in `Status Code` are ONLY meant to communicate any change / exception to the published schedule. This is not required in case of normal schedule. Possible values are:\n\n- OMIT (Omit)\n- BLNK (Blank)\n- ADHO (Ad Hoc)\n- PHOT (Phase Out)\n- PHIN (Phase In)\n- SLID (Sliding)\n- ROTC (Rotation Change)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Information-Model/blob/master/datamodel/referencedata.d/portcallstatuscode.csv)\n", - "example": "OMIT", - "enum": [ - "OMIT", - "PHIN", - "PHOT", - "ADHO", - "BLNK", - "SLID", - "ROTC" - ] - } - } - }, - { - "$ref": "#/components/schemas/timestamps" - } - ] - }, - "timestamps": { - "type": "object", - "properties": { - "timestamps": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/timestamp" - } - ] - } - } - } - }, - "timestamp": { - "required": [ - "eventClassifierCode", - "eventDateTime", - "eventTypeCode" - ], - "type": "object", - "description": "A timestamp for a port\n", - "allOf": [ - { - "type": "object", - "properties": { - "eventTypeCode": { - "allOf": [ - { - "$ref": "#/components/schemas/transportEventTypeCode" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "eventClassifierCode": { - "allOf": [ - { - "$ref": "#/components/schemas/eventClassifierCode" - }, - { - "type": "string", - "enum": [ - "ACT", - "EST", - "PLN" - ] - } - ] - } - } - }, - { - "type": "object", - "properties": { - "eventDateTime": { - "type": "string", - "description": "Time in the timstamp\n", - "format": "date-time", - "example": "2025-01-14T09:21:00+01:00" - } - } - }, - { - "type": "object", - "properties": { - "delayReasonCode": { - "allOf": [ - { - "$ref": "#/components/schemas/delayReasonCode" - } - ] - } - } - }, - { - "type": "object", - "properties": { - "changeRemark": { - "allOf": [ - { - "$ref": "#/components/schemas/changeRemark" - } - ] - } - } - } - ] - }, - "location": { - "type": "object", - "description": "General purpose object to capture location-related data, the location can be specified in any of the following ways: `UN Location Code`, a `Facility` or an `Address`.\n", - "example": { - "UNLocationCode": "NLRTM", - "facilitySMDGCode": "RWG" - }, - "anyOf": [ - { - "$ref": "#/components/schemas/unLocationLocation" - }, - { - "$ref": "#/components/schemas/facilitySMDGLocation" - }, - { - "$ref": "#/components/schemas/addressLocation" - } - ] - }, - "isDummyVessel": { - "type": "boolean", - "description": "Is this a dummy vessel. In case no vessel has been asigned yet - this property can be set to `true` indicating that the vesselIMONumber does not exist.\n" - }, - "carrierServiceName": { - "maxLength": 50, - "type": "string", - "description": "The name of the service \n", - "example": "Great Lion Service" - }, - "carrierServiceCode": { - "maxLength": 5, - "type": "string", - "description": "The Carrier specific code of the service for which the schedule details are published.\n", - "example": "FE1" - }, - "universalServiceReference": { - "maxLength": 8, - "pattern": "SR\\d{5}[A-Z]", - "type": "string", - "description": "A global unique service reference, as per DCSA standard, agreed by VSA partners for the service. The service reference must match the regular expression pattern: `SR\\d{5}[A-Z]`. The letters `SR` followed by `5 digits`, followed by a checksum-character as a capital letter from `A to Z`.\n", - "example": "SR12345A" - }, - "vesselIMONumber": { - "maxLength": 7, - "type": "string", - "description": "The unique reference for a registered Vessel. The reference is the International Maritime Organisation (IMO) number, also sometimes known as the Lloyd's register code, which does not change during the lifetime of the vessel\n", - "example": "9321483" - }, - "vesselName": { - "maxLength": 35, - "type": "string", - "description": "The name of the Vessel given by the Vessel Operator and registered with IMO.\n", - "example": "King of the Seas" - }, - "carrierVoyageNumber": { - "maxLength": 50, - "type": "string", - "description": "The vessel operator-specific identifier of the Voyage.", - "example": "2103S" - }, - "universalVoyageReference": { - "pattern": "\\d{2}[0-9A-Z]{2}[NEWS]", - "type": "string", - "description": "A global unique voyage reference, as per DCSA standard, agreed by VSA partners for the voyage. The voyage reference must match the regular expression pattern: `\\d{2}[0-9A-Z]{2}[NEWS]`\n- `2 digits` for the year\n- `2 alphanumeric characters` for the sequence number of the voyage\n- `1 character` for the direction/haul (`N`orth, `E`ast, `W`est or `S`outh).\n", - "example": "2201N" - }, - "UNLocationCode": { - "maxLength": 5, - "type": "string", - "description": "The UN Location code specifying where the place is located.", - "example": "FRPAR" - }, - "startDate": { - "type": "string", - "description": "The start date of the period for which schedule information is sent. The value is populated in `ISO 8601` Date format.", - "format": "date", - "example": "2020-04-06" - }, - "error": { - "required": [ - "errorDateTime", - "errors", - "httpMethod", - "requestUri", - "statusCode", - "statusCodeText" - ], - "type": "object", - "properties": { - "httpMethod": { - "type": "string", - "description": "The http request method type e.g. GET, POST\n", - "example": "POST", - "enum": [ - "GET", - "HEAD", - "POST", - "PUT", - "DELETE", - "OPTION", - "PATCH" - ] - }, - "requestUri": { - "type": "string", - "description": "The request URI as it was sent\n", - "format": "uri", - "example": "https://dcsa.org/dcsa/tnt/v1/events" - }, - "statusCode": { - "type": "integer", - "description": "The HTTP status code\n", - "format": "int32", - "example": 400 - }, - "statusCodeText": { - "maxLength": 50, - "type": "string", - "description": "The textual representation of the status code\n", - "example": "Bad Request" - }, - "errorMessage": { - "maxLength": 200, - "type": "string", - "description": "Other error information\n", - "example": "The supplied data could not be accepted" - }, - "providerCorrelationID": { - "maxLength": 100, - "type": "string", - "description": "A unique identifier for the transaction, e.g. a UUID\n", - "example": "4426d965-0dd8-4005-8c63-dc68b01c4962" - }, - "errorDateTime": { - "type": "string", - "description": "The date and time (in ISO 8601 format) the error occurred.\n", - "format": "date-time", - "example": "2019-11-12T07:41:00+08:30" - }, - "errors": { - "minItems": 1, - "type": "array", - "description": "List of detailed errors, e.g. fields that could not pass validation\n", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/detailedError" - } - ] - } - } - } - }, - "detailedError": { - "required": [ - "message", - "reason" - ], - "type": "object", - "properties": { - "errorCode": { - "maximum": 7999, - "minimum": 7000, - "type": "integer", - "description": "Standard error code see http://dcsa.org/error-codes (to be created). Examples: 7003 – out or range value, 7004 - invalid type\n", - "format": "int32", - "example": 7003 - }, - "field": { - "maxLength": 50, - "type": "string", - "description": "The field that caused the error, e.g. a failed validation\n", - "example": "facilityCode" - }, - "value": { - "maxLength": 500, - "type": "string", - "description": "The value that of the field that caused the error\n", - "example": "SG SIN WHS" - }, - "reason": { - "maxLength": 100, - "type": "string", - "description": "High level error message\n", - "example": "invalidQuery" - }, - "message": { - "maxLength": 200, - "type": "string", - "description": "Additional information as to why the error occured\n", - "example": "Spaces not allowed in facility code" - } - } - }, - "vesselOperatorSMDGLinerCode": { - "maxLength": 10, - "type": "string", - "description": "The carrier who is in charge of the vessel operation based on the SMDG code\n", - "nullable": false, - "example": "HLC" - }, - "vesselCallSign": { - "maxLength": 10, - "type": "string", - "description": "A unique alphanumeric identity that belongs to the vessel and is assigned by the International Telecommunication Union (ITU). It consists of a threeletter alphanumeric prefix that indicates nationality, followed by one to four characters to identify the individual vessel. For instance, vessels registered under Denmark are assigned the prefix ranges 5PA-5QZ, OUAOZZ, and XPA-XPZ. The Call Sign changes whenever a vessel changes its flag.\n", - "example": "NCVV" - }, - "portVisitReference": { - "maxLength": 50, - "type": "string", - "description": "The unique reference that can be used to link different `transportCallReferences` to the same port visit. The reference is provided by the port to uniquely identify a port call\n", - "example": "NLRTM1234589" - }, - "transportCallReference": { - "maxLength": 100, - "type": "string", - "description": "A carrier definied reference to a TransportCall.\n\nIn the case the Means of Transport is a `Vessel` and the facility is a `Port`/`Terminal` - this reference should be considered a **Terminal Call Reference**\n", - "example": "987e4567" - }, - "carrierImportVoyageNumber": { - "maxLength": 50, - "type": "string", - "description": "The identifier of an import voyage. The vessel operator-specific identifier of the import Voyage.\n", - "example": "2103N" - }, - "carrierExportVoyageNumber": { - "maxLength": 50, - "type": "string", - "description": "The identifier of an export voyage. The vessel operator-specific identifier of the export Voyage.\n", - "example": "2103S" - }, - "universalImportVoyageReference": { - "pattern": "\\d{2}[0-9A-Z]{2}[NEWS]", - "type": "string", - "description": "A global unique voyage reference for the import Voyage, as per DCSA standard, agreed by VSA partners for the voyage. The voyage reference must match the regular expression pattern: `\\d{2}[0-9A-Z]{2}[NEWS]`\n- `2 digits` for the year\n- `2 alphanumeric characters` for the sequence number of the voyage\n- `1 character` for the direction/haul (`N`orth, `E`ast, `W`est or `S`outh).\n", - "example": "2103N" - }, - "universalExportVoyageReference": { - "pattern": "\\d{2}[0-9A-Z]{2}[NEWS]", - "type": "string", - "description": "A global unique voyage reference for the export Voyage, as per DCSA standard, agreed by VSA partners for the voyage. The voyage reference must match the regular expression pattern: `\\d{2}[0-9A-Z]{2}[NEWS]`\n- `2 digits` for the year\n- `2 alphanumeric characters` for the sequence number of the voyage\n- `1 character` for the direction/haul (`N`orth, `E`ast, `W`est or `S`outh).\n", - "example": "2103N" - }, - "transportEventTypeCode": { - "type": "string", - "description": "Identifier for type of Transport event\n- ARRI (Arrived)\n- DEPA (Departed)\n\nMore details can be found on GitHub\n", - "example": "ARRI", - "enum": [ - "ARRI", - "DEPA" - ] - }, - "eventClassifierCode": { - "type": "string", - "description": "Code for the event classifier. Values can vary depending on eventType\n" - }, - "delayReasonCode": { - "maxLength": 3, - "type": "string", - "description": "Reason code for the delay. See SMDG [Code list DELAY](https://smdg.org/documents/smdg-code-lists/delay-reason-and-port-call-activity/) for a list of valid codes to be used for this attribute.\n", - "example": "WEA" - }, - "changeRemark": { - "maxLength": 250, - "type": "string", - "description": "Free text information provided by the vessel operator regarding the reasons for the change in schedule and/or plans to mitigate schedule slippage.", - "example": "Bad weather" - }, - "unLocationLocation": { - "required": [ - "UNLocationCode" - ], - "type": "object", - "description": "An interface used to express a location using a `Un Location Code`\n", - "allOf": [ - { - "type": "object", - "properties": { - "locationName": { - "$ref": "#/components/schemas/locationName" - } - } - }, - { - "type": "object", - "properties": { - "UNLocationCode": { - "$ref": "#/components/schemas/UNLocationCode" - } - } - } - ] - }, - "locationName": { - "maxLength": 100, - "type": "string", - "description": "The name of the location.", - "example": "Port of Amsterdam" - }, - "facilitySMDGLocation": { - "required": [ - "UNLocationCode", - "facilitySMDGCode" - ], - "type": "object", - "description": "An interface used to express a location using a `Facility` by the `SMDG` code list. The `facilitySMDGCode` does not contain the `UNLocationCode` - this should be provided in the `UnLocationCode` attribute.\n", - "allOf": [ - { - "type": "object", - "properties": { - "locationName": { - "$ref": "#/components/schemas/locationName" - } - } - }, - { - "type": "object", - "properties": { - "UNLocationCode": { - "$ref": "#/components/schemas/UNLocationCode" - } - } - }, - { - "type": "object", - "properties": { - "facilitySMDGCode": { - "$ref": "#/components/schemas/facilityCode" - } - } - } - ] - }, - "facilityCode": { - "maxLength": 6, - "type": "string", - "description": "The code used for identifying the specific facility. This code does not include the UN Location Code.\n", - "nullable": false, - "example": "ADT" - }, - "addressLocation": { - "required": [ - "address" - ], - "type": "object", - "description": "An interface used to express a location using an `Address` object\n", - "allOf": [ - { - "type": "object", - "properties": { - "locationName": { - "$ref": "#/components/schemas/locationName" - } - } - }, - { - "type": "object", - "properties": { - "address": { - "description": "Address related information", - "allOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - } - } - } - ] - }, - "address": { - "type": "object", - "description": "An object for storing address related information\n", - "allOf": [ - { - "type": "object", - "properties": { - "name": { - "$ref": "#/components/schemas/addressName" - } - } - }, - { - "type": "object", - "properties": { - "street": { - "$ref": "#/components/schemas/streetName" - } - } - }, - { - "type": "object", - "properties": { - "streetNumber": { - "$ref": "#/components/schemas/streetNumber" - } - } - }, - { - "type": "object", - "properties": { - "floor": { - "$ref": "#/components/schemas/floor" - } - } - }, - { - "type": "object", - "properties": { - "postCode": { - "$ref": "#/components/schemas/postCode" - } - } - }, - { - "type": "object", - "properties": { - "city": { - "$ref": "#/components/schemas/cityName" - } - } - }, - { - "type": "object", - "properties": { - "stateRegion": { - "$ref": "#/components/schemas/stateRegion" - } - } - }, - { - "type": "object", - "properties": { - "country": { - "$ref": "#/components/schemas/country" - } - } - } - ] - }, - "addressName": { - "maxLength": 100, - "type": "string", - "description": "Name of the address", - "example": "Henrik" - }, - "streetName": { - "maxLength": 100, - "type": "string", - "description": "The name of the street of the party’s address.", - "example": "Kronprincessegade" - }, - "streetNumber": { - "maxLength": 50, - "type": "string", - "description": "The number of the street of the party’s address.", - "example": "54" - }, - "floor": { - "maxLength": 50, - "type": "string", - "description": "The floor of the party’s street number.", - "example": "5. sal" - }, - "postCode": { - "maxLength": 50, - "type": "string", - "description": "The post code of the party’s address.", - "example": "1306" - }, - "cityName": { - "maxLength": 65, - "type": "string", - "description": "The city name of the party’s address.", - "example": "København" - }, - "stateRegion": { - "maxLength": 65, - "type": "string", - "description": "The state/region of the party’s address.", - "example": "N/A" - }, - "country": { - "maxLength": 75, - "type": "string", - "description": "The country of the party’s address.", - "example": "Denmark" - } - }, - "parameters": { - "Api-Version-Major": { - "name": "API-Version", - "in": "header", - "description": "An API-Version header MAY be added to the request (optional); if added it MUST only contain MAJOR version. API-Version header MUST be aligned with the URI version.\n", - "required": false, - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "example": "3" - } - }, - "endDate": { - "name": "endDate", - "in": "query", - "description": "The end date of the period for which schedule information is requested. If a date of any Timestamp (`ATA`, `ETA` or `PTA`) inside a `PortCall` matches a date on or before (`≤`) the `endDate` the **entire Voyage**(import- and export-Voyage) matching the `PortCall` will be included in the result. All matching is done towards local Date at the place of the port call.\n\nIf this filter is not provided the default value is **6 months** after request time.\n\nThe value is populated in `ISO 8601` date format.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/startDate" - } - }, - "startDate": { - "name": "startDate", - "in": "query", - "description": "The start date of the period for which schedule information is requested. If a date of any Timestamp (`ATA`, `ETA` or `PTA`) inside a `PortCall` matches a date on or after (`≥`) the `startDate` the **entire Voyage** (import- and export-Voyage) matching the `PortCall` will be included in the result. All matching is done towards local Date at the place of the port call.\n\nIf this filter is not provided the default value is **3 months** prior to request time.\n\nThe value is populated in `ISO 8601` date format.\n", - "required": false, - "style": "form", - "explode": true, - "schema": { - "$ref": "#/components/schemas/startDate" - } - }, - "limit": { - "name": "limit", - "in": "query", - "description": "Maximum number of items to return.", - "required": false, - "schema": { - "minimum": 1, - "type": "integer", - "format": "int32", - "default": 100 - }, - "example": 100 - }, - "cursor": { - "name": "cursor", - "in": "query", - "description": "A server generated value to specify a specific point in a collection result, used for pagination.", - "required": false, - "schema": { - "type": "string" - }, - "example": "fE9mZnNldHw9MTAmbGltaXQ9MTA=" - } - }, - "headers": { - "API-Version": { - "description": "SemVer used to indicate the version of the contract (API version) returned.", - "style": "simple", - "explode": false, - "schema": { - "type": "string", - "example": "3.0.0" - } - } - } - } -} \ No newline at end of file diff --git a/tnt/src/main/java/org/dcsa/conformance/standards/tnt/action/TntGetEventsAction.java b/tnt/src/main/java/org/dcsa/conformance/standards/tnt/action/TntGetEventsAction.java index dadd78b4..72f9bae3 100644 --- a/tnt/src/main/java/org/dcsa/conformance/standards/tnt/action/TntGetEventsAction.java +++ b/tnt/src/main/java/org/dcsa/conformance/standards/tnt/action/TntGetEventsAction.java @@ -67,12 +67,9 @@ private ArrayList _findEventNodes( @Override protected Set checkConformance( Function getExchangeByUuid) { - JsonNode jsonResponse = - getExchangeByUuid - .apply(getMatchedExchangeUuid()) - .getMessage(httpMessageType) - .body() - .getJsonBody(); + ConformanceExchange exchange = getExchangeByUuid.apply(matchedExchangeUuid); + if (exchange == null) return Set.of(); + JsonNode jsonResponse = exchange.getMessage(httpMessageType).body().getJsonBody(); LinkedHashSet validationErrors = new LinkedHashSet<>(); if (!jsonResponse.isArray()) { validationErrors.add("The root JSON response must be an array of events");