From 124830923ec07fa74cc03b997d7c8c19a429fb50 Mon Sep 17 00:00:00 2001 From: preetamnpr <128618622+preetamnpr@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:03:43 +0100 Subject: [PATCH 1/3] DT-607 added sample request and booking schema. --- .../booking/BookingComponentFactory.java | 2 +- .../booking/messages/booking-v20-request.json | 122 +- .../booking/schemas/booking-v20-carrier.json | 3818 ++++++++++++++++- 3 files changed, 3881 insertions(+), 61 deletions(-) diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java index 8786b3a1..f4089ed6 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java @@ -120,7 +120,7 @@ public JsonSchemaValidator getMessageSchemaValidator(String apiProviderRole, boo standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); String schemaName = BookingRole.isCarrier(apiProviderRole) - ? (forRequest ? "BookingNotification" : null) + ? (forRequest ? "postBooking" : null) : (forRequest ? "BookingNotification" : "BookingNotification"); return new JsonSchemaValidator( BookingComponentFactory.class.getResourceAsStream(schemaFilePath), schemaName); diff --git a/booking/src/main/resources/standards/booking/messages/booking-v20-request.json b/booking/src/main/resources/standards/booking/messages/booking-v20-request.json index 60b30500..b4b5c2cf 100644 --- a/booking/src/main/resources/standards/booking/messages/booking-v20-request.json +++ b/booking/src/main/resources/standards/booking/messages/booking-v20-request.json @@ -1,7 +1,127 @@ { + "receiptTypeAtOrigin": "CY", + "deliveryTypeAtDestination": "CY", + "cargoMovementTypeAtOrigin": "FCL", + "cargoMovementTypeAtDestination": "FCL", "vessel": { + "name": "King of the Seas", "vesselIMONumber": "VESSEL_IMO_NUMBER_PLACEHOLDER" }, + "serviceContractReference": "serviceRef", + "carrierExportVoyageNumber": "2106W", "carrierServiceName": "CARRIER_SERVICE_NAME_PLACEHOLDER", - "TODO": "..." + "declaredValue": 3.14, + "declaredValueCurrency": "DKK", + "isPartialLoadAllowed": true, + "isExportDeclarationRequired": true, + "exportDeclarationReference": "exportDeclarationRef", + "isImportLicenseRequired": true, + "importLicenseReference": "importLicenseRef", + "expectedDepartureDate": "2052-11-15", + "expectedArrivalAtPlaceOfDeliveryStartDate": "2052-11-15", + "expectedArrivalAtPlaceOfDeliveryEndDate": "2052-11-15", + "transportDocumentTypeCode": "BOL", + "transportDocumentReference": "transportDocumentRef", + "bookingChannelReference": "bookingChannelRef", + "incoTerms": "FOB", + "communicationChannelCode": "AO", + "isEquipmentSubstitutionAllowed": true, + "placeOfBLIssue": { + "locationName": "Asseco DK office", + "locationType": "ADDR", + "address": { + "name": "Asseco DK", + "street": "Kronprinsessegade", + "streetNumber": "54", + "floor": "5. sal", + "postCode": "1306", + "city": "København", + "country": "Denmark" + } + }, + "requestedEquipments": [ + { + "ISOEquipmentCode": "22G1", + "units": 1, + "isShipperOwned": false, + "commodities": [ + { + "HSCodes": ["411510"], + "commodityType": "commodity type", + "cargoGrossWeight": 323.32, + "cargoGrossWeightUnit": "KGM", + "cargoGrossVolume": 100.0, + "cargoGrossVolumeUnit": "MTQ", + "outerPackaging": { + "packageCode" : "1A", + "imoPackagingCode": "A1222", + "numberOfPackages": 1, + "description": "steel" + + }, + "exportLicenseIssueDate": "2022-11-15", + "exportLicenseExpiryDate": "2023-05-15" + } + ] + } + ], + "references": [ + { + "type": "AAO", + "value": "ref value" + } + ], + "documentParties": [ + { + "party": { + "partyName": "boring party", + "address": { + "name": "Asseco DK", + "street": "Kronprinsessegade", + "streetNumber": "54", + "floor": "5. sal", + "postCode": "1306", + "city": "København", + "country": "Denmark" + }, + "partyContactDetails": [ + { + "name": "Henrik", + "phone": "+31611444666" + } + ], + "identifyingCodes": [ + { + "DCSAResponsibleAgencyCode": "DCSA", + "partyCode": "reponsible fun", + "codeListName": "irreponsible fun" + } + ] + }, + "partyFunction": "BA", + "displayedAddress": [ + "line1", + "line2" + ], + "isToBeNotified": true + } + ], + "shipmentLocations": [ + { + "location": { + "locationType": "UNLO", + "UNLocationCode": "NLRTM" + }, + "shipmentLocationTypeCode": "POL", + "eventDateTime": "2022-11-15T10:34:41.99631016+01:00" + }, + { + "location": { + "locationType": "UNLO", + "UNLocationCode": "USMIA" + }, + "shipmentLocationTypeCode": "POD", + "eventDateTime": "2022-11-15T10:34:41.99631016+01:00" + } + ] } diff --git a/booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json b/booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json index 8acf7573..3ec898d3 100644 --- a/booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json +++ b/booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json @@ -1,111 +1,3811 @@ { - "openapi": "3.0.0", + "openapi": "3.0.3", "info": { - "title": "bkg_ntf_v1.0.0-Beta-1", - "version": "1.0.0-Beta-1" + "title": "DCSA OpenAPI specification for Booking", + "description": "API specification issued by DCSA.org.\n\nFor explanation to specific values or objects please refer to the [Information Model 2023.Q3](https://dcsa.org/wp-content/uploads/2022/02/DCSA-Information-Model-2023.Q1.pdf) *** _Will be updated_ ***. This API does not define the business rules regarding what is allowed to update at what time. For this the [Booking Interface Standard (IFS)]() *** _Will be updated_ *** document should be consulted. **All UseCases mentioned in this API refer to UseCases defined in this Booking IFS**.\n\nAll other documents related to the Booking publication can be found [here](https://knowledge.dcsa.org/s/publication?publicationId=a0r7T000000L8mmQAC)\n\nIt is possible to use this API as a standalone API. In order to do so it is necessary to use one of the poll-endPoints:\n\n GET /v2/bookings/{bookingReference}\n\nin order to poll information.\n\nIt is possible to have notifications pushed to you whenever the provider needs input and/or a state change. The format for the Notification is defined by the [Booking Notification API](https://app.swaggerhub.com/apis/dcsaorg/DCSA_BKG_NTF/2.0.0-Beta-1). Signing up for Notifications is defined outside the scope of this API.\n\nFor a changelog please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/tree/master/bkg/v2#v200B1). 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": "2.0.0-Beta-1" }, "servers": [ { - "url": "http://localhost:3000" + "url": "/" + } + ], + "tags": [ + { + "name": "Booking", + "description": "The Booking" } ], "paths": { - "/v2/booking-notifications": { + "/v2/bookings": { "post": { - "summary": "", - "operationId": "post-v1-booking-notifications", + "tags": [ + "Booking" + ], + "summary": "Creates a new Booking\n", + "description": "Creates a new booking request. This endPoint corresponds with **UseCase 1 - Submit booking request**.\n", + "operationId": "postBooking", + "parameters": [ + { + "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": "2" + } + } + ], "requestBody": { + "description": "The payload used to create a `Booking Request`", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BookingNotification" + "$ref": "#/components/schemas/v2_bookings_body" } } - } + }, + "required": true }, "responses": { - "204": { - "description": "No Content" + "201": { + "description": "`Booking Request` has been successfully created in the provider system. Depending on the level of validation done by the provider - the status of the `Booking Request` will be one of the following:\n- `RECEIVED` in case asynchronous processing of the `Booking Request` begins. The `Booking Request` is now awaiting the provider to continue the validation\n- `PENDING UPDATE` in case provider has performed a **Full Validation** and needs the `Booking Request` to be updated\n- `CONFIRMED` in case provider has performed a **Full Validation** and confirmed the `Booking Request`. The `Booking Request` is ready to be used in a `Shipping Instruction`\n- `REJECTED` in case the provider has performed a **Full Validation** and has rejected the `Booking Request`. The `Booking Request` can no longer be updated\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bookingRefStatus" + }, + "examples": { + "receExample": { + "summary": "Booking request received\n", + "description": "A `Booking Request` has been received (`bookingStatus='RECEIVED'`) and stored in provider system but not yet fully validated (only schema validated)\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "RECEIVED" + } + }, + "penuExample": { + "summary": "Booking request pending update\n", + "description": "A `Booking Request` received and stored in provider system and fully validated. The result of the full validation has resulted in the provider requiring the consumer to make some updates (`bookingStatus='PENDING UPDATE'`)\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "PENDING UPDATE", + "requestedChanges": [ + { + "path": "carrierServiceName", + "message": "Service does not exist" + } + ] + } + }, + "confExample": { + "summary": "Confirmed Booking request\n", + "description": "A `Booking Request` received and stored in provider system, fully validated and Confirmed (`bookingStatus='CONFIRMED'`).\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "CONFIRMED" + } + }, + "rejeExample": { + "summary": "Rejected Booking request\n", + "description": "A `Booking Request` received and stored in provider system but has been rejected (`bookingStatus='REJECTED'`).\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "REJECTED" + } + } + } + } + } + }, + "400": { + "description": "In case the `Booking Request` does not schema validate a `400` (Bad Request) is returned\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "badRequestExample": { + "summary": "Booking missing receiptTypeAtOrigin\n", + "description": "`receiptTypeAtOrigin` is a mandoatry field in the `Booking Request`. This is an example of how the error object would look in case this field is missing\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "POST", + "requestUri": "/v2/bookings", + "statusCode": 400, + "statusCodeText": "Bad Request", + "errorMessage": "receiptTypeAtOrigin not found - it is a mandatory field in Booking request", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "field": "receiptTypeAtOrigin", + "reason": "mandatory field missing", + "message": "receiptTypeAtOrigin must be provided as part of a Booking request" + } + ] + } + } + } + } + } + }, + "500": { + "description": "In case a server error occurs in provider system a `500` (Internal Server Error) is returned\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "internalServerErrorExample": { + "summary": "Internal Server Error while processing Booking Request\n", + "description": "An Internal Server Error has occurred - the consumer should contact {provider-support} and provide the `providerCorrelationID` (in the example this is `4426d965-0dd8-4005-8c63-dc68b01c4962`)\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "POST", + "requestUri": "/v2/bookings", + "statusCode": 500, + "statusCodeText": "Internal Server Error", + "errorMessage": "Internal Server Error occurred while processing Booking request", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Internal Error occurred", + "message": "Internal Error occurred" + } + ] + } + } + } + } + } + }, + "default": { + "description": "For other errors the error object should be populated with relevant information\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "tooManyRequestsExample": { + "summary": "Making too many Bookings Requests\n", + "description": "Calling the endPoint\n\n POST /v2/bookings\n \ntoo many times within a timeperiod.\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "POST", + "requestUri": "/v2/bookings", + "statusCode": 429, + "statusCodeText": "Too Many Requests", + "errorMessage": "Too many request to create a booking has been requested. Please try again in 1 hour", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Max Booking requests reached", + "message": "A maximum of 10 Bookings can be created per hour" + } + ] + } + } + } + } + } + } + } + } + }, + "/v2/bookings/{bookingReference}": { + "get": { + "tags": [ + "Booking" + ], + "summary": "Gets the Booking\n", + "description": "Retrieves the `Booking Request` with the `carrierBookingRequestReference` in the path. It is recommended to use this endPoint to `GET` data before an update is made to make sure latest version is being updated.\n\nIn case no subscription (`Notification`) has been set up - it is possbile to use this endPoint to poll on in order to detect if `bookingStatus` has changed.\n", + "operationId": "getBooking", + "parameters": [ + { + "name": "bookingReference", + "in": "path", + "description": "This can be one of:\n- `carrierBookingRequestReference` (in case no carrierBookingReference has yet been appointed to the booking)\n- `carrierBookingReference`\n", + "required": true, + "style": "simple", + "explode": false, + "schema": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "example": "CBR001" + } + }, + { + "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": "2" + } + } + ], + "responses": { + "200": { + "description": "Request successful", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getBooking" + } + } + } + }, + "default": { + "description": "Unexpected error", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "getError": { + "summary": "GET non-existing Booking Request\n", + "description": "Calling\n\n GET /v2/bookings/cbrr-123\n \nresults in an error as booking `cbrr-123` does not exist.\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "GET", + "requestUri": "/v2/bookings/cbrr-123", + "statusCode": 404, + "statusCodeText": "Not Found", + "errorMessage": "The requested carrierBookingRequestReference does not exist", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Non existent carrierBookingRequestReference", + "message": "carrierBookingRequestReference `cbrr-123` does not exist" + } + ] + } + } + } + } + } + } + } + }, + "put": { + "tags": [ + "Booking" + ], + "summary": "Updates the Booking\n", + "description": "Updates the `Booking Request` with the `carrierBookingRequestReference` in the path. This endPoint corresponds with either\n\n- **UseCase 3 - Submit updated Booking request**\n- **UseCase 7 - Request amendments to confirmed Booking**\n", + "operationId": "putBooking", + "parameters": [ + { + "name": "bookingReference", + "in": "path", + "description": "This can be one of:\n- `carrierBookingRequestReference` (in case no carrierBookingReference has yet been appointed to the booking)\n- `carrierBookingReference`\n", + "required": true, + "style": "simple", + "explode": false, + "schema": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "example": "CBR001" + } + }, + { + "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": "2" + } } + ], + "requestBody": { + "description": "Parameters used to update the booking request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/putBooking" + } + } + }, + "required": true }, - "servers": [ + "responses": { + "200": { + "description": "The `Booking request` has been successfully updated in the provider system. Depending on the level of validation done by the provider - the status of the `Booking request` will be one of the following:\n- `PENDING UPDATE CONFIRMATION` in case the consumer has provided an update to a `Booking request` and is awaiting the provider to take action (start a full validation)\n- `PENDING AMENDMENT APPROVAL` in case the consumer has provided an amendment to a `Confirmed Booking` and is awaiting the provider to take action (start a full validation)\n- `PENDING UPDATE` in case provider needs the `Booking request` to be updated and awaits further input from consumer\n- `CONFIRMED` in case provider has confirmed the `Booking request` or confirmed the amendment to a `Confirmed Booking` and the Booking request is ready to be used in a `Shipping Instruction`\n- `REJECTED` in case the provider has rejected the `Booking request`. The `Booking request` can no longer be updated\n- `DECLINED` in case the provider has declined the `Confirmed Booking`. The `Confirmed Booking` can no longer be updated\n\nThe status of the `Booking request` can be monitored on the\n\n GET /bookings/{bookingReference}\n\n endPoint by the consumer.\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bookingRefStatus" + }, + "examples": { + "pendingUpdateConfirmationExample": { + "summary": "Booking request updated\n", + "description": "An updated `Booking request` received and stored in provider system but not yet fully validated (only schema validated) - the Booking now awaits provider action\n\n bookingStatus='PENDING UPDATE CONFIRMATION'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "PENDING UPDATE CONFIRMATION" + } + }, + "pendingAmendmentApprovalExample": { + "summary": "Confirmed Booking updated\n", + "description": "An amendment to a `Confirmed Booking` received and stored in provider system but not yet fully validated (only schema validated) - the Booking now awaits provider action\n\n bookingStatus='PENDING AMENDMENT APPROVAL'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "PENDING AMENDMENT APPROVAL" + } + }, + "pendingUpdateExample": { + "summary": "Booking request pending update\n", + "description": "A new or an updated `Booking request` is received and stored in provider system and fully validated. The result of the full validation is that the provider requires the consumer to make some updates (`PENDING UPDATE`) - the Booking now awauts consumer action\n\n bookingStatus='PENDING UPDATE'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "PENDING UPDATE", + "requestedChanges": [ + { + "path": "carrierServiceName", + "message": "Service does not exist" + } + ] + } + }, + "confirmedExample": { + "summary": "Confirmed Booking request\n", + "description": "A new or updated `Booking request` or an amendment to a `Confirmed Booking` is received and stored in provider system, fully validated and **Confirmed**. The Booking can be used in a `Shipping Instruction`\n\n bookingStatus='CONFIRMED'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "carrierBookingReference": "cbr-987", + "bookingStatus": "CONFIRMED" + } + }, + "rejectedExample": { + "summary": "Rejected Booking request\n", + "description": "A new or updated `Booking request` received and stored or a confirmed booking in provider system that has been rejected - the `Booking request`/`Confirmed Booking` can no longer be used.\n\n bookingStatus='REJECTED'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "REJECTED", + "reason": "Lack of capacity on selected Vessel" + } + }, + "declinedExample": { + "summary": "Declined Booking\n", + "description": "A `Confirmed Booking` or a booking amendment received and stored in provider system but has been declined - the `Booking` can no longer be used.\n\n bookingStatus='DECLINED'\n", + "value": { + "carrierBookingRequestReference": "cbrr-123", + "bookingStatus": "DECLINED", + "reason": "Lack of capacity on selected Vessel" + } + } + } + } + } + }, + "400": { + "description": "In case the updated Booking request does not schema validate a `400` (Bad Request) is returned\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "badRequestExample": { + "summary": "Booking missing receiptTypeAtOrigin\n", + "description": "`receiptTypeAtOrigin` is a mandoatry field in the Booking request. This is an example of how the error object would look in case this field is missing\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "PUT", + "requestUri": "/v2/bookings/cbrr-123", + "statusCode": 400, + "statusCodeText": "Bad Request", + "errorMessage": "receiptTypeAtOrigin not found - it is a mandatory field in Booking request", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "field": "receiptTypeAtOrigin", + "reason": "mandatory field missing", + "message": "receiptTypeAtOrigin must be provided as part of a Booking request" + } + ] + } + } + } + } + } + }, + "409": { + "description": "In case the provider is processing an already updated Booking request - it is possible for the provider to reject new incomming requests by returning a `409` (Conflict)\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "conflictExample": { + "summary": "Conflicting request\n", + "description": "The provider is already processing a request and needs to finish this process before any new requests are processed\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "PUT", + "requestUri": "/v2/bookings/cbrr-123", + "statusCode": 409, + "statusCodeText": "Conflict", + "errorMessage": "Previous request is being processed. Please try again later", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Conflicting request is being processed", + "message": "Conflicting request is being processed" + } + ] + } + } + } + } + } + }, + "500": { + "description": "In case a server error occurs in provider system a `500` (Internal Server Error) is returned\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "internalServerErrorExample": { + "summary": "Internal Server Error while processing Booking request\n", + "description": "An Internal Server Error has occurred - the consumer should contact {provider-support} and provide the `providerCorrelationID` (in the example this is `4426d965-0dd8-4005-8c63-dc68b01c4962`)\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "PUT", + "requestUri": "/v2/bookings/cbrr-123", + "statusCode": 500, + "statusCodeText": "Internal Server Error", + "errorMessage": "Internal Server Error occurred while processing Booking request", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Internal Error occurred", + "message": "Internal Error occurred" + } + ] + } + } + } + } + } + }, + "default": { + "description": "For other errors the error object should be populated with relevant information\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + }, + "examples": { + "tooManyRequestsExample": { + "summary": "Updating too many Bookings requests\n", + "description": "Calling the endPoint PUT /v2/bookings/cbrr-123 too many times within a timeperiod.\n\n**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a \"random example\"\n", + "value": { + "httpMethod": "PUT", + "requestUri": "/v2/bookings/cbrr-123", + "statusCode": 429, + "statusCodeText": "Too Many Requests", + "errorMessage": "Too many request to update a booking has been requested. Please try again in 1 hour", + "providerCorrelationID": "4426d965-0dd8-4005-8c63-dc68b01c4962", + "errorDateTime": "2023-04-13T07:41:00+08:30", + "errors": [ + { + "errorCode": 7003, + "reason": "Max Booking requests reached", + "message": "A maximum of 10 Bookings can be updated per hour" + } + ] + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "Booking" + ], + "summary": "Cancels the Booking or cancels a Booking Amendment\n", + "description": "A shipper initiated cancellation of the Booking or Booking Amendment. This endPoint corresponds with **UseCase 12 - Cancel Booking by shipper** or **UseCase 9 - Cancel amendment to confirmed Booking**.\n\n## Precondition\nIn order to cancel a booking, the status of the booking needs to be either\n- `RECEIVED`\n- `PENDING UPDATE`\n- `PENDING UPDATE CONFIRMATION`\n- `PENDING AMENDMENT`\n- `PENDING AMENDMENT APPROVAL`\n- `CONFIRMED`\n\n## Postcondition\nThe provider has received a cancellation from the consumer for a `Booking request` or for a `Confirmed Booking`.\n\nThe consumer will receive a `200` (OK) if the payload schema-validates or a `400` (Bad Request) if it does not.\n\n## Process\nThe following occurs when a provider recieves a cancellation request:\n1. The payload is schema-validated. In case the payload **is invalid** a `400` (Bad Request) is returned. The process stops.\n2. The payload is schema-valid\n3. The `bookingStatus` is set to `CANCELLED` and the `Booking request` or the `Confirmed Booking` can no longer be used.\n", + "operationId": "patchBooking", + "parameters": [ + { + "name": "bookingReference", + "in": "path", + "description": "This can be one of:\n- `carrierBookingRequestReference` (in case no carrierBookingReference has yet been appointed to the booking)\n- `carrierBookingReference`\n", + "required": true, + "style": "simple", + "explode": false, + "schema": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "example": "CBR001" + } + }, { - "url": "http://localhost:3000" + "name": "operation", + "in": "query", + "description": "Defines what is to be 'cancelled' - can be:\n- `cancelBooking` (cancels the entire booking)\n- `cancelAmendment` (cancels the amendment and keeps the booking)\n\nIn case cancelling an amendment is requested but no amendment is active - a `409` (Conflict) is returned\n", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "enum": [ + "cancelBooking", + "cancelAmendment" + ] + } + }, + { + "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": "2" + } } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bookings_bookingReference_body" + } + } + } + }, + "responses": { + "200": { + "description": "Booking has been cancellated\n", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bookingRefCancelledStatus" + } + } + } + }, + "default": { + "description": "Unexpected error", + "headers": { + "API-Version": { + "$ref": "#/components/headers/API-Version" + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + } + } + } } } }, "components": { "schemas": { - "BookingNotification": { - "title": "BookingNotification", + "postBooking": { "required": [ - "id", - "source", - "specversion", - "time", - "type" + "cargoMovementTypeAtDestination", + "cargoMovementTypeAtOrigin", + "communicationChannelCode", + "deliveryTypeAtDestination", + "isEquipmentSubstitutionAllowed", + "isExportDeclarationRequired", + "isImportLicenseRequired", + "isPartialLoadAllowed", + "receiptTypeAtOrigin", + "requestedEquipments" ], "type": "object", "properties": { - "specversion": { - "type": "string", - "example": "1.0", - "enum": [ - "1.0" - ] + "receiptTypeAtOrigin": { + "$ref": "#/components/schemas/receiptTypeAtOrigin" }, - "id": { - "maxLength": 100, - "type": "string", - "example": "3cecb101-7a1a-43a4-9d62-e88a131651e2" + "deliveryTypeAtDestination": { + "$ref": "#/components/schemas/deliveryTypeAtDestination" }, - "source": { - "maxLength": 4096, - "type": "string", - "example": "https://member.com/" + "cargoMovementTypeAtOrigin": { + "$ref": "#/components/schemas/cargoMovementTypeAtOrigin" }, - "type": { - "type": "string", - "example": "org.dcsa.bookingnotification.v1", - "enum": [ - "org.dcsa.bookingnotification.v1" - ] + "cargoMovementTypeAtDestination": { + "$ref": "#/components/schemas/cargoMovementTypeAtDestination" }, - "time": { - "type": "string", - "example": "2018-04-05T17:31:00Z" + "serviceContractReference": { + "$ref": "#/components/schemas/serviceContractReference" + }, + "freightPaymentTermCode": { + "$ref": "#/components/schemas/freightPaymentTermCode" + }, + "originChargesPaymentTermCode": { + "$ref": "#/components/schemas/originChargesPaymentTermCode" + }, + "destinationChargesPaymentTermCode": { + "$ref": "#/components/schemas/destinationChargesPaymentTermCode" + }, + "contractQuotationReference": { + "$ref": "#/components/schemas/contractQuotationReference" + }, + "vessel": { + "$ref": "#/components/schemas/postBooking_vessel" }, - "datacontenttype": { + "carrierServiceName": { + "$ref": "#/components/schemas/carrierServiceName" + }, + "carrierServiceCode": { + "$ref": "#/components/schemas/carrierServiceCode" + }, + "universalServiceReference": { + "$ref": "#/components/schemas/universalServiceReference" + }, + "carrierExportVoyageNumber": { + "$ref": "#/components/schemas/carrierExportVoyageNumber" + }, + "universalExportVoyageReference": { + "$ref": "#/components/schemas/universalExportVoyageReference" + }, + "declaredValue": { + "$ref": "#/components/schemas/declaredValue" + }, + "declaredValueCurrency": { + "$ref": "#/components/schemas/declaredValueCurrency" + }, + "isPartialLoadAllowed": { + "$ref": "#/components/schemas/isPartialLoadAllowed" + }, + "isExportDeclarationRequired": { + "$ref": "#/components/schemas/isExportDeclarationRequired" + }, + "exportDeclarationReference": { + "$ref": "#/components/schemas/exportDeclarationReference" + }, + "isImportLicenseRequired": { + "$ref": "#/components/schemas/isImportLicenseRequired" + }, + "importLicenseReference": { + "$ref": "#/components/schemas/importLicenseReference" + }, + "expectedDepartureDate": { + "$ref": "#/components/schemas/expectedDepartureDate" + }, + "expectedArrivalAtPlaceOfDeliveryStartDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryStartDate" + }, + "expectedArrivalAtPlaceOfDeliveryEndDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryEndDate" + }, + "transportDocumentTypeCode": { + "$ref": "#/components/schemas/transportDocumentTypeCode" + }, + "transportDocumentReference": { + "maxLength": 20, + "pattern": "^\\S+(\\s+\\S+)*$", "type": "string", - "example": "application/json", - "enum": [ - "application/json" + "description": "A unique reference allocated by the shipping line to the Transport Document that the booking concerns.\n", + "example": "reserved-HHL123" + }, + "bookingChannelReference": { + "$ref": "#/components/schemas/bookingChannelReference" + }, + "incoTerms": { + "$ref": "#/components/schemas/incoTerms" + }, + "communicationChannelCode": { + "$ref": "#/components/schemas/communicationChannelCode" + }, + "isEquipmentSubstitutionAllowed": { + "$ref": "#/components/schemas/isEquipmentSubstitutionAllowed" + }, + "invoicePayableAt": { + "type": "object", + "description": "General purpose object to capture `Invoice Payable At` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "Eiffel Tower", + "locationType": "UNLO", + "UNLocationCode": "FRPAR" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } ] }, - "data": { - "$ref": "#/components/schemas/BookingNotification_data" + "placeOfBLIssue": { + "type": "object", + "description": "General purpose object to capture `Place of B/L Issue` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "DCSA Headquarters", + "locationType": "UNLO", + "UNLocationCode": "NLAMS" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } + ] + }, + "references": { + "type": "array", + "description": "A list of `References`\n", + "items": { + "$ref": "#/components/schemas/reference" + } + }, + "documentParties": { + "type": "array", + "description": "A list of `Document Parties`\n", + "items": { + "$ref": "#/components/schemas/documentParty" + } + }, + "partyContactDetails": { + "type": "array", + "description": "The contact details of the person(s) to contact in relation to the **Booking** (changes, notifications etc.) \n", + "items": { + "$ref": "#/components/schemas/partyContactDetail" + } + }, + "shipmentLocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shipmentLocation" + } + }, + "requestedEquipments": { + "minLength": 1, + "type": "array", + "description": "List of `Requested Equipments`. Multiple containers can be requested within the same booking. For each Requested Equipment object with 2 or more units, it is a condition that the commodity (or list of commodities) defined within the same Requested Equipment object is the same for each requested unit.\n\n**Example:** 2 x 20' containing 50% shoes and 50% t-shirts can be requested within the same Requested Equipment object only if each 20' will contain 50% shoes and 50% t-shirts. If 1 x 20' will contain 100% shoes and the other 20' will be 100% t-shirts, 2 separate Requested Equipment objects must be defined.\n", + "items": { + "$ref": "#/components/schemas/requestedEquipment" + } } } }, - "BookingNotification_data": { + "receiptTypeAtOrigin": { + "maxLength": 3, + "type": "string", + "description": "Indicates the type of service offered at Origin. Options are defined in the Receipt/Delivery entity.\n- CY (Container yard (incl. rail ramp))\n- SD (Store Door)\n- CFS (Container Freight Station)\n", + "example": "CY", + "enum": [ + "CY", + "SD", + "CFS" + ] + }, + "deliveryTypeAtDestination": { + "maxLength": 3, + "type": "string", + "description": "Indicates the type of service offered at Destination. Options are defined in the Receipt/Delivery entity.\n- CY (Container yard (incl. rail ramp))\n- SD (Store Door)\n- CFS (Container Freight Station)\n", + "example": "CY", + "enum": [ + "CY", + "SD", + "CFS" + ] + }, + "cargoMovementTypeAtOrigin": { + "maxLength": 3, + "type": "string", + "description": "Refers to the shipment term at the loading of the cargo into the container. Options are defined in the Cargo Movement Type entity.\n- FCL (Full Container Load)\n- LCL (Less than Container Load)\n- BB (Break Bulk)\n", + "example": "FCL", + "enum": [ + "FCL", + "LCL", + "BB" + ] + }, + "cargoMovementTypeAtDestination": { + "maxLength": 3, + "type": "string", + "description": "Refers to the shipment term at the unloading of the cargo out of the container. Options are defined in the Cargo Movement Type entity.\n- FCL (Full Container Load)\n- LCL (Less than Container Load)\n- BB (Break Bulk)\n", + "example": "FCL", + "enum": [ + "FCL", + "LCL", + "BB" + ] + }, + "serviceContractReference": { + "maxLength": 30, + "type": "string", + "description": "Reference number for agreement between shipper and carrier through which the shipper commits to provide a certain minimum quantity of cargo over a fixed period, and the carrier commits to a certain rate or rate schedule.", + "example": "HHL51800000" + }, + "freightPaymentTermCode": { + "type": "string", + "description": "An indicator of whether freight and charges for the main transport are prepaid or collect.\n- PRE (Prepaid)\n- COL (Collect)\n", + "example": "PRE", + "enum": [ + "PRE", + "COL" + ] + }, + "originChargesPaymentTermCode": { + "type": "string", + "description": "An indicator of whether origin charges are prepaid or collect.\n- PRE (Prepaid)\n- COL (Collect)\n", + "example": "PRE", + "enum": [ + "PRE", + "COL" + ] + }, + "destinationChargesPaymentTermCode": { + "type": "string", + "description": "An indicator of whether destination charges are prepaid or collect.\n- PRE (Prepaid)\n- COL (Collect)\n", + "example": "PRE", + "enum": [ + "PRE", + "COL" + ] + }, + "contractQuotationReference": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Information provided by the shipper to identify whether pricing for the shipment has been agreed via a contract or a quotation reference. Mandatory if service contract (owner) is not provided.\n", + "example": "HHL1401" + }, + "vesselName": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The name of the Vessel given by the Vessel Operator and registered with IMO.\n", + "example": "King of the Seas" + }, + "vesselIMONumber": { + "maxLength": 7, + "pattern": "^\\d{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" + }, + "carrierServiceName": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The name of a service as specified by the carrier\n", + "example": "Great Lion Service" + }, + "carrierServiceCode": { + "maxLength": 11, + "pattern": "^\\S+(\\s+\\S+)*$", + "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" + }, + "carrierExportVoyageNumber": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The identifier of an export voyage. The carrier-specific identifier of the export Voyage.\n", + "example": "2103S" + }, + "universalExportVoyageReference": { + "pattern": "^\\d{2}[0-9A-Z]{2}[NEWSR]$", + "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}[NEWSR]`\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, `S`outh or `R`oundtrip).\n", + "example": "2103N" + }, + "declaredValue": { + "minimum": 0, + "type": "number", + "description": "The value of the cargo that the shipper declares to avoid the carrier's limitation of liability and \"Ad Valorem\" freight, i.e. freight which is calculated based on the value of the goods declared by the shipper.\n", + "format": "float", + "example": 1231.1 + }, + "declaredValueCurrency": { + "maxLength": 3, + "pattern": "^[A-Z]{3}$", + "type": "string", + "description": "The currency used for the declared value, using the 3-character code defined by [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).\n", + "example": "DKK" + }, + "isPartialLoadAllowed": { + "type": "boolean", + "description": "Indication whether the shipper agrees to load part of the shipment in case where not all of the cargo is delivered within cut-off.\n", + "example": true + }, + "isExportDeclarationRequired": { + "type": "boolean", + "description": "Information provided by the shipper whether an export declaration is required for this particular shipment/commodity/destination.\n", + "example": true + }, + "exportDeclarationReference": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A government document permitting designated goods to be shipped out of the country. Reference number assigned by an issuing authority to an Export License. The export license must be valid at time of departure. Required if Export declaration required is ‘True’.\n", + "example": "ABC123123" + }, + "isImportLicenseRequired": { + "type": "boolean", + "description": "Information provided by the shipper whether an import permit or license is required for this particular shipment/commodity/destination.\n", + "example": true + }, + "importLicenseReference": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A certificate, issued by countries exercising import controls, that permits importation of the articles stated in the license. Reference number assigned by an issuing authority to an Import License. The import license number must be valid at time of arrival. Required if import license required is ‘True’.\n", + "example": "ABC123123" + }, + "expectedDepartureDate": { + "type": "string", + "description": "The date when the shipment is expected to be loaded on board a vessel as provided by the shipper or its agent. If vessel/voyage or expected date of arrival is not provided, this is mandatory\n", + "format": "date", + "example": "2021-05-17" + }, + "expectedArrivalAtPlaceOfDeliveryStartDate": { + "type": "string", + "description": "The start date (provided as a range together with `expectedArrivalAtPlaceOfDeliveryEndDate`) for when the shipment is expected to arrive at final destination. If vessel/voyage or `expectedDepartureDate` is not provided, this is mandatory together with `expectedArrivalAtPlaceOfDeliveryEndDate`\n", + "format": "date", + "example": "2021-05-17" + }, + "expectedArrivalAtPlaceOfDeliveryEndDate": { + "type": "string", + "description": "The end date (provided as a range together with `expectedArrivalAtPlaceOfDeliveryStartDate`) for when the shipment is expected to arrive at final destination. If vessel/voyage or `expectedDepartureDate` is not provided, this is mandatory together with `expectedArrivalAtPlaceOfDeliveryStartDate`\n", + "format": "date", + "example": "2021-05-19" + }, + "transportDocumentTypeCode": { + "type": "string", + "description": "Specifies the type of the transport document\n- BOL (Bill of Lading)\n- SWB (Sea Waybill)\n", + "example": "SWB", + "enum": [ + "BOL", + "SWB" + ] + }, + "bookingChannelReference": { + "maxLength": 20, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Identification number provided by the platform/channel used for booking request/confirmation, ex: Inttra booking reference, or GTNexus, other. Conditional on booking channel being used\n", + "example": "Inttra reference" + }, + "incoTerms": { + "maxLength": 3, + "type": "string", + "description": "Transport obligations, costs and risks as agreed between buyer and seller as defined by [ICC](https://iccwbo.org/business-solutions/incoterms-rules/). A list of possible values:\n- EXW (Ex-Works)\n- FCA (Free Carrier)\n- FAS (Free Alongside Ship)\n- FOB (Free On Board)\n- CFR (Cost and Freight)\n- CIF (Cost, Insurance and Freigh)\n- CPT (Carriage Paid To)\n- CIP (Carriage And Insurance Paid To)\n- DAP (Delivered At Place)\n- DPU (Delivered At Place Unloaded)\n- DDP (Delivered Duty Paid)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/incotermscodes.csv)\n", + "example": "FCA" + }, + "communicationChannelCode": { + "maxLength": 2, + "type": "string", + "description": "Specifying which communication channel is to be used for this booking e.g.\n- EI (EDI transmission)\n- EM (Email)\n- AO (API)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/communicationchannelqualifier.csv)\n", + "example": "AO" + }, + "isEquipmentSubstitutionAllowed": { + "type": "boolean", + "description": "Indicates if an alternate equipment type can be provided by the carrier.\n", + "example": true + }, + "addressLocation": { "required": [ - "bookingStatus" + "address", + "locationType" ], "type": "object", "properties": { - "bookingStatus": { - "type": "string" + "locationName": { + "$ref": "#/components/schemas/locationName" }, - "carrierBookingReference": { - "type": "string" + "locationType": { + "type": "string", + "description": "Discriminator used to identify this as a `Address Location` interface\n", + "example": "ADDR" }, - "carrierBookingRequestReference": { - "type": "string" + "address": { + "$ref": "#/components/schemas/address" + } + }, + "description": "An interface used to express a location using an `Address` object\n" + }, + "locationName": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The name of the location.\n", + "example": "Port of Amsterdam" + }, + "address": { + "required": [ + "country", + "name" + ], + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/addressName" + }, + "street": { + "$ref": "#/components/schemas/streetName" + }, + "streetNumber": { + "$ref": "#/components/schemas/streetNumber" + }, + "floor": { + "$ref": "#/components/schemas/floor" + }, + "postCode": { + "$ref": "#/components/schemas/postCode" + }, + "city": { + "$ref": "#/components/schemas/cityName" + }, + "stateRegion": { + "$ref": "#/components/schemas/stateRegion" + }, + "country": { + "$ref": "#/components/schemas/country" } + }, + "description": "An object for storing address related information\n" + }, + "addressName": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Name of the address\n", + "example": "Henrik" + }, + "streetName": { + "maxLength": 100, + "type": "string", + "description": "The name of the street of the party’s address.", + "example": "Kronprinsessegade" + }, + "streetNumber": { + "maxLength": 50, + "type": "string", + "description": "The number of the street of the party’s address.", + "example": "54" + }, + "floor": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The floor of the party’s street number.\n", + "example": "5. sal" + }, + "postCode": { + "maxLength": 50, + "type": "string", + "description": "The post code of the party’s address.", + "example": "1306" + }, + "cityName": { + "maxLength": 65, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The city name of the party’s address.\n", + "example": "København" + }, + "stateRegion": { + "maxLength": 65, + "type": "string", + "description": "The state/region of the party’s address.", + "nullable": true, + "example": "Copenhagen" + }, + "country": { + "maxLength": 75, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The country of the party’s address.\n", + "example": "Denmark" + }, + "unLocationLocation": { + "required": [ + "UNLocationCode", + "locationType" + ], + "type": "object", + "properties": { + "locationName": { + "$ref": "#/components/schemas/locationName" + }, + "locationType": { + "type": "string", + "description": "Discriminator used to identify this as a `UNLocation` location interface\n", + "example": "UNLO" + }, + "UNLocationCode": { + "$ref": "#/components/schemas/UNLocationCode" + } + }, + "description": "An interface used to express a location using a `Un Location Code`\n" + }, + "UNLocationCode": { + "maxLength": 5, + "minLength": 5, + "pattern": "^[A-Z]{2}[A-Z2-9]{3}$", + "type": "string", + "description": "The UN Location code specifying where the place is located. The pattern used must be\n- 2 characters for the country code using [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n- 3 characters to code a location within that country. Letters A-Z and numbers from 2-9 can be used\n\nMore info can be found here: [UN/LOCODE](https://en.wikipedia.org/wiki/UN/LOCODE)\n", + "example": "FRPAR" + }, + "reference": { + "required": [ + "type", + "value" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/referenceType" + }, + "value": { + "$ref": "#/components/schemas/referenceValue" + } + }, + "description": "References provided by the shipper or freight forwarder at the time of booking or at the time of providing shipping instruction. Carriers share it back when providing track and trace event updates, some are also printed on the B/L. Customers can use these references to track shipments in their internal systems.\n" + }, + "referenceType": { + "maxLength": 3, + "type": "string", + "description": "The reference type codes defined by DCSA.\n- FF (Freight Forwarder’s Reference)\n- SI (Shipper’s Reference)\n- SPO (Shippers Purchase Order Reference)\n- CPO (Consignees Purchase Order Reference)\n- CR (Customer’s Reference)\n- AAO (Consignee’s Reference)\n- ECR (Empty container release reference)\n- CSI (Customer shipment ID)\n- BPR (Booking party reference number)\n- BID (Booking Request ID)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/referencetypes.csv).\n", + "example": "FF" + }, + "referenceValue": { + "maxLength": 100, + "type": "string", + "description": "The actual value of the reference. \n", + "example": "HHL00103004" + }, + "documentParty": { + "required": [ + "isToBeNotified", + "party", + "partyFunction" + ], + "type": "object", + "properties": { + "party": { + "$ref": "#/components/schemas/party" + }, + "partyFunction": { + "$ref": "#/components/schemas/partyFunction" + }, + "displayedAddress": { + "maxItems": 5, + "minItems": 1, + "type": "array", + "description": "If switch to paper is needed then the `displayedAddress` object **MUST** be provided. In case it is missing it is not possible to switch the B/L to paper later in the process.\n", + "items": { + "$ref": "#/components/schemas/addressLine" + } + }, + "isToBeNotified": { + "$ref": "#/components/schemas/isToBeNotified" + } + }, + "description": "stores the parties involved in the transport document." + }, + "party": { + "required": [ + "partyContactDetails", + "partyName" + ], + "type": "object", + "properties": { + "partyName": { + "$ref": "#/components/schemas/partyName" + }, + "address": { + "$ref": "#/components/schemas/address" + }, + "partyContactDetails": { + "minItems": 1, + "type": "array", + "description": "A list of contact details - the list cannot be empty\n", + "items": { + "$ref": "#/components/schemas/partyContactDetail" + } + }, + "identifyingCodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/identifyingCode" + } + }, + "taxLegalReferences": { + "type": "array", + "description": "A list of `Tax References` for a `Party`\n", + "items": { + "$ref": "#/components/schemas/taxLegalReference" + } + } + }, + "description": "refers to a company or a legal entity." + }, + "partyName": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Name of the party.\n", + "example": "Asseco Denmark" + }, + "partyContactDetail": { + "required": [ + "name" + ], + "properties": { + "name": { + "$ref": "#/components/schemas/contactName" + } + }, + "description": "The contact details of the person to contact. It is mandatory to provide either `phone` or `email` along with the `name`.\n", + "example": { + "name": "Henrik", + "phone": "+45 51801234" + }, + "oneOf": [ + { + "required": [ + "phone" + ], + "type": "object", + "properties": { + "phone": { + "$ref": "#/components/schemas/contactPhone" + }, + "email": { + "$ref": "#/components/schemas/email" + } + }, + "description": "`Phone` is mandatory to provide - `email` is optional\n" + }, + { + "required": [ + "email" + ], + "type": "object", + "properties": { + "phone": { + "$ref": "#/components/schemas/contactPhone" + }, + "email": { + "$ref": "#/components/schemas/email" + } + }, + "description": "`Email` is mandatory to provide - `phone` is optional\n" + } + ] + }, + "contactName": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Name of the contact\n", + "example": "Henrik" + }, + "identifyingCode": { + "required": [ + "DCSAResponsibleAgencyCode", + "partyCode" + ], + "type": "object", + "properties": { + "DCSAResponsibleAgencyCode": { + "$ref": "#/components/schemas/DCSAResponsibleAgencyCode" + }, + "partyCode": { + "$ref": "#/components/schemas/partyCode" + }, + "codeListName": { + "$ref": "#/components/schemas/codeListName" + } + } + }, + "DCSAResponsibleAgencyCode": { + "maxLength": 5, + "type": "string", + "description": "A DCSA provided code for [UN/CEFACT](https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred3055.htm) code list providers:\n- ISO (International Standards Organization)\n- UNECE (United Nations Economic Commission for Europe)\n- LLOYD (Lloyd's register of shipping)\n- BIC (Bureau International des Containeurs)\n- IMO (International Maritime Organization)\n- SCAC (Standard Carrier Alpha Code)\n- ITIGG (International Transport Implementation Guidelines Group)\n- ITU (International Telecommunication Union)\n- SMDG (Shipplanning Message Development Group)\n- EXIS (Exis Technologies Ltd.)\n- FMC (Federal Maritime Commission)\n- CBSA (Canada Border Services Agency)\n- DCSA (Digitial Container Shipping Association)\n- DID (Decentralized Identifier)\n- LEI (Legal Entity Identifier)\n- EPI (EBL Platform Identifier)\n- ZZZ (Mutually defined)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/codelistresponsibleagencycodes.csv).\n", + "example": "SMDG" + }, + "partyCode": { + "maxLength": 100, + "type": "string", + "description": "Code to identify the party as provided by the agency\n", + "example": "MSK" + }, + "codeListName": { + "maxLength": 100, + "type": "string", + "description": "The name of the list, provided by the responsible agency\n", + "example": "LCL" + }, + "taxLegalReference": { + "required": [ + "countryCode", + "type", + "value" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/taxLegalReferenceType" + }, + "countryCode": { + "$ref": "#/components/schemas/countryCode" + }, + "value": { + "$ref": "#/components/schemas/taxLegalReferenceValue" + } + }, + "description": "Reference that uniquely identifies a party for tax and/or legal purposes in accordance with the relevant jurisdiction.\n\nA list of examples:\n\n| Type | Country | Description |\n|-------|:-------:|-------------|\n|PAN|IN|Goods and Services Tax Identification Number in India|\n|GSTIN|IN|Goods and Services Tax Identification Number in India|\n|IEC|IN|Importer-Exported Code in India|\n|RUC|EC|Registro Único del Contribuyente in Ecuador|\n|RUC|PE|Registro Único del Contribuyente in Peru|\n|NIF|MG|Numéro d’Identification Fiscal in Madagascar|\n|NIF|DZ|Numéro d’Identification Fiscal in Algeria|\n\nAllowed combinations of `type` and `country` are maintained in [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/taxandlegalreferences.csv).\n" + }, + "taxLegalReferenceType": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The reference type code as defined by the relevant tax and/or legal authority.\n", + "example": "PAN" + }, + "countryCode": { + "maxLength": 2, + "minLength": 2, + "pattern": "^[A-Z]{2}$", + "type": "string", + "description": "The 2 characters for the country code using [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n", + "example": "DK" + }, + "taxLegalReferenceValue": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The value of the `taxLegalReference`\n", + "example": "AAAAA0000A" + }, + "partyFunction": { + "maxLength": 3, + "type": "string", + "description": "Specifies the role of the party in a given context\n- OS (Original shipper)\n- CN (Consignee)\n- COW (Invoice payer on behalf of the consignor (shipper))\n- COX (Invoice payer on behalf of the consignee)\n- MS (Document/message issuer/sender)\n- N1 (First Notify Party)\n- N2 (Second Notify Party)\n- NI (Other Notify Party)\n- DDR (Consignor's freight forwarder)\n- DDS (Consignee's freight forwarder)\n- HE (Carrier booking office (transportation office))\n- SCO (Service contract owner - Defined by DCSA)\n- BA (Booking Agency)\n- END (Endorsee Party)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/partyfunctioncodes.csv)\n", + "example": "DDS" + }, + "addressLine": { + "maxLength": 35, + "type": "string", + "description": "A single address line to be used when a B/L needs to be printed.\n", + "example": "Kronprincessegade 54" + }, + "isToBeNotified": { + "type": "boolean", + "description": "Used to decide whether the party will be notified of the arrival of the cargo.", + "example": true + }, + "shipmentLocation": { + "required": [ + "location", + "locationTypeCode" + ], + "type": "object", + "properties": { + "location": { + "description": "General purpose object to capture the location in the `ShipmentLocation`.\n\nThe location can be specified in **one** of the following ways: `UN Location Code`, `Facility` or an `Address`.\n", + "example": { + "locationName": "CMP Container Terminal Copenhagen", + "locationType": "FACI", + "UNLocationCode": "DKCPH", + "facilityCode": "CMPDK", + "facilityCodeListProvider": "SMDG" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "FACI": "#/components/schemas/facilityLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + }, + { + "$ref": "#/components/schemas/facilityLocation" + } + ] + }, + "locationTypeCode": { + "$ref": "#/components/schemas/shipmentLocationTypeCode" + }, + "eventDateTime": { + "$ref": "#/components/schemas/eventLocationDateTime" + } + }, + "description": "maps the relationship between Shipment and Location, e.g., the `Place of Receipt` and the `Place of Delivery` for a specific shipment. This is a reusable object between `Booking` and `Transport Document`\n" + }, + "facilityLocation": { + "required": [ + "facilityCode", + "facilityCodeListProvider", + "locationType" + ], + "type": "object", + "properties": { + "locationName": { + "$ref": "#/components/schemas/locationName" + }, + "locationType": { + "type": "string", + "description": "Discriminator used to identify this as a `Facility Location` interface\n", + "example": "FACI" + }, + "UNLocationCode": { + "allOf": [ + { + "$ref": "#/components/schemas/UNLocationCode" + }, + { + "description": "The UN Location code specifying where the place is located.\n\nThis field is **conditionally mandatory** depending on the value of the `facilityCodeListProvider` field.\n" + } + ] + }, + "facilityCode": { + "allOf": [ + { + "$ref": "#/components/schemas/facilityCode" + }, + { + "description": "The code used for identifying the specific facility. This code does not include the UN Location Code.\n\nThe definition of the code depends on the `facilityCodeListProvider`. As code list providers maintain multiple codeLists the following codeList is used:\n\n- for `SMDG` - the codeList used is the [SMDG Terminal Code List](https://smdg.org/wp-content/uploads/Codelists/Terminals/SMDG-Terminal-Code-List-v20210401.xlsx) \n- for `BIC` - the codeList used is the [BIC Facility Codes](https://www.bic-code.org/facility-codes/)\n" + } + ] + }, + "facilityCodeListProvider": { + "$ref": "#/components/schemas/facilityCodeListProvider" + } + }, + "description": "An interface used to express a location using a `Facility`. The facility can either be expressed using a `BIC` code or a `SMDG` code. The `facilityCode` does not contain the `UNLocationCode` - this should be provided in the `UnLocationCode` attribute.\n" + }, + "facilityCode": { + "maxLength": 6, + "pattern": "^\\S+(\\s+\\S+)*$", + "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" + }, + "facilityCodeListProvider": { + "type": "string", + "description": "The provider used for identifying the facility Code. Some facility codes are only defined in combination with an `UN Location Code`\n- BIC (Requires a UN Location Code)\n- SMDG (Requires a UN Location Code)\n", + "example": "SMDG", + "enum": [ + "BIC", + "SMDG" + ] + }, + "shipmentLocationTypeCode": { + "maxLength": 3, + "type": "string", + "description": "Links to the Location Type Code defined by DCSA.\n- PRE (Place of Receipt)\n- POL (Port of Loading)\n- POD (Port of Discharge)\n- PDE (Place of Delivery)\n- PCF (Pre-carriage From)\n- OIR (Onward In-land Routing)\n- DRL (Depot release location)\n- ORI (Origin of goods)\n- IEL (Container intermediate export stop off location)\n- PTP (Prohibited transshipment port)\n- RTP (Requested transshipment port)\n- FCD (Full container drop-off location)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/shipmentlocationtypes.csv)\n", + "example": "PRE" + }, + "eventLocationDateTime": { + "type": "string", + "description": "A date when the event is taking place at the location\n", + "format": "date-time", + "example": "2021-11-03T10:23:00-01:00" + }, + "requestedEquipment": { + "type": "object", + "properties": { + "commodities": { + "type": "array", + "description": "A list of `Commodities`\n", + "items": { + "$ref": "#/components/schemas/commodity" + } + } + }, + "description": "If needed - it is **only** possible to specify a single Reefer setting. If multiple settings are required for the same `equipmentSizeType` then multiple `requestedEquipment` should be specified (one for each Reefer setting).\n", + "allOf": [ + { + "$ref": "#/components/schemas/requestedEquipment_BASE" + } + ] + }, + "requestedEquipment_BASE": { + "required": [ + "ISOEquipmentCode", + "units" + ], + "type": "object", + "properties": { + "ISOEquipmentCode": { + "maxLength": 4, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Unique code for the different equipment size and type used to transport commodities. The code can refer to either the ISO size type (e.g. 22G1) or the ISO type group (e.g. 22GP) following the [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) standard.\n", + "example": "22RT" + }, + "units": { + "$ref": "#/components/schemas/requestedEquipmentUnits" + }, + "equipmentReferences": { + "type": "array", + "description": "A list of equipments to be used by the shipper if known at the time of booking\n", + "items": { + "$ref": "#/components/schemas/equipmentReference" + } + }, + "isNonOperatingReefer": { + "$ref": "#/components/schemas/isNonOperatingReefer" + }, + "activeReeferSettings": { + "required": [ + "temperatureSetpoint", + "temperatureUnit" + ], + "description": "The specifications for a Reefer equipment.\n\n**Condition:** Only applicable when`isNonOperatingReefer` is set to `false`\n", + "allOf": [ + { + "$ref": "#/components/schemas/activeReeferSettings_BKG" + } + ] + }, + "references": { + "type": "array", + "description": "A list of `References`\n", + "items": { + "$ref": "#/components/schemas/reference" + } + } + }, + "description": "If needed - it is **only** possible to specify a single Reefer setting. If multiple settings are required for the same `equipmentSizeType` then multiple `requestedEquipment` should be specified (one for each Reefer setting).\n", + "discriminator": { + "propertyName": "isShipperOwned", + "mapping": { + "true": "#/components/schemas/socEquipment", + "false": "#/components/schemas/nonSocEquipment" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/socEquipment" + }, + { + "$ref": "#/components/schemas/nonSocEquipment" + } + ] + }, + "socEquipment": { + "title": "Shipper owned Equipment", + "required": [ + "isShipperOwned", + "tareWeight", + "tareWeightUnit" + ], + "type": "object", + "properties": { + "tareWeight": { + "$ref": "#/components/schemas/tareWeight" + }, + "tareWeightUnit": { + "$ref": "#/components/schemas/weightUnit" + }, + "isShipperOwned": { + "$ref": "#/components/schemas/isShipperOwned" + } + } + }, + "tareWeight": { + "minimum": 0, + "exclusiveMinimum": true, + "type": "number", + "description": "The weight of an empty container (gross container weight).\n", + "format": "float", + "example": 4800 + }, + "weightUnit": { + "type": "string", + "description": "The unit of measure which can be expressed in imperial or metric terms\n- KGM (Kilograms)\n- LBR (Pounds)\n", + "example": "KGM", + "enum": [ + "KGM", + "LBR" + ] + }, + "isShipperOwned": { + "type": "boolean", + "description": "Indicates whether the container is shipper owned (SOC).", + "example": true + }, + "nonSocEquipment": { + "title": "Carrier owned Equipment", + "required": [ + "isShipperOwned" + ], + "type": "object", + "properties": { + "isShipperOwned": { + "type": "boolean", + "description": "Indicates whether the container is shipper owned (SOC).", + "example": false + } + } + }, + "requestedEquipmentUnits": { + "minimum": 1, + "type": "integer", + "description": "Number of requested equipment units.\n", + "format": "int32", + "example": 3 + }, + "equipmentReference": { + "maxLength": 11, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The unique identifier for the equipment, which should follow the BIC ISO Container Identification Number where possible.\nAccording to [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346), a container identification code consists of a 4-letter prefix and a 7-digit number (composed of a 3-letter owner code, a category identifier, a serial number, and a check-digit).\n\nIf a container does not comply with [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346), it is suggested to follow [Recommendation #2: Containers with non-ISO identification](https://smdg.org/documents/smdg-recommendations) from SMDG.\n", + "example": "APZU4812090" + }, + "isNonOperatingReefer": { + "type": "boolean", + "description": "If the equipment is a Reefer Container then setting this attribute will indicate that the container should be treated as a `DRY` container.\n\n**Condition:** Only applicable if `ISOEquipmentCode` shows a Reefer type.\n", + "example": false + }, + "activeReeferSettings_BKG": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/activeReeferSettings" + }, + { + "type": "object", + "properties": { + "isPreCoolingRequired": { + "$ref": "#/components/schemas/isPreCoolingRequired" + } + } + }, + { + "type": "object", + "properties": { + "isGeneratorSetRequired": { + "$ref": "#/components/schemas/isGeneratorSetRequired" + } + } + } + ] + }, + "activeReeferSettings": { + "type": "object", + "properties": { + "temperatureSetpoint": { + "$ref": "#/components/schemas/temperatureSetpoint" + }, + "temperatureUnit": { + "$ref": "#/components/schemas/temperatureUnit" + }, + "o2Setpoint": { + "$ref": "#/components/schemas/o2Setpoint" + }, + "co2Setpoint": { + "$ref": "#/components/schemas/co2Setpoint" + }, + "humiditySetpoint": { + "$ref": "#/components/schemas/humiditySetpoint" + }, + "airExchangeSetpoint": { + "$ref": "#/components/schemas/airExchangeSetpoint" + }, + "airExchangeUnit": { + "$ref": "#/components/schemas/airExchangeUnit" + }, + "isVentilationOpen": { + "$ref": "#/components/schemas/isVentilationOpen" + }, + "isDrainholesOpen": { + "$ref": "#/components/schemas/isDrainholesOpen" + }, + "isBulbMode": { + "$ref": "#/components/schemas/isBulbMode" + }, + "isColdTreatmentRequired": { + "$ref": "#/components/schemas/isColdTreatmentRequired" + }, + "isControlledAtmosphereRequired": { + "$ref": "#/components/schemas/isControlledAtmosphereRequired" + } + } + }, + "temperatureSetpoint": { + "type": "number", + "description": "Target value of the temperature for the Reefer based on the cargo requirement.\n", + "format": "float", + "example": -15 + }, + "temperatureUnit": { + "type": "string", + "description": "The unit for temperature in Celsius or Fahrenheit\n\n- CEL (Celsius)\n- FAH (Fahrenheit)\n", + "example": "CEL", + "enum": [ + "CEL", + "FAH" + ] + }, + "o2Setpoint": { + "maximum": 100, + "minimum": 0, + "type": "number", + "description": "The percentage of the controlled atmosphere O2 target value\n", + "format": "float", + "example": 75.3 + }, + "co2Setpoint": { + "maximum": 100, + "minimum": 0, + "type": "number", + "description": "The percentage of the controlled atmosphere CO2 target value\n", + "format": "float", + "example": 25 + }, + "humiditySetpoint": { + "maximum": 100, + "minimum": 0, + "type": "number", + "description": "The percentage of the controlled atmosphere humidity target value\n", + "format": "float", + "example": 95.6 + }, + "airExchangeSetpoint": { + "minimum": 0, + "type": "number", + "description": "Target value for the air exchange rate which is the rate at which outdoor air replaces indoor air within a Reefer container\n", + "format": "float", + "example": 15.4 + }, + "airExchangeUnit": { + "type": "string", + "description": "The unit for `airExchange` in metrics- or imperial- units per hour\n\n- MQH (Cubic metre per hour)\n- FQH (Cubic foot per hour)\n\n**NB:** This is a conditional field. If `airExchange` is specified then this field is required\n", + "example": "MQH", + "enum": [ + "MQH", + "FQH" + ] + }, + "isVentilationOpen": { + "type": "boolean", + "description": "If `true` the ventilation orifice is `Open` - if `false` the ventilation orifice is `closed`\n", + "example": true + }, + "isDrainholesOpen": { + "type": "boolean", + "description": "Is drainholes open on the container\n", + "example": true + }, + "isBulbMode": { + "type": "boolean", + "description": "Is special container setting for handling flower bulbs active\n", + "example": true + }, + "isColdTreatmentRequired": { + "type": "boolean", + "description": "Indicator whether cargo requires cold treatment prior to loading at origin or during transit, but prior arrival at POD\n", + "example": true + }, + "isControlledAtmosphereRequired": { + "type": "boolean", + "description": "Indicator of whether cargo requires Controlled Atmosphere.\n", + "example": true + }, + "isPreCoolingRequired": { + "type": "boolean", + "description": "Indicator whether reefer container should be pre-cooled to the temperature setting required at time of release from depot\n", + "example": true + }, + "isGeneratorSetRequired": { + "type": "boolean", + "description": "Indicator whether reefer container should have a generator set attached at time of release from depot\n", + "example": true + }, + "commodity": { + "required": [ + "cargoGrossWeight", + "cargoGrossWeightUnit", + "commodityType" + ], + "type": "object", + "properties": { + "commodityType": { + "$ref": "#/components/schemas/commodityType" + }, + "HSCodes": { + "type": "array", + "description": "A list of `HS Codes` that apply to this `commodity`\n", + "items": { + "$ref": "#/components/schemas/HSCode" + } + }, + "cargoGrossWeight": { + "$ref": "#/components/schemas/cargoGrossWeight" + }, + "cargoGrossWeightUnit": { + "$ref": "#/components/schemas/weightUnit" + }, + "cargoGrossVolume": { + "$ref": "#/components/schemas/cargoGrossVolume" + }, + "cargoGrossVolumeUnit": { + "$ref": "#/components/schemas/volumeUnit" + }, + "exportLicenseIssueDate": { + "$ref": "#/components/schemas/exportLicenseIssueDate" + }, + "exportLicenseExpiryDate": { + "$ref": "#/components/schemas/exportLicenseExpiryDate" + }, + "outerPackaging": { + "$ref": "#/components/schemas/outerPackaging" + }, + "references": { + "type": "array", + "description": "A list of `References`\n", + "items": { + "$ref": "#/components/schemas/reference" + } + } + }, + "description": "Type of goods, defined by its commodity type\n" + }, + "commodityType": { + "maxLength": 550, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "High-level description of goods to be shipped which allow the carrier to confirm acceptance and commercial terms. To be replaced by \"description of goods\" upon submission of shipping instruction\n", + "example": "Mobile phones" + }, + "HSCode": { + "maxLength": 10, + "minLength": 6, + "pattern": "^\\d{6,10}$", + "type": "string", + "description": "Used by customs to classify the product being shipped. More information can be found here: [Harmonized Commodity Description and Coding Systems (HS)](https://unstats.un.org/wiki/pages/viewpage.action?pageId=87426301) or here: [Harmonized System Codes](https://www.foreign-trade.com/reference/hscode.htm)\n", + "example": "851712" + }, + "cargoGrossWeight": { + "minimum": 0, + "exclusiveMinimum": true, + "type": "number", + "description": "The grand total weight of the cargo and weight per container(s) including packaging items being carried, which can be expressed in imperial or metric terms, as provided by the shipper. Excludes the tare weight of the container(s).'\n", + "format": "float", + "example": 12000 + }, + "cargoGrossVolume": { + "minimum": 0, + "exclusiveMinimum": true, + "type": "number", + "description": "The grand total volume of the commodity\n", + "format": "float", + "example": 120 + }, + "volumeUnit": { + "type": "string", + "description": "The unit of measure which can be expressed in either imperial or metric terms\n- FTQ (Cubic foot)\n- MTQ (Cubic meter)\n", + "example": "MTQ", + "enum": [ + "MTQ", + "FTQ" + ] + }, + "exportLicenseIssueDate": { + "type": "string", + "description": "Issue date of the export license applicable to the booking. Mandatory to provide in booking request for specific commodities\n", + "format": "date", + "example": "2021-05-14" + }, + "exportLicenseExpiryDate": { + "type": "string", + "description": "Expiry date of the export license applicable to the booking.\n\nMandatory to provide in booking request for specific commodities.\n", + "format": "date", + "example": "2021-05-21" + }, + "outerPackaging": { + "type": "object", + "properties": { + "packageCode": { + "$ref": "#/components/schemas/packageCode" + }, + "imoPackagingCode": { + "pattern": "^[A-Z0-9]{1,5}$", + "type": "string", + "description": "The code of the packaging as per IMO.\n\n**Condition:** only applicable to dangerous goods if specified in the IMO IMDG code amendment version 41-22. If not available, the `packageCode` as per UN recommendation 21 should be used.\n", + "example": "1A2" + }, + "numberOfPackages": { + "minimum": 1, + "type": "integer", + "description": "Specifies the number of outer packagings/overpacks associated with this `Commodity`.\n", + "format": "int32", + "example": 18 + }, + "description": { + "maxLength": 100, + "type": "string", + "description": "Description of the outer packaging/overpack.\n", + "example": "Drum, steel" + }, + "dangerousGoods": { + "minLength": 1, + "type": "array", + "description": "A list of `Dangerous Goods` related to the `Commodity`\n", + "items": { + "$ref": "#/components/schemas/dangerousGoods_BKG" + } + } + }, + "description": "Object for outer packaging/overpack specification. Examples of overpacks are a number of packages stacked on to a pallet and secured by strapping or placed in a protective outer packaging such as a box or crate to form one unit for the convenience of handling and stowage during transport. It is an array of the attributes below.\n\n**Conditional:** Mandatory for DG (Dangerous Goods) cargo.\n" + }, + "packageCode": { + "pattern": "^[A-Z0-9]{2}$", + "type": "string", + "description": "A code identifying the outer packaging/overpack. `PackageCode` must follow the codes specified in [Recommendation N°21 - Revision 12 Annexes V and VI](https://unece.org/sites/default/files/2021-06/rec21_Rev12e_Annex-V-VI_2021.xls)\n\n**Condition:** only applicable to dangerous goods if the `IMO packaging code` is not available.\n", + "example": "5H" + }, + "dangerousGoods_BKG": { + "required": [ + "emergencyContactDetails", + "grossWeight", + "imoClass", + "isCompetentAuthorityApprovalProvided", + "isEmptyUncleanedResidue", + "isExceptedQuantity", + "isHot", + "isLimitedQuantity", + "isMarinePollutant", + "isReportableQuantity", + "isSalvagePackings", + "isWaste", + "properShippingName" + ], + "type": "object", + "properties": { + "specialCertificateNumber": { + "$ref": "#/components/schemas/specialCertificateNumber" + }, + "additionalContainerCargoHandling": { + "$ref": "#/components/schemas/additionalContainerCargoHandling" + } + }, + "description": "Specification for `Dangerous Goods`. It is mandatory to either provide the `unNumber` or the `naNumber`. Dangerous Goods is based on **IMDG Amendment Version 41-22**.\n", + "allOf": [ + { + "$ref": "#/components/schemas/dangerousGoods_Base" + } + ] + }, + "dangerousGoods_Base": { + "type": "object", + "properties": { + "codedVariantList": { + "$ref": "#/components/schemas/codedVariantList" + }, + "properShippingName": { + "$ref": "#/components/schemas/properShippingName" + }, + "technicalName": { + "$ref": "#/components/schemas/technicalName" + }, + "imoClass": { + "$ref": "#/components/schemas/imoClass" + }, + "subsidiaryRisk1": { + "$ref": "#/components/schemas/subsidiaryRisk" + }, + "subsidiaryRisk2": { + "$ref": "#/components/schemas/subsidiaryRisk" + }, + "isMarinePollutant": { + "$ref": "#/components/schemas/isMarinePollutant" + }, + "packingGroup": { + "$ref": "#/components/schemas/packingGroup" + }, + "isLimitedQuantity": { + "$ref": "#/components/schemas/isLimitedQuantity" + }, + "isExceptedQuantity": { + "$ref": "#/components/schemas/isExceptedQuantity" + }, + "isSalvagePackings": { + "$ref": "#/components/schemas/isSalvagePackings" + }, + "isEmptyUncleanedResidue": { + "$ref": "#/components/schemas/isEmptyUncleanedResidue" + }, + "isWaste": { + "$ref": "#/components/schemas/isWaste" + }, + "isHot": { + "$ref": "#/components/schemas/isHot" + }, + "isCompetentAuthorityApprovalProvided": { + "$ref": "#/components/schemas/isCompetentAuthorityApprovalProvided" + }, + "competentAuthorityApproval": { + "$ref": "#/components/schemas/competentAuthorityApproval" + }, + "segregationGroups": { + "type": "array", + "description": "List of the segregation groups applicable to specific hazardous goods according to the IMO IMDG Code.\n\n**Condition:** only applicable to specific hazardous goods.\n", + "items": { + "maxLength": 2, + "type": "string", + "description": "Grouping of Dangerous Goods having certain similar chemical properties. Possible values are:\n\n- `1` (Acids)\n- `2` (Ammonium Compounds)\n- `3` (Bromates)\n- `4` (Chlorates)\n- `5` (Chlorites)\n- `6` (Cyanides)\n- `7` (Heavy metals and their salts)\n- `8` (Hypochlorites)\n- `9` (Lead and its compounds)\n- `10` (Liquid halogenated hydrocarbons)\n- `11` (Mercury and mercury compounds)\n- `12` (Nitrites and their mixtures)\n- `13` (Perchlorates)\n- `14` (Permanganates)\n- `15` (Powdered metals)\n- `16` (Peroxides),\n- `17` (Azides)\n- `18` (Alkalis)\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/segregationgroups.csv)\n", + "example": "12" + } + }, + "innerPackagings": { + "minLength": 1, + "type": "array", + "description": "A list of `Inner Packings` contained inside this `outer packaging/overpack`.\n", + "items": { + "$ref": "#/components/schemas/innerPackaging" + } + }, + "emergencyContactDetails": { + "$ref": "#/components/schemas/emergencyContactDetails" + }, + "EMSNumber": { + "$ref": "#/components/schemas/EMSNumber" + }, + "endOfHoldingTime": { + "$ref": "#/components/schemas/endOfHoldingTime" + }, + "fumigationDateTime": { + "$ref": "#/components/schemas/fumigationDateTime" + }, + "isReportableQuantity": { + "$ref": "#/components/schemas/isReportableQuantity" + }, + "inhalationZone": { + "$ref": "#/components/schemas/inhalationZone" + }, + "grossWeight": { + "$ref": "#/components/schemas/dangerousGoods_Base_grossWeight" + }, + "netWeight": { + "$ref": "#/components/schemas/dangerousGoods_Base_netWeight" + }, + "netExplosiveContent": { + "$ref": "#/components/schemas/dangerousGoods_Base_netExplosiveContent" + }, + "volume": { + "$ref": "#/components/schemas/dangerousGoods_Base_volume" + }, + "limits": { + "$ref": "#/components/schemas/limits" + } + }, + "oneOf": [ + { + "title": "UN Number", + "required": [ + "unNumber" + ], + "type": "object", + "properties": { + "unNumber": { + "$ref": "#/components/schemas/unNumber" + } + } + }, + { + "title": "NA Number", + "required": [ + "naNumber" + ], + "type": "object", + "properties": { + "naNumber": { + "$ref": "#/components/schemas/naNumber" + } + } + } + ] + }, + "codedVariantList": { + "pattern": "^[0-3][0-9A-Z]{3}$", + "type": "string", + "description": "Four-character code supplied by Exis Technologies that assists to remove ambiguities when identifying a variant within a single UN number or NA number that may occur when two companies exchange DG information.\n\nCharacter | Valid Characters | Description\n:--------:|------------------|------------\n1| 0, 1, 2, 3|The packing group. Code 0 indicates there is no packing group\n2|0 to 9 and A to Z|A sequence letter for the PSN, or 0 if there were no alternative PSNs\n3 and 4|0 to 9 and A to Z|Two sequence letters for other information, for the cases where the variant is required because of different in subrisks, packing instruction etc.\n", + "example": "2200" + }, + "properShippingName": { + "maxLength": 250, + "type": "string", + "description": "The proper shipping name for goods under IMDG Code, or the product name for goods under IBC Code and IGC Code, or the bulk cargo shipping name for goods under IMSBC Code, or the name of oil for goods under Annex I to the MARPOL Convention.\n", + "example": "Chromium Trioxide, anhydrous" + }, + "technicalName": { + "maxLength": 250, + "type": "string", + "description": "The recognized chemical or biological name or other name currently used for the referenced dangerous goods as described in chapter 3.1.2.8 of the IMDG Code.\n" + }, + "imoClass": { + "maxLength": 4, + "type": "string", + "description": "The hazard class code of the referenced dangerous goods according to the specified regulation. Examples of possible values are:\n \n - `1.1A` (Substances and articles which have a mass explosion hazard)\n - `1.6N` (Extremely insensitive articles which do not have a mass explosion hazard)\n - `2.1` (Flammable gases)\n - `8` (Corrosive substances)\n\nThe value must comply with one of the values in the [DG IMO Class value table](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/imoclasses.csv)\n", + "example": "1.4S" + }, + "subsidiaryRisk": { + "pattern": "^[0-9](\\.[0-9])?$", + "type": "string", + "description": "Any risk in addition to the class of the referenced dangerous goods according to the IMO IMDG Code.\n", + "example": "1.2" + }, + "isMarinePollutant": { + "type": "boolean", + "description": "Indicates if the goods belong to the classification of Marine Pollutant.\n", + "example": false + }, + "packingGroup": { + "maximum": 3, + "minimum": 1, + "type": "integer", + "description": "The packing group according to the UN Recommendations on the Transport of Dangerous Goods and IMO IMDG Code.\n", + "format": "int32", + "example": 3 + }, + "isLimitedQuantity": { + "type": "boolean", + "description": "Indicates if the dangerous goods can be transported as limited quantity in accordance with Chapter 3.4 of the IMO IMDG Code.\n", + "example": false + }, + "isExceptedQuantity": { + "type": "boolean", + "description": "Indicates if the dangerous goods can be transported as excepted quantity in accordance with Chapter 3.5 of the IMO IMDG Code.\n", + "example": false + }, + "isSalvagePackings": { + "type": "boolean", + "description": "Indicates if the cargo has special packaging for the transport, recovery or disposal of damaged, defective, leaking or nonconforming hazardous materials packages, or hazardous materials that have spilled or leaked.\n", + "example": false + }, + "isEmptyUncleanedResidue": { + "type": "boolean", + "description": "Indicates if the cargo is residue.\n", + "example": false + }, + "isWaste": { + "type": "boolean", + "description": "Indicates if waste is being shipped\n", + "example": false + }, + "isHot": { + "type": "boolean", + "description": "Indicates if high temperature cargo is shipped.\n", + "example": false + }, + "isCompetentAuthorityApprovalProvided": { + "type": "boolean", + "description": "Indicates if the cargo require approval from authorities\n", + "example": false + }, + "competentAuthorityApproval": { + "maxLength": 70, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Name and reference number of the competent authority providing the approval.\n", + "example": "{Name and reference...}" + }, + "innerPackaging": { + "required": [ + "description", + "material", + "quantity" + ], + "type": "object", + "properties": { + "quantity": { + "type": "integer", + "description": "Count of `Inner Packagings` of the referenced `Dangerous Goods`.\n", + "format": "int32", + "example": 20 + }, + "material": { + "maxLength": 100, + "type": "string", + "description": "The `material` used for the `Inner Packaging` of the referenced `Dangerous Goods`.\n", + "example": "Plastic" + }, + "description": { + "maxLength": 100, + "type": "string", + "description": "Description of the packaging.\n", + "example": "Wowen plastic water resistant Bag" + } + }, + "description": "Object for inner packaging specification\n" + }, + "emergencyContactDetails": { + "required": [ + "contact", + "phone" + ], + "type": "object", + "properties": { + "contact": { + "maxLength": 255, + "type": "string", + "description": "Name of the Contact person during an emergency.\n", + "example": "Henrik Larsen" + }, + "provider": { + "maxLength": 255, + "type": "string", + "description": "Name of the third party vendor providing emergency support\n", + "example": "GlobeTeam" + }, + "phone": { + "allOf": [ + { + "$ref": "#/components/schemas/contactPhone" + } + ] + }, + "referenceNumber": { + "maxLength": 255, + "type": "string", + "description": "Contract reference for the emergency support provided by an external third party vendor.\n", + "example": "12234" + } + }, + "description": "24 hr emergency contact details\n" + }, + "contactPhone": { + "maxLength": 30, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Phone number for the contact\n", + "example": "+45 70262970" + }, + "EMSNumber": { + "maxLength": 7, + "type": "string", + "description": "The emergency schedule identified in the IMO EmS Guide – Emergency Response Procedures for Ships Carrying Dangerous Goods. Comprises 2 values; 1 for spillage and 1 for fire. Possible values spillage: S-A to S-Z. Possible values fire: F-A to F-Z.\n", + "example": "F-A S-Q" + }, + "endOfHoldingTime": { + "type": "string", + "description": "Date by when the refrigerated liquid needs to be delivered.\n", + "format": "date", + "example": "2021-09-03" + }, + "fumigationDateTime": { + "type": "string", + "description": "Date & time when the container was fumigated\n", + "format": "date-time", + "example": "2021-09-03T09:03:00-02:00" + }, + "isReportableQuantity": { + "type": "boolean", + "description": "Indicates if a container of hazardous material is at the reportable quantity level. If `TRUE`, a report to the relevant authority must be made in case of spill.\n", + "example": false + }, + "inhalationZone": { + "maxLength": 1, + "minLength": 1, + "type": "string", + "description": "The zone classification of the toxicity of the inhalant. Possible values are:\n- `A` (Hazard Zone A) can be asigned to specific gases and liquids\n- `B` (Hazard Zone B) can be asigned to specific gases and liquids\n- `C` (Hazard Zone C) can **only** be asigned to specific gases\n- `D` (Hazard Zone D) can **only** be asigned to specific gases\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/inhalationzones.csv)\n", + "example": "A" + }, + "dgGrossWeight": { + "minimum": 0, + "exclusiveMinimum": true, + "type": "number", + "description": "The grand total weight of the DG cargo and weight per UNNumber/NANumber including packaging items being carried, which can be expressed in imperial or metric terms, as provided by the shipper.\n", + "format": "float", + "example": 12000 + }, + "netWeight": { + "type": "number", + "description": "Total weight of the goods carried, excluding packaging.\n", + "format": "float", + "example": 2.4 + }, + "netWeightUnit": { + "type": "string", + "description": "Unit of measure used to describe the `netWeight`. Possible values are\n- KGM (Kilograms)\n- LBR (Pounds)\n", + "example": "KGM", + "enum": [ + "KGM", + "LBR" + ] + }, + "netExplosiveContent": { + "type": "number", + "description": "The total weight of the explosive substances, without the packaging’s, casings, etc.\n", + "format": "float", + "example": 2.4 + }, + "netExplosiveContentUnit": { + "type": "string", + "description": "Unit of measure used to describe the `netExplosiveWeight`. Possible values are\n- KGM (Kilograms)\n- GRM (Grams)\n", + "example": "KGM", + "enum": [ + "KGM", + "GRM" + ] + }, + "dgVolume": { + "type": "number", + "description": "The volume of the referenced dangerous goods.\n", + "format": "float", + "example": 2.4 + }, + "volumeUnitDG": { + "type": "string", + "description": "The unit of measure which can be expressed in either imperial or metric terms\n- FTQ (Cubic foot)\n- MTQ (Cubic meter)\n- LTR (Litre)\n", + "example": "MTQ", + "enum": [ + "MTQ", + "FTQ", + "LTR" + ] + }, + "limits": { + "required": [ + "temperatureUnit" + ], + "type": "object", + "properties": { + "temperatureUnit": { + "type": "string", + "description": "The unit for **all attributes in the limits structure** in Celsius or Fahrenheit\n\n- CEL (Celsius)\n- FAH (Fahrenheit)\n", + "example": "CEL", + "enum": [ + "CEL", + "FAH" + ] + }, + "flashPoint": { + "$ref": "#/components/schemas/flashPoint" + }, + "transportControlTemperature": { + "$ref": "#/components/schemas/transportControlTemperature" + }, + "transportEmergencyTemperature": { + "$ref": "#/components/schemas/transportEmergencyTemperature" + }, + "SADT": { + "$ref": "#/components/schemas/sadt" + }, + "SAPT": { + "$ref": "#/components/schemas/sapt" + } + }, + "description": "Limits for the Dangerous Goods. The same `Temperature Unit` needs to apply to all attributes in this structure.\n" + }, + "flashPoint": { + "type": "number", + "description": "The flashpoint of the referenced dangerous goods according to the IMO IMDG Code expressed in degrees Celsius or Fahrenheit.\n", + "format": "float", + "example": 42 + }, + "transportControlTemperature": { + "type": "number", + "description": "Maximum temperature at which certain substance (such as organic peroxides and self-reactive and related substances) can be safely transported for a prolonged period.\n", + "format": "float", + "example": 24.1 + }, + "transportEmergencyTemperature": { + "type": "number", + "description": "Temperature at which emergency procedures shall be implemented\n", + "format": "float", + "example": 74.1 + }, + "sadt": { + "type": "number", + "description": "Lowest temperature in which self-accelerating decomposition may occur in a substance\n", + "format": "float", + "example": 54.1 + }, + "sapt": { + "type": "number", + "description": "Lowest temperature in which self-accelerating polymerization may occur in a substance\n", + "format": "float", + "example": 70 + }, + "specialCertificateNumber": { + "maxLength": 255, + "type": "string", + "description": "Text field to indicate certificate number & segment for specific stowage requirements overulling IMDG code\n", + "example": "22663:3" + }, + "additionalContainerCargoHandling": { + "maxLength": 255, + "type": "string", + "description": "Text field to provide cargo handling information already known at the booking stage.\n", + "example": "To be handled with extreme care" + }, + "bookingRefStatus": { + "required": [ + "bookingStatus" + ], + "type": "object", + "properties": { + "carrierBookingRequestReference": { + "$ref": "#/components/schemas/carrierBookingRequestReference" + }, + "carrierBookingReference": { + "$ref": "#/components/schemas/carrierBookingReference" + }, + "bookingStatus": { + "$ref": "#/components/schemas/bookingStatus" + }, + "requestedChanges": { + "$ref": "#/components/schemas/requestedChanges" + }, + "reason": { + "$ref": "#/components/schemas/reason" + } + }, + "description": "The `carrierBookingReference` or `carrierBookingRequestReference` along with the `bookingStatus` and a possible list of **requsted changes** or a **reason** is returned.\n\n**Condition:** `carrierBookingRequestReference` and/or `carrierBookingReference` is required\n" + }, + "carrierBookingRequestReference": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A reference to the booking during the booking request phase.\n\n**Conditional:** `carrierBookingRequestReference` and/or `carrierBookingReference` is required\n", + "example": "24595eb0-5cfc-4381-9c3a-cedc1975e9aa" + }, + "carrierBookingReference": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The `carrierBookingReference` if know. Often this will not be known until the booking has been confirmed. Is available during a booking amendment.\n\n**Conditional:** `carrierBookingRequestReference` and/or `carrierBookingReference` is required\n", + "example": "ABC709951" + }, + "bookingStatus": { + "maxLength": 50, + "type": "string", + "description": "The status of the `Booking`. Possible values are:\n- RECEIVED\n- PENDING UPDATE\n- PENDING UPDATE CONFIRMATION\n- PENDING AMENDMENT\n- PENDING AMENDMENT APPROVAL\n- CONFIRMED\n- REJECTED\n- DECLINED\n- CANCELLED\n- COMPLETED\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/bookingstatuses.csv).\n", + "example": "RECEIVED" + }, + "requestedChanges": { + "type": "array", + "description": "A list of changes requirested by the carrier to the document in order for it to be accepted.\n", + "items": { + "$ref": "#/components/schemas/requestedChange" + } + }, + "requestedChange": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "path": { + "maxLength": 500, + "type": "string", + "description": "A [JSONpath](https://github.com/json-path/JsonPath) describing where in the payload structure a particular error exists.\n", + "example": "location.facilityCode" + }, + "message": { + "maxLength": 500, + "type": "string", + "description": "A description of the problem that needs attention.\n", + "example": "Spaces not allowed in facility code" + } + }, + "description": "A change required to the document in order for the carrier to accepted it\n" + }, + "reason": { + "maxLength": 5000, + "type": "string", + "description": "This field can be used to explain bookingStatus.\n", + "example": "Rejected because of strike..." + }, + "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", + "example": "/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": 9999, + "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": 500, + "type": "string", + "description": "The field that caused the error, e.g. a failed validation. The field can be expressed as a [JSONpath](https://github.com/json-path/JsonPath)\n", + "example": "location.facilityCode" + }, + "value": { + "maxLength": 500, + "type": "string", + "description": "The value of the field that caused the error\n", + "example": "SG SIN WHS" + }, + "reason": { + "maxLength": 100, + "type": "string", + "description": "High level error message\n", + "example": "invalidData" + }, + "message": { + "maxLength": 200, + "type": "string", + "description": "Additional information as to why the error occured\n", + "example": "Spaces not allowed in facility code" + } + } + }, + "getBooking": { + "required": [ + "bookingStatus", + "cargoMovementTypeAtDestination", + "cargoMovementTypeAtOrigin", + "communicationChannelCode", + "deliveryTypeAtDestination", + "isEquipmentSubstitutionAllowed", + "isExportDeclarationRequired", + "isImportLicenseRequired", + "isPartialLoadAllowed", + "receiptTypeAtOrigin", + "requestedEquipments" + ], + "type": "object", + "properties": { + "carrierBookingRequestReference": { + "$ref": "#/components/schemas/carrierBookingRequestReference" + }, + "carrierBookingReference": { + "$ref": "#/components/schemas/carrierBookingReference" + }, + "bookingStatus": { + "$ref": "#/components/schemas/bookingStatus" + }, + "receiptTypeAtOrigin": { + "$ref": "#/components/schemas/receiptTypeAtOrigin" + }, + "deliveryTypeAtDestination": { + "$ref": "#/components/schemas/deliveryTypeAtDestination" + }, + "cargoMovementTypeAtOrigin": { + "$ref": "#/components/schemas/cargoMovementTypeAtOrigin" + }, + "cargoMovementTypeAtDestination": { + "$ref": "#/components/schemas/cargoMovementTypeAtDestination" + }, + "serviceContractReference": { + "$ref": "#/components/schemas/serviceContractReference" + }, + "freightPaymentTermCode": { + "$ref": "#/components/schemas/freightPaymentTermCode" + }, + "originChargesPaymentTermCode": { + "$ref": "#/components/schemas/originChargesPaymentTermCode" + }, + "destinationChargesPaymentTermCode": { + "$ref": "#/components/schemas/destinationChargesPaymentTermCode" + }, + "contractQuotationReference": { + "$ref": "#/components/schemas/contractQuotationReference" + }, + "vessel": { + "$ref": "#/components/schemas/postBooking_vessel" + }, + "carrierServiceName": { + "$ref": "#/components/schemas/carrierServiceName" + }, + "carrierServiceCode": { + "$ref": "#/components/schemas/carrierServiceCode" + }, + "universalServiceReference": { + "$ref": "#/components/schemas/universalServiceReference" + }, + "carrierExportVoyageNumber": { + "$ref": "#/components/schemas/carrierExportVoyageNumber" + }, + "universalExportVoyageReference": { + "$ref": "#/components/schemas/universalExportVoyageReference" + }, + "declaredValue": { + "$ref": "#/components/schemas/declaredValue" + }, + "declaredValueCurrency": { + "$ref": "#/components/schemas/declaredValueCurrency" + }, + "isPartialLoadAllowed": { + "$ref": "#/components/schemas/isPartialLoadAllowed" + }, + "isExportDeclarationRequired": { + "$ref": "#/components/schemas/isExportDeclarationRequired" + }, + "exportDeclarationReference": { + "$ref": "#/components/schemas/exportDeclarationReference" + }, + "isImportLicenseRequired": { + "$ref": "#/components/schemas/isImportLicenseRequired" + }, + "importLicenseReference": { + "$ref": "#/components/schemas/importLicenseReference" + }, + "expectedDepartureDate": { + "$ref": "#/components/schemas/expectedDepartureDate" + }, + "expectedArrivalAtPlaceOfDeliveryStartDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryStartDate" + }, + "expectedArrivalAtPlaceOfDeliveryEndDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryEndDate" + }, + "transportDocumentTypeCode": { + "$ref": "#/components/schemas/transportDocumentTypeCode" + }, + "transportDocumentReference": { + "maxLength": 20, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A unique reference allocated by the shipping line to the Transport Document that the booking concerns.\n", + "example": "reserved-HHL123" + }, + "bookingChannelReference": { + "$ref": "#/components/schemas/bookingChannelReference" + }, + "incoTerms": { + "$ref": "#/components/schemas/incoTerms" + }, + "communicationChannelCode": { + "$ref": "#/components/schemas/communicationChannelCode" + }, + "isEquipmentSubstitutionAllowed": { + "$ref": "#/components/schemas/isEquipmentSubstitutionAllowed" + }, + "termsAndConditions": { + "$ref": "#/components/schemas/termsAndConditions" + }, + "invoicePayableAt": { + "type": "object", + "description": "General purpose object to capture `Invoice Payable At` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "Eiffel Tower", + "locationType": "UNLO", + "UNLocationCode": "FRPAR" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } + ] + }, + "placeOfBLIssue": { + "type": "object", + "description": "General purpose object to capture `Place of B/L Issue` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "DCSA Headquarters", + "locationType": "UNLO", + "UNLocationCode": "NLAMS" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } + ] + }, + "references": { + "type": "array", + "description": "A list of `References`\n", + "items": { + "$ref": "#/components/schemas/reference" + } + }, + "documentParties": { + "type": "array", + "description": "A list of `Document Parties`\n", + "items": { + "$ref": "#/components/schemas/documentParty" + } + }, + "partyContactDetails": { + "type": "array", + "description": "The contact details of the person(s) to contact in relation to the **Booking** (changes, notifications etc.) \n", + "items": { + "$ref": "#/components/schemas/partyContactDetail" + } + }, + "shipmentLocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shipmentLocation" + } + }, + "requestedEquipments": { + "minLength": 1, + "type": "array", + "description": "List of `Requested Equipments`. Multiple containers can be requested within the same booking. For each Requested Equipment object with 2 or more units, it is a condition that the commodity (or list of commodities) defined within the same Requested Equipment object is the same for each requested unit.\n\n**Example:** 2 x 20' containing 50% shoes and 50% t-shirts can be requested within the same Requested Equipment object only if each 20' will contain 50% shoes and 50% t-shirts. If 1 x 20' will contain 100% shoes and the other 20' will be 100% t-shirts, 2 separate Requested Equipment objects must be defined.\n", + "items": { + "$ref": "#/components/schemas/requestedEquipment_CONF" + } + }, + "confirmedEquipments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/confirmedEquipment" + } + }, + "transportPlan": { + "type": "array", + "description": "A list of `transport` objects describing the entire transport plan including transshipments.\n\n**Conditional:** Mandatory for a `CONFIRMED` Booking\n", + "items": { + "$ref": "#/components/schemas/transport" + } + }, + "shipmentCutOffTimes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shipmentCutOffTime" + } + }, + "advanceManifestFilings": { + "minLength": 1, + "type": "array", + "description": "A list of `Advance Manifest Filings` provided by the carrier\n", + "items": { + "$ref": "#/components/schemas/advanceManifestFiling_BKG" + } + }, + "charges": { + "maxLength": 1, + "type": "array", + "description": "A list of `Charges`\n", + "items": { + "$ref": "#/components/schemas/charge" + } + }, + "carrierClauses": { + "type": "array", + "description": "Additional clauses for a specific shipment added by the carrier to the Bill of Lading, subject to local rules / guidelines or certain mandatory information required to be shared with the customer.\n", + "items": { + "$ref": "#/components/schemas/clauseContent" + } + }, + "requestedChanges": { + "$ref": "#/components/schemas/requestedChanges" + }, + "reason": { + "$ref": "#/components/schemas/reason" + } + } + }, + "termsAndConditions": { + "maxLength": 20000, + "type": "string", + "description": "Carrier terms and conditions of transport.\n" + }, + "requestedEquipment_CONF": { + "type": "object", + "properties": { + "commodities": { + "type": "array", + "description": "A list of `Commodities`\n", + "items": { + "$ref": "#/components/schemas/commodity_CONF" + } + } + }, + "description": "If needed - it is **only** possible to specify a single Reefer setting. If multiple settings are required for the same `equipmentSizeType` then multiple `requestedEquipment` should be specified (one for each Reefer setting).\n", + "allOf": [ + { + "$ref": "#/components/schemas/requestedEquipment_BASE" + } + ] + }, + "commodity_CONF": { + "type": "object", + "properties": { + "commoditySubreference": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A unique reference for this commodity object assigned by the carrier in the booking confirmation. The reference must be provided by the shipper as part of the Shipping Instructions for the carrier to link the consignment item to this commodity. A commodity reference is only unique in the context of a booking.\n\n**Conditional:** Mandatory to provide for `CONFIRMED` bookings\n", + "example": "COM-001" + } + }, + "description": "Type of goods, defined by its commodity type\n", + "allOf": [ + { + "$ref": "#/components/schemas/commodity" + } + ] + }, + "confirmedEquipment": { + "required": [ + "ISOEquipmentCode", + "units" + ], + "type": "object", + "properties": { + "ISOEquipmentCode": { + "$ref": "#/components/schemas/ISOEquipmentCode" + }, + "units": { + "$ref": "#/components/schemas/confirmedEquipmentUnits" + } + }, + "description": "The confirmed equipments for the booking\n" + }, + "ISOEquipmentCode": { + "maxLength": 4, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Unique code for the different equipment size and type used to transport commodities. The code can refer to either the ISO size type (e.g. 22G1) or the ISO type group (e.g. 22GP) following the [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) standard.\n", + "example": "22GP" + }, + "confirmedEquipmentUnits": { + "minimum": 1, + "type": "integer", + "description": "Number of confirmed equipment units\n", + "format": "int32", + "example": 3 + }, + "transport": { + "required": [ + "dischargeLocation", + "loadLocation", + "plannedArrivalDate", + "plannedDepartureDate", + "transportPlanStage", + "transportPlanStageSequenceNumber" + ], + "type": "object", + "properties": { + "transportPlanStage": { + "$ref": "#/components/schemas/transportPlanStage" + }, + "transportPlanStageSequenceNumber": { + "$ref": "#/components/schemas/transportPlanStageSequenceNumber" + }, + "loadLocation": { + "$ref": "#/components/schemas/loadLocation" + }, + "dischargeLocation": { + "$ref": "#/components/schemas/dischargeLocation" + }, + "plannedDepartureDate": { + "$ref": "#/components/schemas/plannedDepartureDate" + }, + "plannedArrivalDate": { + "$ref": "#/components/schemas/plannedArrivalDate" + }, + "modeOfTransport": { + "$ref": "#/components/schemas/modeOfTransport" + }, + "vesselName": { + "$ref": "#/components/schemas/vesselName" + }, + "vesselIMONumber": { + "$ref": "#/components/schemas/vesselIMONumber" + }, + "carrierSerivceCode": { + "$ref": "#/components/schemas/carrierServiceCode" + }, + "universalServiceReference": { + "$ref": "#/components/schemas/universalServiceReference" + }, + "carrierImportVoyageNumber": { + "$ref": "#/components/schemas/carrierImportVoyageNumber" + }, + "universalImportVoyageReference": { + "$ref": "#/components/schemas/universalImportVoyageReference" + }, + "carrierExportVoyageNumber": { + "$ref": "#/components/schemas/carrierExportVoyageNumber" + }, + "universalExportVoyageReference": { + "$ref": "#/components/schemas/universalExportVoyageReference" + } + }, + "description": "A list of `transport` objects sorted by ShipmentTransport sequenceNumber\n" + }, + "transportPlanStage": { + "type": "string", + "description": "Code qualifying a specific stage of transport e.g. pre-carriage, main carriage transport or on-carriage transport\n- PRC (Pre-Carriage)\n- MNC (Main Carriage Transport)\n- ONC (On-Carriage Transport)\n", + "example": "PRC", + "enum": [ + "PRC", + "MNC", + "ONC" + ] + }, + "transportPlanStageSequenceNumber": { + "type": "integer", + "description": "Sequence number of the transport plan stage\n", + "format": "int32", + "example": 5 + }, + "loadLocation": { + "description": "General purpose object to capture the `Load Location`.\n\nThe location can be specified in **one** of the following ways: `UN Location Code`, `Facility` or an `Address`.\n", + "example": { + "locationName": "Shanghai Shengdong International Container Terminal", + "locationType": "FACI", + "UNLocationCode": "CNSGH", + "facilityCode": "SHENG", + "facilityCodeListProvider": "SMDG" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "FACI": "#/components/schemas/facilityLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + }, + { + "$ref": "#/components/schemas/facilityLocation" + } + ] + }, + "dischargeLocation": { + "description": "General purpose object to capture the `Discharge Location`.\n\nThe location can be specified in **one** of the following ways: `UN Location Code`, `Facility` or an `Address`.\n", + "example": { + "locationName": "Transnet Port Terminals Cape Town", + "locationType": "FACI", + "UNLocationCode": "ZACPT", + "facilityCode": "TNCT", + "facilityCodeListProvider": "SMDG" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "FACI": "#/components/schemas/facilityLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + }, + { + "$ref": "#/components/schemas/facilityLocation" + } + ] + }, + "plannedDepartureDate": { + "type": "string", + "description": "The planned date of departure.\n", + "format": "date" + }, + "plannedArrivalDate": { + "type": "string", + "description": "The planned date of arrival.\n", + "format": "date" + }, + "modeOfTransport": { + "maxLength": 50, + "type": "string", + "description": "The mode of transport as defined by DCSA. The currently supported values include:\n- VESSEL\n- RAIL\n- TRUCK\n- BARGE\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/modeoftransportcodes.csv)\n", + "example": "VESSEL" + }, + "carrierImportVoyageNumber": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The identifier of an import voyage. The carrier-specific identifier of the import Voyage.\n", + "example": "2103N" + }, + "universalImportVoyageReference": { + "pattern": "^\\d{2}[0-9A-Z]{2}[NEWSR]$", + "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}[NEWSR]`\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, `S`outh or `R`oundtrip).\n", + "example": "2103N" + }, + "shipmentCutOffTime": { + "required": [ + "cutOffDateTime", + "cutOffDateTimeCode" + ], + "type": "object", + "properties": { + "cutOffDateTimeCode": { + "$ref": "#/components/schemas/cutOffDateTimeCode" + }, + "cutOffDateTime": { + "$ref": "#/components/schemas/cutOffDateTime" + } + }, + "description": "Cut off times\n" + }, + "cutOffDateTimeCode": { + "maxLength": 3, + "type": "string", + "description": "Code for the cut-off time\n- DCO (Documentation cut-off)\n- VCO (VGM cut-off)\n- FCO (FCL delivery cut-off)\n- LCO (LCL delivery cut-off)\n- ECP (Empty container pick-up date and time)\n- EFC (Earliest full-container delivery date)\n\n**LCO Condition:** only when the `Receipt Type at Origin` is `CFS`\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/cutofftimecodes.csv)\n", + "example": "DCO" + }, + "cutOffDateTime": { + "type": "string", + "description": "Actual cut-off time\n", + "format": "date-time", + "example": "2019-11-12T07:41:00-08:30" + }, + "advanceManifestFiling_BKG": { + "required": [ + "countryCode", + "manifestTypeCode" + ], + "type": "object", + "properties": { + "manifestTypeCode": { + "$ref": "#/components/schemas/manifestTypeCode" + }, + "countryCode": { + "$ref": "#/components/schemas/countryCode" + } + }, + "description": "An Advance Maifest Filing defined by a Manifest type code in combination with a country code.\n\nA list of `manifestTypeCodes` together with `countryCode` is maintained in [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/advancedmanifestfilings.csv). A (small) subset can be seen here:\n\n| manifestTypeCode | countryCode | Description |\n|-----------------------|:-------------:|-------------|\n|ACI|EG|Advance Cargo Information in Egypt|\n|ACE|US|Automated Commercial Environment in the United States|\n|AFR|JP|Cargo Summary Notification (CSN)|\n", + "example": { + "manifestTypeCode": "ACE", + "countryCode": "US" + } + }, + "manifestTypeCode": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The Manifest type code as defined by the provider. A list of `manifestTypeCodes` together with `countryCode` is maintained in [GitHub (to be created)]()\n", + "example": "ACE" + }, + "charge": { + "required": [ + "calculationBasis", + "chargeName", + "currencyAmount", + "currencyCode", + "paymentTermCode", + "quantity", + "unitPrice" + ], + "type": "object", + "properties": { + "chargeName": { + "$ref": "#/components/schemas/chargeName" + }, + "currencyAmount": { + "$ref": "#/components/schemas/currencyAmount" + }, + "currencyCode": { + "$ref": "#/components/schemas/currencyCode" + }, + "paymentTermCode": { + "$ref": "#/components/schemas/paymentTermCode" + }, + "calculationBasis": { + "$ref": "#/components/schemas/calculationBasis" + }, + "unitPrice": { + "$ref": "#/components/schemas/unitPrice" + }, + "quantity": { + "$ref": "#/components/schemas/quantity" + } + }, + "description": "addresses the monetary value of freight and other service charges for a transport document.\n" + }, + "chargeName": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "Free text field describing the charge to apply\n", + "example": "Documentation fee - Destination" + }, + "currencyAmount": { + "minimum": 0, + "type": "number", + "description": "The monetary value of all freight and other service charges for a transport document, with a maximum of 2-digit decimals.\n", + "format": "float", + "example": 1012.12 + }, + "currencyCode": { + "maxLength": 3, + "pattern": "^[A-Z]{3}$", + "type": "string", + "description": "The currency for the charge, using a 3-character code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)).\n", + "example": "DKK" + }, + "paymentTermCode": { + "type": "string", + "description": "Indicates whether freight & charges are due for payment before the shipment is effected, practically before the transport document is released to shipper (Prepaid) or before the shipment is finalized meaning cargo released to consignee (Collect)\n- PRE (Prepaid)\n- COL (Collect)\n", + "example": "PRE", + "enum": [ + "PRE", + "COL" + ] + }, + "calculationBasis": { + "maxLength": 50, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The code specifying the measure unit used for the corresponding unit price for this cost, such as per day, per ton, per square metre.", + "example": "Per day" + }, + "unitPrice": { + "minimum": 0, + "type": "number", + "description": "The unit price of this charge item in the currency of the charge.\n", + "format": "float", + "example": 3456.6 + }, + "quantity": { + "minimum": 0, + "type": "number", + "description": "The amount of unit for this charge item.\n", + "format": "float", + "example": 34.4 + }, + "clauseContent": { + "maxLength": 20000, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The content of the clause.\n", + "example": "It is not allowed to..." + }, + "putBooking": { + "required": [ + "cargoMovementTypeAtDestination", + "cargoMovementTypeAtOrigin", + "communicationChannelCode", + "deliveryTypeAtDestination", + "isEquipmentSubstitutionAllowed", + "isExportDeclarationRequired", + "isImportLicenseRequired", + "isPartialLoadAllowed", + "receiptTypeAtOrigin", + "requestedEquipments" + ], + "type": "object", + "properties": { + "carrierBookingRequestReference": { + "$ref": "#/components/schemas/carrierBookingRequestReference" + }, + "carrierBookingReference": { + "$ref": "#/components/schemas/carrierBookingReference" + }, + "receiptTypeAtOrigin": { + "$ref": "#/components/schemas/receiptTypeAtOrigin" + }, + "deliveryTypeAtDestination": { + "$ref": "#/components/schemas/deliveryTypeAtDestination" + }, + "cargoMovementTypeAtOrigin": { + "$ref": "#/components/schemas/cargoMovementTypeAtOrigin" + }, + "cargoMovementTypeAtDestination": { + "$ref": "#/components/schemas/cargoMovementTypeAtDestination" + }, + "serviceContractReference": { + "$ref": "#/components/schemas/serviceContractReference" + }, + "freightPaymentTermCode": { + "$ref": "#/components/schemas/freightPaymentTermCode" + }, + "originChargesPaymentTermCode": { + "$ref": "#/components/schemas/originChargesPaymentTermCode" + }, + "destinationChargesPaymentTermCode": { + "$ref": "#/components/schemas/destinationChargesPaymentTermCode" + }, + "contractQuotationReference": { + "$ref": "#/components/schemas/contractQuotationReference" + }, + "vessel": { + "$ref": "#/components/schemas/postBooking_vessel" + }, + "carrierServiceName": { + "$ref": "#/components/schemas/carrierServiceName" + }, + "carrierServiceCode": { + "$ref": "#/components/schemas/carrierServiceCode" + }, + "universalServiceReference": { + "$ref": "#/components/schemas/universalServiceReference" + }, + "carrierExportVoyageNumber": { + "$ref": "#/components/schemas/carrierExportVoyageNumber" + }, + "universalExportVoyageReference": { + "$ref": "#/components/schemas/universalExportVoyageReference" + }, + "declaredValue": { + "$ref": "#/components/schemas/declaredValue" + }, + "declaredValueCurrency": { + "$ref": "#/components/schemas/declaredValueCurrency" + }, + "isPartialLoadAllowed": { + "$ref": "#/components/schemas/isPartialLoadAllowed" + }, + "isExportDeclarationRequired": { + "$ref": "#/components/schemas/isExportDeclarationRequired" + }, + "exportDeclarationReference": { + "$ref": "#/components/schemas/exportDeclarationReference" + }, + "isImportLicenseRequired": { + "$ref": "#/components/schemas/isImportLicenseRequired" + }, + "importLicenseReference": { + "$ref": "#/components/schemas/importLicenseReference" + }, + "expectedDepartureDate": { + "$ref": "#/components/schemas/expectedDepartureDate" + }, + "expectedArrivalAtPlaceOfDeliveryStartDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryStartDate" + }, + "expectedArrivalAtPlaceOfDeliveryEndDate": { + "$ref": "#/components/schemas/expectedArrivalAtPlaceOfDeliveryEndDate" + }, + "transportDocumentTypeCode": { + "$ref": "#/components/schemas/transportDocumentTypeCode" + }, + "transportDocumentReference": { + "maxLength": 20, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A unique reference allocated by the shipping line to the Transport Document that the booking concerns.\n", + "example": "reserved-HHL123" + }, + "bookingChannelReference": { + "$ref": "#/components/schemas/bookingChannelReference" + }, + "incoTerms": { + "$ref": "#/components/schemas/incoTerms" + }, + "communicationChannelCode": { + "$ref": "#/components/schemas/communicationChannelCode" + }, + "isEquipmentSubstitutionAllowed": { + "$ref": "#/components/schemas/isEquipmentSubstitutionAllowed" + }, + "invoicePayableAt": { + "type": "object", + "description": "General purpose object to capture `Invoice Payable At` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "Eiffel Tower", + "locationType": "UNLO", + "UNLocationCode": "FRPAR" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } + ] + }, + "placeOfBLIssue": { + "type": "object", + "description": "General purpose object to capture `Place of B/L Issue` location.\n\nThe location can be specified in **one** of the following ways: `UN Location Code` or an `Address`.\n", + "example": { + "locationName": "DCSA Headquarters", + "locationType": "UNLO", + "UNLocationCode": "NLAMS" + }, + "discriminator": { + "propertyName": "locationType", + "mapping": { + "ADDR": "#/components/schemas/addressLocation", + "UNLO": "#/components/schemas/unLocationLocation" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/addressLocation" + }, + { + "$ref": "#/components/schemas/unLocationLocation" + } + ] + }, + "references": { + "type": "array", + "description": "A list of `References`\n", + "items": { + "$ref": "#/components/schemas/reference" + } + }, + "documentParties": { + "type": "array", + "description": "A list of `Document Parties`\n", + "items": { + "$ref": "#/components/schemas/documentParty" + } + }, + "partyContactDetails": { + "type": "array", + "description": "The contact details of the person(s) to contact in relation to the **Booking** (changes, notifications etc.) \n", + "items": { + "$ref": "#/components/schemas/partyContactDetail" + } + }, + "shipmentLocations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shipmentLocation" + } + }, + "requestedEquipments": { + "minLength": 1, + "type": "array", + "description": "List of `Requested Equipments`. Multiple containers can be requested within the same booking. For each Requested Equipment object with 2 or more units, it is a condition that the commodity (or list of commodities) defined within the same Requested Equipment object is the same for each requested unit.\n\n**Example:** 2 x 20' containing 50% shoes and 50% t-shirts can be requested within the same Requested Equipment object only if each 20' will contain 50% shoes and 50% t-shirts. If 1 x 20' will contain 100% shoes and the other 20' will be 100% t-shirts, 2 separate Requested Equipment objects must be defined.\n", + "items": { + "$ref": "#/components/schemas/requestedEquipment" + } + } + } + }, + "bookingStatusCancelled": { + "maxLength": 50, + "type": "string", + "description": "The status of the booking can only be set to cancelled:\n- CANCELLED\n", + "example": "CANCELLED" + }, + "bookingRefCancelledStatus": { + "required": [ + "bookingStatus" + ], + "type": "object", + "properties": { + "carrierBookingRequestReference": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "A reference to the booking during the booking request phase.\n\n**Conditional:** Either this or the `carrierBookingReference` is required\n", + "example": "24595eb0-5cfc-4381-9c3a-cedc1975e9aa" + }, + "carrierBookingReference": { + "maxLength": 35, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "description": "The `carrierBookingReference` if know. Often this will not be known until the booking has been confirmed. Is available during a booking amendment.\n\n**Conditional:** Either this or the `carrierBookingRequestReference` is required\n", + "example": "ABC709951" + }, + "bookingStatus": { + "$ref": "#/components/schemas/bookingStatusCancelled" + }, + "reason": { + "$ref": "#/components/schemas/reason" + } + }, + "description": "The `carrierBookingReference` and/or `carrierBookingRequestReference` along with the `bookingStatus` and a possible `reason` is returned.\n\n**Condition:** `carrierBookingReference` and/or `carrierBookingRequestReference` must be included.\n" + }, + "email": { + "maxLength": 100, + "pattern": "^.+@\\S+$", + "type": "string", + "description": "`E-mail` address to be used\n", + "example": "info@dcsa.org" + }, + "unNumber": { + "pattern": "^\\d{4}$", + "type": "string", + "description": "United Nations Dangerous Goods Identifier (UNDG) assigned by the UN Sub-Committee of Experts on the Transport of Dangerous Goods and shown in the IMO IMDG.\n", + "example": "1463" + }, + "naNumber": { + "pattern": "^\\d{4}$", + "type": "string", + "description": "Four-digit number that is assigned to dangerous, hazardous, and harmful substances by the United States Department of Transportation.\n", + "example": "9037" + }, + "v2_bookings_body": { + "allOf": [ + { + "$ref": "#/components/schemas/postBooking" + } + ] + }, + "bookings_bookingReference_body": { + "required": [ + "bookingStatus" + ], + "type": "object", + "properties": { + "bookingStatus": { + "$ref": "#/components/schemas/bookingStatusCancelled" + }, + "reason": { + "maxLength": 5000, + "type": "string", + "description": "An optional field where a reason for cancelling the booking can be given.\n", + "example": "Booking cancelled due to internal problems" + } + } + }, + "postBooking_vessel": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/vesselName" + }, + "vesselIMONumber": { + "$ref": "#/components/schemas/vesselIMONumber" + } + } + }, + "dangerousGoods_Base_grossWeight": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/dgGrossWeight" + }, + "unit": { + "$ref": "#/components/schemas/weightUnit" + } + }, + "description": "Total weight of the goods carried, including packaging.\n" + }, + "dangerousGoods_Base_netWeight": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/netWeight" + }, + "unit": { + "$ref": "#/components/schemas/netWeightUnit" + } + }, + "description": "Total weight of the goods carried, excluding packaging.\n" + }, + "dangerousGoods_Base_netExplosiveContent": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/netExplosiveContent" + }, + "unit": { + "$ref": "#/components/schemas/netExplosiveContentUnit" + } + }, + "description": "The total weight of the explosive substances, without the packaging’s, casings, etc.\n" + }, + "dangerousGoods_Base_volume": { + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/dgVolume" + }, + "unit": { + "$ref": "#/components/schemas/volumeUnitDG" + } + }, + "description": "The volume of the referenced dangerous goods.\n\n**Condition:** only applicable to liquids and gas.\n" + } + }, + "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": "2" + } + }, + "bookingReferencePathParam": { + "name": "bookingReference", + "in": "path", + "description": "This can be one of:\n- `carrierBookingRequestReference` (in case no carrierBookingReference has yet been appointed to the booking)\n- `carrierBookingReference`\n", + "required": true, + "style": "simple", + "explode": false, + "schema": { + "maxLength": 100, + "pattern": "^\\S+(\\s+\\S+)*$", + "type": "string", + "example": "CBR001" + } + }, + "operationQueryParam": { + "name": "operation", + "in": "query", + "description": "Defines what is to be 'cancelled' - can be:\n- `cancelBooking` (cancels the entire booking)\n- `cancelAmendment` (cancels the amendment and keeps the booking)\n\nIn case cancelling an amendment is requested but no amendment is active - a `409` (Conflict) is returned\n", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "enum": [ + "cancelBooking", + "cancelAmendment" + ] + } + }, + "bookingStatus": { + "name": "bookingStatus", + "in": "query", + "description": "Filter by the status of the booking. Possible values are:\n- RECEIVED\n- PENDING UPDATE\n- PENDING UPDATE CONFIRMATION\n- PENDING AMENDMENT\n- PENDING AMENDMENT APPROVAL\n- CONFIRMED\n- REJECTED\n- DECLINED\n- CANCELLED\n- COMPLETED\n\nMore details can be found on [GitHub](https://github.com/dcsaorg/DCSA-Edocumentation/blob/master/edocumentation-domain/src/main/resources/validations/bookingstatuses.csv).\n", + "required": false, + "style": "form", + "explode": true, + "schema": { + "$ref": "#/components/schemas/bookingStatus" + } + } + }, + "headers": { + "API-Version": { + "description": "SemVer used to indicate the version of the contract (API version) returned.\n", + "style": "simple", + "explode": false, + "schema": { + "type": "string", + "example": "2.0.0-Beta-1" } } } } -} \ No newline at end of file +} From 323b4cac59b0f835ac8e43cfcfdcaa03963e06c4 Mon Sep 17 00:00:00 2001 From: preetamnpr <128618622+preetamnpr@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:50:20 +0100 Subject: [PATCH 2/3] DT-607 added after review comment on Booking Notification. --- .../booking/BookingComponentFactory.java | 42 ++++-- .../booking/BookingScenarioListBuilder.java | 13 +- .../booking-notification-v20-request.json | 127 ++++++++++++++++++ .../booking-notification-v20-carrier.json | 111 +++++++++++++++ .../booking-notification-v20-shipper.json | 111 +++++++++++++++ .../core/AbstractComponentFactory.java | 3 - 6 files changed, 389 insertions(+), 18 deletions(-) create mode 100644 booking/src/main/resources/standards/booking/messages/booking-notification-v20-request.json create mode 100644 booking/src/main/resources/standards/booking/schemas/booking-notification-v20-carrier.json create mode 100644 booking/src/main/resources/standards/booking/schemas/booking-notification-v20-shipper.json diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java index f4089ed6..43551e43 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java @@ -26,6 +26,12 @@ public class BookingComponentFactory extends AbstractComponentFactory { private static final String CARRIER_AUTH_HEADER_VALUE = UUID.randomUUID().toString(); private static final String SHIPPER_AUTH_HEADER_VALUE = UUID.randomUUID().toString(); + private static final String UCI_SHIPPER_SUBMIT_BOOKING_REQUEST_ACTION = "UC1_Shipper_SubmitBookingRequestAction"; + + private static final String BOOKING_SCHEMA_NAME = "postBooking"; + + private static final String BOOKING_NOTIFICATION_SCHEMA_NAME = "BookingNotification"; + private final String standardVersion; public BookingComponentFactory(String standardVersion) { @@ -113,19 +119,37 @@ public Set getReportRoleNames( .collect(Collectors.toSet()); } - public JsonSchemaValidator getMessageSchemaValidator(String apiProviderRole, boolean forRequest) { - String schemaFilePath = - "/standards/booking/schemas/booking-%s-%s.json" - .formatted( - standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); - String schemaName = - BookingRole.isCarrier(apiProviderRole) - ? (forRequest ? "postBooking" : null) - : (forRequest ? "BookingNotification" : "BookingNotification"); + public JsonSchemaValidator getMessageSchemaValidator(String apiProviderRole, boolean forRequest, String action) { + String schemaName = getSchemaName(apiProviderRole, forRequest, action); + String schemaFilePath = null; + if (schemaName.equals(BOOKING_NOTIFICATION_SCHEMA_NAME)) { + schemaFilePath = "/standards/booking/schemas/booking-%s-%s-%s.json" + .formatted( + "notification",standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); + } + else { + schemaFilePath = "/standards/booking/schemas/booking-%s-%s.json" + .formatted(standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); + } return new JsonSchemaValidator( BookingComponentFactory.class.getResourceAsStream(schemaFilePath), schemaName); } + private String getSchemaName(String apiProviderRole, boolean forRequest, String action) { + String schemaName = BOOKING_NOTIFICATION_SCHEMA_NAME; + if (BookingRole.isCarrier(apiProviderRole)) { + if (forRequest) { + if (UCI_SHIPPER_SUBMIT_BOOKING_REQUEST_ACTION.equals(action)) { + schemaName = BOOKING_SCHEMA_NAME; + } + else { + schemaName = BOOKING_NOTIFICATION_SCHEMA_NAME; + } + } + } + return schemaName; + } + @SneakyThrows public JsonNode getJsonSandboxConfigurationTemplate( String testedPartyRole, boolean isManual, boolean isTestingCounterpartsConfig) { diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java index 72f5bb3e..3e5ae76d 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java @@ -151,7 +151,7 @@ private static BookingScenarioListBuilder shipper_GetBooking(BookingState expect (BookingAction) previousAction, expectedState, componentFactory.getMessageSchemaValidator( - BookingRole.SHIPPER.getConfigName(), false))); + BookingRole.SHIPPER.getConfigName(), false, null))); } private static BookingScenarioListBuilder uc1_shipper_SubmitBookingRequest() { @@ -165,7 +165,8 @@ private static BookingScenarioListBuilder uc1_shipper_SubmitBookingRequest() { shipperPartyName, (BookingAction) previousAction, componentFactory.getMessageSchemaValidator( - BookingRole.SHIPPER.getConfigName(), true))); + BookingRole.SHIPPER.getConfigName(), true, + "UC1_Shipper_SubmitBookingRequestAction"))); } private static BookingScenarioListBuilder uc2_carrier_requestUpdateToBookingRequest() { @@ -179,7 +180,7 @@ private static BookingScenarioListBuilder uc2_carrier_requestUpdateToBookingRequ shipperPartyName, (BookingAction) previousAction, componentFactory.getMessageSchemaValidator( - BookingRole.CARRIER.getConfigName(), true))); + BookingRole.CARRIER.getConfigName(), true,null))); } private static BookingScenarioListBuilder uc3_shipper_submitUpdatedBookingRequest() { @@ -197,7 +198,7 @@ private static BookingScenarioListBuilder uc4_carrier_rejectBookingRequest() { shipperPartyName, (BookingAction) previousAction, componentFactory.getMessageSchemaValidator( - BookingRole.CARRIER.getConfigName(), true))); + BookingRole.CARRIER.getConfigName(), true,null))); } private static BookingScenarioListBuilder uc5_carrier_confirmBookingRequest() { @@ -211,7 +212,7 @@ private static BookingScenarioListBuilder uc5_carrier_confirmBookingRequest() { shipperPartyName, (BookingAction) previousAction, componentFactory.getMessageSchemaValidator( - BookingRole.CARRIER.getConfigName(), true))); + BookingRole.CARRIER.getConfigName(), true,null))); } private static BookingScenarioListBuilder uc6_carrier_requestBookingAmendment() { @@ -249,7 +250,7 @@ private static BookingScenarioListBuilder uc11_carrier_confirmBookingCompleted() shipperPartyName, (BookingAction) previousAction, componentFactory.getMessageSchemaValidator( - BookingRole.CARRIER.getConfigName(), true))); + BookingRole.CARRIER.getConfigName(), true,null))); } private static BookingScenarioListBuilder uc12_shipper_cancelBooking() { diff --git a/booking/src/main/resources/standards/booking/messages/booking-notification-v20-request.json b/booking/src/main/resources/standards/booking/messages/booking-notification-v20-request.json new file mode 100644 index 00000000..b4b5c2cf --- /dev/null +++ b/booking/src/main/resources/standards/booking/messages/booking-notification-v20-request.json @@ -0,0 +1,127 @@ +{ + "receiptTypeAtOrigin": "CY", + "deliveryTypeAtDestination": "CY", + "cargoMovementTypeAtOrigin": "FCL", + "cargoMovementTypeAtDestination": "FCL", + "vessel": { + "name": "King of the Seas", + "vesselIMONumber": "VESSEL_IMO_NUMBER_PLACEHOLDER" + }, + "serviceContractReference": "serviceRef", + "carrierExportVoyageNumber": "2106W", + "carrierServiceName": "CARRIER_SERVICE_NAME_PLACEHOLDER", + "declaredValue": 3.14, + "declaredValueCurrency": "DKK", + "isPartialLoadAllowed": true, + "isExportDeclarationRequired": true, + "exportDeclarationReference": "exportDeclarationRef", + "isImportLicenseRequired": true, + "importLicenseReference": "importLicenseRef", + "expectedDepartureDate": "2052-11-15", + "expectedArrivalAtPlaceOfDeliveryStartDate": "2052-11-15", + "expectedArrivalAtPlaceOfDeliveryEndDate": "2052-11-15", + "transportDocumentTypeCode": "BOL", + "transportDocumentReference": "transportDocumentRef", + "bookingChannelReference": "bookingChannelRef", + "incoTerms": "FOB", + "communicationChannelCode": "AO", + "isEquipmentSubstitutionAllowed": true, + "placeOfBLIssue": { + "locationName": "Asseco DK office", + "locationType": "ADDR", + "address": { + "name": "Asseco DK", + "street": "Kronprinsessegade", + "streetNumber": "54", + "floor": "5. sal", + "postCode": "1306", + "city": "København", + "country": "Denmark" + } + }, + "requestedEquipments": [ + { + "ISOEquipmentCode": "22G1", + "units": 1, + "isShipperOwned": false, + "commodities": [ + { + "HSCodes": ["411510"], + "commodityType": "commodity type", + "cargoGrossWeight": 323.32, + "cargoGrossWeightUnit": "KGM", + "cargoGrossVolume": 100.0, + "cargoGrossVolumeUnit": "MTQ", + "outerPackaging": { + "packageCode" : "1A", + "imoPackagingCode": "A1222", + "numberOfPackages": 1, + "description": "steel" + + }, + "exportLicenseIssueDate": "2022-11-15", + "exportLicenseExpiryDate": "2023-05-15" + } + ] + } + ], + "references": [ + { + "type": "AAO", + "value": "ref value" + } + ], + "documentParties": [ + { + "party": { + "partyName": "boring party", + "address": { + "name": "Asseco DK", + "street": "Kronprinsessegade", + "streetNumber": "54", + "floor": "5. sal", + "postCode": "1306", + "city": "København", + "country": "Denmark" + }, + "partyContactDetails": [ + { + "name": "Henrik", + "phone": "+31611444666" + } + ], + "identifyingCodes": [ + { + "DCSAResponsibleAgencyCode": "DCSA", + "partyCode": "reponsible fun", + "codeListName": "irreponsible fun" + } + ] + }, + "partyFunction": "BA", + "displayedAddress": [ + "line1", + "line2" + ], + "isToBeNotified": true + } + ], + "shipmentLocations": [ + { + "location": { + "locationType": "UNLO", + "UNLocationCode": "NLRTM" + }, + "shipmentLocationTypeCode": "POL", + "eventDateTime": "2022-11-15T10:34:41.99631016+01:00" + }, + { + "location": { + "locationType": "UNLO", + "UNLocationCode": "USMIA" + }, + "shipmentLocationTypeCode": "POD", + "eventDateTime": "2022-11-15T10:34:41.99631016+01:00" + } + ] +} diff --git a/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-carrier.json b/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-carrier.json new file mode 100644 index 00000000..d8ad800c --- /dev/null +++ b/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-carrier.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "bkg_ntf_v1.0.0-Beta-1", + "version": "1.0.0-Beta-1" + }, + "servers": [ + { + "url": "http://localhost:3000" + } + ], + "paths": { + "/v2/booking-notifications": { + "post": { + "summary": "", + "operationId": "post-v1-booking-notifications", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BookingNotification" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + } + }, + "servers": [ + { + "url": "http://localhost:3000" + } + ] + } + } + }, + "components": { + "schemas": { + "BookingNotification": { + "title": "BookingNotification", + "required": [ + "id", + "source", + "specversion", + "time", + "type" + ], + "type": "object", + "properties": { + "specversion": { + "type": "string", + "example": "1.0", + "enum": [ + "1.0" + ] + }, + "id": { + "maxLength": 100, + "type": "string", + "example": "3cecb101-7a1a-43a4-9d62-e88a131651e2" + }, + "source": { + "maxLength": 4096, + "type": "string", + "example": "https://member.com/" + }, + "type": { + "type": "string", + "example": "org.dcsa.bookingnotification.v1", + "enum": [ + "org.dcsa.bookingnotification.v1" + ] + }, + "time": { + "type": "string", + "example": "2018-04-05T17:31:00Z" + }, + "datacontenttype": { + "type": "string", + "example": "application/json", + "enum": [ + "application/json" + ] + }, + "data": { + "$ref": "#/components/schemas/BookingNotification_data" + } + } + }, + "BookingNotification_data": { + "required": [ + "bookingStatus" + ], + "type": "object", + "properties": { + "bookingStatus": { + "type": "string" + }, + "carrierBookingReference": { + "type": "string" + }, + "carrierBookingRequestReference": { + "type": "string" + } + } + } + } + } +} diff --git a/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-shipper.json b/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-shipper.json new file mode 100644 index 00000000..d8ad800c --- /dev/null +++ b/booking/src/main/resources/standards/booking/schemas/booking-notification-v20-shipper.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "bkg_ntf_v1.0.0-Beta-1", + "version": "1.0.0-Beta-1" + }, + "servers": [ + { + "url": "http://localhost:3000" + } + ], + "paths": { + "/v2/booking-notifications": { + "post": { + "summary": "", + "operationId": "post-v1-booking-notifications", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BookingNotification" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + } + }, + "servers": [ + { + "url": "http://localhost:3000" + } + ] + } + } + }, + "components": { + "schemas": { + "BookingNotification": { + "title": "BookingNotification", + "required": [ + "id", + "source", + "specversion", + "time", + "type" + ], + "type": "object", + "properties": { + "specversion": { + "type": "string", + "example": "1.0", + "enum": [ + "1.0" + ] + }, + "id": { + "maxLength": 100, + "type": "string", + "example": "3cecb101-7a1a-43a4-9d62-e88a131651e2" + }, + "source": { + "maxLength": 4096, + "type": "string", + "example": "https://member.com/" + }, + "type": { + "type": "string", + "example": "org.dcsa.bookingnotification.v1", + "enum": [ + "org.dcsa.bookingnotification.v1" + ] + }, + "time": { + "type": "string", + "example": "2018-04-05T17:31:00Z" + }, + "datacontenttype": { + "type": "string", + "example": "application/json", + "enum": [ + "application/json" + ] + }, + "data": { + "$ref": "#/components/schemas/BookingNotification_data" + } + } + }, + "BookingNotification_data": { + "required": [ + "bookingStatus" + ], + "type": "object", + "properties": { + "bookingStatus": { + "type": "string" + }, + "carrierBookingReference": { + "type": "string" + }, + "carrierBookingRequestReference": { + "type": "string" + } + } + } + } + } +} diff --git a/core/src/main/java/org/dcsa/conformance/core/AbstractComponentFactory.java b/core/src/main/java/org/dcsa/conformance/core/AbstractComponentFactory.java index af07243c..dc269ee6 100644 --- a/core/src/main/java/org/dcsa/conformance/core/AbstractComponentFactory.java +++ b/core/src/main/java/org/dcsa/conformance/core/AbstractComponentFactory.java @@ -32,9 +32,6 @@ public abstract Set getReportRoleNames( PartyConfiguration[] partyConfigurations, CounterpartConfiguration[] counterpartConfigurations); - public abstract JsonSchemaValidator getMessageSchemaValidator( - String apiProviderRole, boolean forRequest); - public abstract JsonNode getJsonSandboxConfigurationTemplate( String testedPartyRole, boolean isManual, boolean isTestingCounterpartsConfig); From 248d68be6e6b60c3a9ef2d3a2c14d92e889f7b62 Mon Sep 17 00:00:00 2001 From: preetamnpr <128618622+preetamnpr@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:40:26 +0100 Subject: [PATCH 3/3] Dt-607 changes done after the review. --- .../booking/BookingComponentFactory.java | 15 ++++++--------- .../standards/booking/party/Shipper.java | 2 +- ...-request.json => booking-api-v20-request.json} | 0 ...-carrier.json => booking-api-v20-carrier.json} | 0 ...-shipper.json => booking-api-v20-shipper.json} | 0 5 files changed, 7 insertions(+), 10 deletions(-) rename booking/src/main/resources/standards/booking/messages/{booking-v20-request.json => booking-api-v20-request.json} (100%) rename booking/src/main/resources/standards/booking/schemas/{booking-v20-carrier.json => booking-api-v20-carrier.json} (100%) rename booking/src/main/resources/standards/booking/schemas/{booking-v20-shipper.json => booking-api-v20-shipper.json} (100%) diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java index 43551e43..7efd7249 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/BookingComponentFactory.java @@ -121,23 +121,20 @@ public Set getReportRoleNames( public JsonSchemaValidator getMessageSchemaValidator(String apiProviderRole, boolean forRequest, String action) { String schemaName = getSchemaName(apiProviderRole, forRequest, action); - String schemaFilePath = null; + String schemaSuffix = "api"; if (schemaName.equals(BOOKING_NOTIFICATION_SCHEMA_NAME)) { - schemaFilePath = "/standards/booking/schemas/booking-%s-%s-%s.json" - .formatted( - "notification",standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); - } - else { - schemaFilePath = "/standards/booking/schemas/booking-%s-%s.json" - .formatted(standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); + schemaSuffix = "notification"; } + String schemaFilePath = "/standards/booking/schemas/booking-%s-%s-%s.json" + .formatted(schemaSuffix,standardVersion.startsWith("2") ? "v20" : "v30", apiProviderRole.toLowerCase()); + return new JsonSchemaValidator( BookingComponentFactory.class.getResourceAsStream(schemaFilePath), schemaName); } private String getSchemaName(String apiProviderRole, boolean forRequest, String action) { String schemaName = BOOKING_NOTIFICATION_SCHEMA_NAME; - if (BookingRole.isCarrier(apiProviderRole)) { + if (BookingRole.isShipper(apiProviderRole)) { if (forRequest) { if (UCI_SHIPPER_SUBMIT_BOOKING_REQUEST_ACTION.equals(action)) { schemaName = BOOKING_SCHEMA_NAME; diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Shipper.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Shipper.java index c5f2b57c..2ba04565 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Shipper.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Shipper.java @@ -75,7 +75,7 @@ private void sendBookingRequest(JsonNode actionPrompt) { JsonNode jsonRequestBody = JsonToolkit.templateFileToJsonNode( - "/standards/booking/messages/booking-v20-request.json", + "/standards/booking/messages/booking-api-v20-request.json", Map.ofEntries( Map.entry( "CARRIER_SERVICE_NAME_PLACEHOLDER", diff --git a/booking/src/main/resources/standards/booking/messages/booking-v20-request.json b/booking/src/main/resources/standards/booking/messages/booking-api-v20-request.json similarity index 100% rename from booking/src/main/resources/standards/booking/messages/booking-v20-request.json rename to booking/src/main/resources/standards/booking/messages/booking-api-v20-request.json diff --git a/booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json b/booking/src/main/resources/standards/booking/schemas/booking-api-v20-carrier.json similarity index 100% rename from booking/src/main/resources/standards/booking/schemas/booking-v20-carrier.json rename to booking/src/main/resources/standards/booking/schemas/booking-api-v20-carrier.json diff --git a/booking/src/main/resources/standards/booking/schemas/booking-v20-shipper.json b/booking/src/main/resources/standards/booking/schemas/booking-api-v20-shipper.json similarity index 100% rename from booking/src/main/resources/standards/booking/schemas/booking-v20-shipper.json rename to booking/src/main/resources/standards/booking/schemas/booking-api-v20-shipper.json