From 6bb2fc9052e1e6a0f490235155b682dff4beb02f Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Wed, 12 Jun 2024 11:20:52 +0200 Subject: [PATCH 1/2] DT-1217: Change response code for surrender --- .../eblsurrender/EblSurrenderScenarioListBuilder.java | 6 +++--- .../standards/eblsurrender/party/EblSurrenderCarrier.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java index 372b54ea..ef7c5ec8 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java @@ -45,8 +45,8 @@ private EblSurrenderScenarioListBuilder thenAllPathsFrom( EblSurrenderState surrenderState) { return switch (surrenderState) { case AVAILABLE_FOR_SURRENDER -> thenEither( - requestSurrenderForDelivery(202).thenAllPathsFrom(DELIVERY_SURRENDER_REQUESTED), - requestSurrenderForAmendment(202).thenAllPathsFrom(AMENDMENT_SURRENDER_REQUESTED), + requestSurrenderForDelivery(204).thenAllPathsFrom(DELIVERY_SURRENDER_REQUESTED), + requestSurrenderForAmendment(204).thenAllPathsFrom(AMENDMENT_SURRENDER_REQUESTED), acceptSurrenderRequest(409).thenAllHappyPathsFrom(AVAILABLE_FOR_SURRENDER), rejectSurrenderRequest(409).thenAllHappyPathsFrom(AVAILABLE_FOR_SURRENDER) ); @@ -76,7 +76,7 @@ private EblSurrenderScenarioListBuilder thenAllPathsFrom( private EblSurrenderScenarioListBuilder thenAllHappyPathsFrom( EblSurrenderState surrenderState) { var cases = switch (surrenderState) { - case AVAILABLE_FOR_SURRENDER -> requestSurrenderForDelivery(202).thenAllHappyPathsFrom(DELIVERY_SURRENDER_REQUESTED); + case AVAILABLE_FOR_SURRENDER -> requestSurrenderForDelivery(204).thenAllHappyPathsFrom(DELIVERY_SURRENDER_REQUESTED); case DELIVERY_SURRENDER_REQUESTED -> acceptSurrenderRequest(204); case SURRENDERED_FOR_DELIVERY -> noAction(); case AMENDMENT_SURRENDER_REQUESTED -> acceptSurrenderRequest(204) diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java index 9d1d37f9..4ff96066 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java @@ -171,7 +171,7 @@ public ConformanceResponse handleRequest(ConformanceRequest request) { .formatted(src, srr, tdr, eblStatesById.get(tdr))); return request.createResponse( - 202, + 204, Map.of("Api-Version", List.of(apiVersion)), new ConformanceMessageBody( objectMapper From 100a1e25e5e42fcc872f8eb0188184707b068c00 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Thu, 13 Jun 2024 12:40:18 +0200 Subject: [PATCH 2/2] DT-1266: Add Issuance and Surrender actions to surrender API --- .../EblSurrenderComponentFactory.java | 5 +- .../EblSurrenderScenarioListBuilder.java | 5 +- .../eblsurrender/SurrenderChecks.java | 37 ++++++++ .../SupplyScenarioParametersAction.java | 3 +- .../action/SurrenderRequestAction.java | 13 +-- .../party/EblSurrenderCarrier.java | 2 +- .../party/EblSurrenderPlatform.java | 3 +- .../party/SuppliedScenarioParameters.java | 8 +- .../eblsurrender-api-v3.0.0-request.json | 56 ++++++++++- .../schemas/eblsurrender-v3.0.0-carrier.json | 93 ++++--------------- .../schemas/eblsurrender-v3.0.0-platform.json | 8 +- 11 files changed, 132 insertions(+), 101 deletions(-) create mode 100644 ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/SurrenderChecks.java diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderComponentFactory.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderComponentFactory.java index 3973d399..5570f150 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderComponentFactory.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderComponentFactory.java @@ -112,9 +112,12 @@ public JsonSchemaValidator getMessageSchemaValidator(String apiProviderRole, boo } else { schemaName = EblSurrenderRole.isCarrier(apiProviderRole) - ? (forRequest ? "SurrenderRequestDetails" : "SurrenderRequestAcknowledgement") + ? (forRequest ? "SurrenderRequestDetails" : null) : (forRequest ? "SurrenderRequestAnswer" : null); } + if (schemaName == null) { + throw new IllegalArgumentException("No schema for " + apiProviderRole + " (forRequest=" + forRequest + ")"); + } return JsonSchemaValidator.getInstance(schemaFilePath, schemaName); } } diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java index ef7c5ec8..f2cd77ee 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/EblSurrenderScenarioListBuilder.java @@ -138,9 +138,8 @@ private static EblSurrenderScenarioListBuilder _surrenderRequestBuilder( expectedStatus, previousAction, componentFactory.getMessageSchemaValidator( - EblSurrenderRole.CARRIER.getConfigName(), true), - componentFactory.getMessageSchemaValidator( - EblSurrenderRole.CARRIER.getConfigName(), false))); + EblSurrenderRole.CARRIER.getConfigName(), true)) + ); } private static EblSurrenderScenarioListBuilder acceptSurrenderRequest(int status) { diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/SurrenderChecks.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/SurrenderChecks.java new file mode 100644 index 00000000..150cb840 --- /dev/null +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/SurrenderChecks.java @@ -0,0 +1,37 @@ +package org.dcsa.conformance.standards.eblsurrender; + +import org.dcsa.conformance.core.check.ActionCheck; +import org.dcsa.conformance.core.check.JsonAttribute; +import org.dcsa.conformance.core.check.JsonContentCheck; +import org.dcsa.conformance.core.check.KeywordDataset; +import org.dcsa.conformance.core.traffic.HttpMessageType; +import org.dcsa.conformance.standards.eblsurrender.party.EblSurrenderRole; + +import java.util.UUID; + +public class SurrenderChecks { + private static final KeywordDataset SURRENDER_ACTIONS_DATA_SET = KeywordDataset.staticDataset( + "ISSUE", + "ENDORSE", + "SIGN", + "SURRENDER FOR DELIVERY", + "SURRENDER FOR AMENDMENT" + ); + + private static final JsonContentCheck SURRENDER_ACTION_VALIDATION = JsonAttribute.allIndividualMatchesMustBeValid( + "Validate Surrender Actions", + (mav) -> mav.submitAllMatching("endorsementChain.*.actionCode"), + JsonAttribute.matchedMustBeDatasetKeywordIfPresent(SURRENDER_ACTIONS_DATA_SET) + ); + + public static ActionCheck surrenderRequestChecks(UUID matched, String standardVersion) { + return JsonAttribute.contentChecks( + EblSurrenderRole::isPlatform, + matched, + HttpMessageType.REQUEST, + standardVersion, + SURRENDER_ACTION_VALIDATION + ); + + } +} diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SupplyScenarioParametersAction.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SupplyScenarioParametersAction.java index b3691a9c..e098d165 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SupplyScenarioParametersAction.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SupplyScenarioParametersAction.java @@ -47,9 +47,10 @@ public String getHumanReadablePrompt() { @Override public JsonNode getJsonForHumanReadablePrompt() { - return new SuppliedScenarioParameters( + return new SuppliedScenarioParameters( UUID.randomUUID().toString().replaceAll("-", "").substring(0, 20), "XMPL", + "Example carrier party code", "Example party code", "Example code list") .toJson(); diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SurrenderRequestAction.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SurrenderRequestAction.java index 73a5df7d..f3a3e1f6 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SurrenderRequestAction.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/action/SurrenderRequestAction.java @@ -15,11 +15,12 @@ import org.dcsa.conformance.core.traffic.HttpMessageType; import org.dcsa.conformance.standards.eblsurrender.party.EblSurrenderRole; +import static org.dcsa.conformance.standards.eblsurrender.SurrenderChecks.surrenderRequestChecks; + @Getter @Slf4j public class SurrenderRequestAction extends EblSurrenderAction { private final JsonSchemaValidator requestSchemaValidator; - private final JsonSchemaValidator responseSchemaValidator; private final boolean forAmendment; private final AtomicReference surrenderRequestReference = new AtomicReference<>(); @@ -32,8 +33,7 @@ public SurrenderRequestAction( String carrierPartyName, int expectedStatus, ConformanceAction previousAction, - JsonSchemaValidator requestSchemaValidator, - JsonSchemaValidator responseSchemaValidator) { + JsonSchemaValidator requestSchemaValidator) { super( platformPartyName, carrierPartyName, @@ -42,7 +42,6 @@ public SurrenderRequestAction( "%s %d".formatted(forAmendment ? "AREQ" : "SREQ", expectedStatus)); this.forAmendment = forAmendment; this.requestSchemaValidator = requestSchemaValidator; - this.responseSchemaValidator = responseSchemaValidator; } @Override @@ -115,17 +114,13 @@ protected Stream createSubChecks() { getMatchedExchangeUuid(), HttpMessageType.REQUEST, requestSchemaValidator), - new JsonSchemaCheck( - EblSurrenderRole::isCarrier, - getMatchedExchangeUuid(), - HttpMessageType.RESPONSE, - responseSchemaValidator), new JsonAttributeCheck( EblSurrenderRole::isPlatform, getMatchedExchangeUuid(), HttpMessageType.REQUEST, JsonPointer.compile("/surrenderRequestCode"), forAmendment ? "AREQ" : "SREQ"), + surrenderRequestChecks(getMatchedExchangeUuid(), expectedApiVersion), new JsonAttributeCheck( EblSurrenderRole::isPlatform, getMatchedExchangeUuid(), diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java index 4ff96066..ccc4b0f3 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderCarrier.java @@ -88,7 +88,7 @@ private void supplyScenarioParameters(JsonNode actionPrompt) { eblStatesById.put(tdr, EblSurrenderState.AVAILABLE_FOR_SURRENDER); SuppliedScenarioParameters suppliedScenarioParameters = - new SuppliedScenarioParameters(tdr, "XMPL", "Example party code", "Example code list"); + new SuppliedScenarioParameters(tdr, "XMPL", "Example carrier party code", "Example party code", "Example code list"); asyncOrchestratorPostPartyInput( objectMapper diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderPlatform.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderPlatform.java index 57fc1ff9..4d7f10dd 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderPlatform.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/EblSurrenderPlatform.java @@ -92,7 +92,8 @@ private void requestSurrender(JsonNode actionPrompt) { Map.entry("TRANSPORT_DOCUMENT_REFERENCE_PLACEHOLDER", tdr), Map.entry("SURRENDER_REQUEST_CODE_PLACEHOLDER", src), Map.entry("EBL_PLATFORM_PLACEHOLDER", ssp.eblPlatform()), - Map.entry("PARTY_CODE_PLACEHOLDER", ssp.partyCode()), + Map.entry("CARRIER_PARTY_CODE_PLACEHOLDER", ssp.carrierPartyCode()), + Map.entry("PARTY_CODE_PLACEHOLDER", ssp.surrenderPartyCode()), Map.entry("CODE_LIST_NAME_PLACEHOLDER", ssp.codeListName()), Map.entry("ACTION_DATE_TIME_PLACEHOLDER", Instant.now().toString()))); diff --git a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/SuppliedScenarioParameters.java b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/SuppliedScenarioParameters.java index 5c886961..ea175798 100644 --- a/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/SuppliedScenarioParameters.java +++ b/ebl-surrender/src/main/java/org/dcsa/conformance/standards/eblsurrender/party/SuppliedScenarioParameters.java @@ -5,13 +5,14 @@ import com.fasterxml.jackson.databind.node.ObjectNode; public record SuppliedScenarioParameters( - String transportDocumentReference, String eblPlatform, String partyCode, String codeListName) { + String transportDocumentReference, String eblPlatform, String carrierPartyCode, String surrenderPartyCode, String codeListName) { public ObjectNode toJson() { return new ObjectMapper() .createObjectNode() .put("transportDocumentReference", transportDocumentReference) .put("eblPlatform", eblPlatform) - .put("partyCode", partyCode) + .put("carrierPartyCode", surrenderPartyCode) + .put("surrenderPartyCode", surrenderPartyCode) .put("codeListName", codeListName); } @@ -19,7 +20,8 @@ public static SuppliedScenarioParameters fromJson(JsonNode jsonNode) { return new SuppliedScenarioParameters( jsonNode.required("transportDocumentReference").asText(), jsonNode.required("eblPlatform").asText(), - jsonNode.required("partyCode").asText(), + jsonNode.required("carrierPartyCode").asText(), + jsonNode.required("surrenderPartyCode").asText(), jsonNode.required("codeListName").asText()); } } diff --git a/ebl-surrender/src/main/resources/standards/eblsurrender/messages/eblsurrender-api-v3.0.0-request.json b/ebl-surrender/src/main/resources/standards/eblsurrender/messages/eblsurrender-api-v3.0.0-request.json index 819ddb71..3db1c0dd 100644 --- a/ebl-surrender/src/main/resources/standards/eblsurrender/messages/eblsurrender-api-v3.0.0-request.json +++ b/ebl-surrender/src/main/resources/standards/eblsurrender/messages/eblsurrender-api-v3.0.0-request.json @@ -12,5 +12,59 @@ "codeListName": "CODE_LIST_NAME_PLACEHOLDER" } ] - } + }, + "endorsementChain": [ + { + "actionCode": "ISSUE", + "actionDateTime": "2024-06-11T13:54:00Z", + "actor": { + "eblPlatform": "EBL_PLATFORM_PLACEHOLDER", + "partyName": "legal name", + "partyCodes": [ + { + "partyCode": "CARRIER_PARTY_CODE_PLACEHOLDER", + "codeListProvider": "EPUI", + "codeListName": "CODE_LIST_NAME_PLACEHOLDER" + } + ] + }, + "recipient": { + "eblPlatform": "EBL_PLATFORM_PLACEHOLDER", + "partyName": "legal name", + "partyCodes": [ + { + "partyCode": "PARTY_CODE_PLACEHOLDER", + "codeListProvider": "EPUI", + "codeListName": "CODE_LIST_NAME_PLACEHOLDER" + } + ] + } + }, + { + "actionCode": "SURRENDER FOR DELIVERY", + "actionDateTime": "2024-06-12T14:54:00Z", + "recipient": { + "eblPlatform": "EBL_PLATFORM_PLACEHOLDER", + "partyName": "legal name", + "partyCodes": [ + { + "partyCode": "CARRIER_PARTY_CODE_PLACEHOLDER", + "codeListProvider": "EPUI", + "codeListName": "CODE_LIST_NAME_PLACEHOLDER" + } + ] + }, + "actor": { + "eblPlatform": "EBL_PLATFORM_PLACEHOLDER", + "partyName": "legal name", + "partyCodes": [ + { + "partyCode": "PARTY_CODE_PLACEHOLDER", + "codeListProvider": "EPUI", + "codeListName": "CODE_LIST_NAME_PLACEHOLDER" + } + ] + } + } + ] } diff --git a/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-carrier.json b/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-carrier.json index 88082846..442f9d5a 100644 --- a/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-carrier.json +++ b/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-carrier.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "DCSA EBL Surrender API", - "description": "This API is intended as an API between a carrier (the server) and a EBL Solution Platform (the client).\n\nThe EBL Solution Platform will submit surrender requests to the carrier, which will be processed asynchronously. Responses to the surrender reqests will be submitted by the carrier via the [DCSA EBL Surrender Response API](https://app.swaggerhub.com/apis-docs/dcsaorg/DCSA_EBL_SUR_RSP/3.0.0-Beta-2) API.\n\nWhen the platform submits a surrender request, the platform guarantees *all* of the following:\n\n1) The surrender request was submitted by the sole possessor of the EBL.\n2) Depending on the eBL type:\n * For non-negoitable (\"straight\") eBLs, the surrender request was submitted by either the original shipper OR the consignee.\n * For negotiable eBLs with a named titleholder, the surrender request was submitted by the named titleholder.\n * For negotiable eBLs without a named titleholder / blank eBLs, possession is sufficient for the entity surrendering the eBL.\n3) The platform has the EBL in custody while the carrier is evaluating this surrender request. I.e., neither possession nor title holder changes can occur until the carrier responds to this surrender request.\n\nPlease see the [Surrender Request](#/SurrenderRequestDetails) for details on what data the platform will provide.\n\n### Stats API\nThe Stats API offers crucial statistical information for both API providers and consumers to enhance their services and helps DCSA to understand and scale the ecosystem. We expect you to invoke the Stats API for every request made to this API. Further details can be found [here](https://labs.dcsa.org/#/http/guides/api-guides/stats-api/introduction)\n\nFor a changelog, please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/tree/master/ebl/v3/surrender#v300B2). Please [create a GitHub issue](https://github.com/dcsaorg/DCSA-OpenAPI/issues/new) if you have any questions/comments.\n", + "description": "This API is intended as an API between a carrier (the server) and a EBL Solution Platform (the client).\n\nThe EBL Solution Platform will submit surrender requests to the carrier, which will be processed asynchronously. Responses to the surrender reqests will be submitted by the carrier via the [DCSA EBL Surrender Response API](https://app.swaggerhub.com/apis-docs/dcsaorg/DCSA_EBL_SUR_RSP/3.0.0-Beta-3) API.\n\nWhen the platform submits a surrender request, the platform guarantees *all* of the following:\n\n1) The surrender request was submitted by the sole possessor of the EBL.\n2) Depending on the eBL type:\n * For non-negoitable (\"straight\") eBLs, the surrender request was submitted by either the original shipper OR the consignee.\n * For negotiable eBLs with a named titleholder, the surrender request was submitted by the named titleholder.\n * For negotiable eBLs without a named titleholder / blank eBLs, possession is sufficient for the entity surrendering the eBL.\n3) The platform has the EBL in custody while the carrier is evaluating this surrender request. I.e., neither possession nor title holder changes can occur until the carrier responds to this surrender request.\n\nPlease see the [Surrender Request](#/surrenderRequestDetails) for details on what data the platform will provide.\n\n### Stats API\nThe Stats API offers crucial statistical information for both API providers and consumers to enhance their services and helps DCSA to understand and scale the ecosystem. We expect you to invoke the Stats API for every request made to this API. Further details can be found [here](https://labs.dcsa.org/#/http/guides/api-guides/stats-api/introduction)\n\nFor a changelog, please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/tree/master/ebl/v3/surrender#v300B2). Please [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", @@ -12,11 +12,11 @@ "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "3.0.0-Beta-2" + "version": "3.0.0-Beta-3" }, "servers": [ { - "url": "https://virtserver.swaggerhub.com/dcsaorg/DCSA_EBL_SUR/3.0.0-Beta-2", + "url": "https://virtserver.swaggerhub.com/dcsaorg/DCSA_EBL_SUR/3.0.0-Beta-3", "description": "SwaggerHub API Auto Mocking" } ], @@ -59,19 +59,12 @@ } }, "responses": { - "202": { + "204": { "description": "Submission registered successfully.\n\nThe carrier will later follow up via the callback with a response.\n", "headers": { "API-Version": { "$ref": "#/components/headers/API-Version" } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SurrenderRequestAcknowledgement" - } - } } }, "default": { @@ -107,7 +100,7 @@ "maxLength": 4, "pattern": "\\S+", "type": "string", - "description": "The EBL platform of the transaction party. The value **MUST** be one of:\n- `WAVE` (Wave)\n- `CARX` (CargoX)\n- `ESSD` (EssDOCS)\n- `IDT` (ICE Digital Trade)\n- `BOLE` (Bolero)\n- `EDOX` (EdoxOnline)\n- `IQAX` (IQAX)\n- `SECR` (Secro)\n- `TRGO` (TradeGO)\n- `ETEU` (eTEU)\n\nMust be a code this list [GitHub](https://github.com/dcsaorg/DCSA-OpenAPI/blob/master/reference-data/eblsolutionproviders-v3.0.0-Beta-2.csv).\n" + "description": "The EBL platform of the transaction party. The value **MUST** be one of:\n- `WAVE` (Wave)\n- `CARX` (CargoX)\n- `ESSD` (EssDOCS)\n- `IDT` (ICE Digital Trade)\n- `BOLE` (Bolero)\n- `EDOX` (EdoxOnline)\n- `IQAX` (IQAX)\n- `SECR` (Secro)\n- `TRGO` (TradeGO)\n- `ETEU` (eTEU)\n- `TRAC` (TRACE Original)\n- `BRIT` (BRITC eBL)\n\nMust be a code this list [GitHub](https://github.com/dcsaorg/DCSA-OpenAPI/blob/master/reference-data/eblsolutionproviders-v3.0.0-Beta-3.csv).\n" }, "partyName": { "maxLength": 100, @@ -132,45 +125,9 @@ }, "description": "Refers to a company or a legal entity." }, - "SurrenderRequestedBy": { - "title": "Surrender Requested By", - "required": [ - "eblPlatform", - "partyName" - ], - "type": "object", - "properties": { - "eblPlatform": { - "maxLength": 4, - "pattern": "\\S+", - "type": "string", - "description": "The EBL platform of the transaction party. The value **MUST** be one of:\n- `WAVE` (Wave)\n- `CARX` (CargoX)\n- `ESSD` (EssDOCS)\n- `IDT` (ICE Digital Trade)\n- `BOLE` (Bolero)\n- `EDOX` (EdoxOnline)\n- `IQAX` (IQAX)\n- `SECR` (Secro)\n- `TRGO` (TradeGO)\n- `ETEU` (eTEU)\n\nMust be a code this list [GitHub](https://github.com/dcsaorg/DCSA-OpenAPI/blob/master/reference-data/eblsolutionproviders-v3.0.0-Beta-2.csv).\n" - }, - "partyName": { - "maxLength": 100, - "pattern": "^\\S(?:.*\\S)?$", - "type": "string", - "description": "Name of the party.\n", - "example": "Globeteam" - }, - "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": "The party that requested the surrender of the EBL.\n\nThe EBL platform has verified that the party submitting the surrender request was in possion of the EBL and was entitled to perform the surrender ([see description of surrenderRequestDetails](#/components/schemas/surrenderRequestDetails)).\n" - }, "EndorsementChainLink": { "required": [ + "actionCode", "actionDateTime", "actor", "recipient" @@ -179,9 +136,13 @@ "properties": { "actionDateTime": { "type": "string", - "description": "Date time when the action occured.", + "description": "Date time when the action occurred.", "format": "date-time" }, + "actionCode": { + "type": "string", + "description": "The action performed by the party. This should be one of:\n\n- `ISSUED` (The actor issued the document to the recipient)\n- `ENDORSED` (The actor endorsed the document to the recipient)\n- `SIGN` (The actor signed or performed an \"assignment\" to the recipient)\n- `SURRENDER FOR DELIVERY` (The actor requested this surrender request for delivery to the recipient)\n- `SURRENDER FOR AMENDMENT` (The actor requested this surrender request for amendment to the recipient)\n\nNot all actions are applicable to all surrender requests.\n" + }, "actor": { "$ref": "#/components/schemas/TransactionParty" }, @@ -191,25 +152,6 @@ }, "description": "Entry in the endorsement chain.\n" }, - "SurrenderRequestAcknowledgement": { - "type": "object", - "properties": { - "surrenderRequestReference": { - "maxLength": 100, - "pattern": "^\\S(?:.*\\S)?$", - "type": "string", - "description": "A server defined reference for a concrete surrender request. Surrender request references MUST NOT be reused.\n", - "example": "Z12345" - }, - "transportDocumentReference": { - "maxLength": 20, - "pattern": "^\\S(?:.*\\S)?$", - "type": "string", - "description": "A unique number allocated by the shipping line to the transport document and the main number used for the tracking of the status of the shipment.\n", - "example": "HHL71800000" - } - } - }, "SurrenderRequestDetails": { "required": [ "surrenderRequestCode", @@ -245,7 +187,7 @@ "reason": { "maxLength": 4, "type": "string", - "description": "A code defined by DCSA indicating the reason for requesting a surrender for amendment. Possible values are:\n- `SWTP` (Switch to paper)\n", + "description": "A code defined by DCSA indicating the reason for requesting a surrender for amendment. Possible values are:\n-\t`SWTP` (Switch to paper)\n", "example": "SWTP" }, "comments": { @@ -254,9 +196,6 @@ "description": "Optional free text comment associated with the surrender request transaction.", "example": "As requested..." }, - "surrenderRequestedBy": { - "$ref": "#/components/schemas/SurrenderRequestedBy" - }, "endorsementChain": { "minItems": 0, "type": "array", @@ -266,7 +205,7 @@ } } }, - "description": "A concrete surrender request related to a transport document.\n\nThe platform guarantees *all* of the following:\n\n 1) The surrender request was submitted by the sole possessor of the EBL.\n 2) Depending on the eBL type:\n * For non-negoitable (\"straight\") eBLs, the surrender request was submitted by either the original shipper OR the consignee.\n * For negotiable eBLs with a named titleholder, the surrender request was submitted by the named titleholder.\n * For negotiable eBLs without a named titleholder / blank eBLs, possession is sufficient for the entity surrendering the eBL.\n 3) The platform has the EBL in custody while the carrier is evaluating this surrender request. I.e., neither possession nor title holder changes can occur until the carrier responds to this surrender request.\n" + "description": "A concrete surrender request related to a transport document.\n\nThe platform guarantees *all* of the following:\n\n 1) The surrender request was submitted by the sole possessor of the EBL.\n 2) Depending on the eBL type:\n * For non-negotiable (\"straight\") eBLs, the surrender request was submitted by either the original shipper OR the consignee.\n * For negotiable eBLs with a named titleholder, the surrender request was submitted by the named titleholder.\n * For negotiable eBLs without a named titleholder / blank eBLs, possession is sufficient for the entity surrendering the eBL.\n 3) The platform has the EBL in custody while the carrier is evaluating this surrender request. I.e., neither possession nor title holder changes can occur until the carrier responds to this surrender request.\n" }, "IdentifyingCode": { "title": "Identifying Code", @@ -279,7 +218,7 @@ "codeListProvider": { "maxLength": 100, "type": "string", - "description": "A list of codes identifying a party. Possible values are:\n- `WAVE` (Wave)\n- `CARX` (CargoX)\n- `ESSD` (EssDOCS)\n- `IDT` (ICE Digital Trade)\n- `BOLE` (Bolero)\n- `EDOX` (EdoxOnline)\n- `IQAX` (IQAX)\n- `SECR` (Secro)\n- `TRGO` (TradeGO)\n- `ETEU` (eTEU)\n- `GSBN` (Global Shipping Business Network)\n- `WISE` (WiseTech)\n- `GLEIF` (Global Legal Entity Identifier Foundation)\n- `W3C` (World Wide Web Consortium)\n- `DNB` (Dun and Bradstreet)\n- `FMC` (Federal Maritime Commission)\n- `DCSA` (Digitial Container Shipping Association)\n- `ZZZ` (Mutually defined)\n", + "description": "A list of codes identifying a party. Possible values are:\n- `WAVE` (Wave)\n- `CARX` (CargoX)\n- `ESSD` (EssDOCS)\n- `IDT` (ICE Digital Trade)\n- `BOLE` (Bolero)\n- `EDOX` (EdoxOnline)\n- `IQAX` (IQAX)\n- `SECR` (Secro)\n- `TRGO` (TradeGO)\n- `ETEU` (eTEU)\n- `TRAC` (TRACE Original)\n- `BRIT` (BRITC eBL)\n- `GSBN` (Global Shipping Business Network)\n- `WISE` (WiseTech)\n- `GLEIF` (Global Legal Entity Identifier Foundation)\n- `W3C` (World Wide Web Consortium)\n- `DNB` (Dun and Bradstreet)\n- `FMC` (Federal Maritime Commission)\n- `DCSA` (Digital Container Shipping Association)\n- `ZZZ` (Mutually defined)\n", "example": "W3C" }, "partyCode": { @@ -289,7 +228,7 @@ "example": "MSK" }, "codeListName": { - "description": "The name of the code list, code generation mechanism or code authority for the `partyCode`. Example values could be:\n- `DID` (Decenbtralized Identifier) for `codeListProvider` `W3C`\n- `LEI` (Legal Entity Identifier) for `codeListProvider` `GLEIF`\n- `DUNS` (Data Universal Numbering System) for `codeListProvider` `DNB`\n", + "description": "The name of the code list, code generation mechanism or code authority for the `partyCode`. Example values could be:\n- `DID` (Decentralized Identifier) for `codeListProvider` `W3C`\n- `LEI` (Legal Entity Identifier) for `codeListProvider` `GLEIF`\n- `DUNS` (Data Universal Numbering System) for `codeListProvider` `DNB`\n", "example": "DID" } } @@ -470,7 +409,7 @@ "explode": false, "schema": { "type": "string", - "example": "3.0.0-Beta-2" + "example": "3.0.0-Beta-3" } } } diff --git a/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-platform.json b/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-platform.json index 442fd4e2..3cd4c8b7 100644 --- a/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-platform.json +++ b/ebl-surrender/src/main/resources/standards/eblsurrender/schemas/eblsurrender-v3.0.0-platform.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "DCSA EBL Surrender Response API", - "description": "This API is intended as an API between a carrier (the client) and a EBL Solution Platform (the server).\n\nThis API is used to respond to requests that were submitted via the [DCSA EBL Surrender API](https://app.swaggerhub.com/apis-docs/dcsaorg/DCSA_EBL_SUR/3.0.0-Beta-2) API.\n\n### Stats API\nThe Stats API offers crucial statistical information for both API providers and consumers to enhance their services and helps DCSA to understand and scale the ecosystem. We expect you to invoke the Stats API for every request made to this API. Further details can be found [here](https://labs.dcsa.org/#/http/guides/api-guides/stats-api/introduction)\n\nFor a changelog, please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/tree/master/ebl/v3/surrender_response#v300B2). Please [create a GitHub issue](https://github.com/dcsaorg/DCSA-OpenAPI/issues/new) if you have any questions/comments.\n", + "description": "This API is intended as an API between a carrier (the client) and a EBL Solution Platform (the server).\n\nThis API is used to respond to requests that were submitted via the [DCSA EBL Surrender API](https://app.swaggerhub.com/apis-docs/dcsaorg/DCSA_EBL_SUR/3.0.0-Beta-3) API.\n\n### Stats API\nThe Stats API offers crucial statistical information for both API providers and consumers to enhance their services and helps DCSA to understand and scale the ecosystem. We expect you to invoke the Stats API for every request made to this API. Further details can be found [here](https://labs.dcsa.org/#/http/guides/api-guides/stats-api/introduction)\n\nFor a changelog, please click [here](https://github.com/dcsaorg/DCSA-OpenAPI/tree/master/ebl/v3/surrender_response#v300B2). Please [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", @@ -12,11 +12,11 @@ "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "3.0.0-Beta-2" + "version": "3.0.0-Beta-3" }, "servers": [ { - "url": "https://virtserver.swaggerhub.com/dcsaorg/DCSA_EBL_SUR_RSP/3.0.0-Beta-2", + "url": "https://virtserver.swaggerhub.com/dcsaorg/DCSA_EBL_SUR_RSP/3.0.0-Beta-3", "description": "SwaggerHub API Auto Mocking" } ], @@ -276,7 +276,7 @@ "explode": false, "schema": { "type": "string", - "example": "3.0.0-Beta-2" + "example": "3.0.0-Beta-3" } } }