Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DT-1171: Update PINT to 3.0.0-Beta-2 #87

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@With
public record ReceiverScenarioParameters(
String eblPlatform,
String receiverLegalName,
String receiverPartyName,
String receiverEPUI,
String receiverEPUICodeListName,
String receiverPublicKeyPEM
Expand All @@ -18,7 +18,7 @@ public ObjectNode toJson() {
return OBJECT_MAPPER
.createObjectNode()
.put("eblPlatform", eblPlatform)
.put("receiverLegalName", receiverLegalName)
.put("receiverPartyName", receiverPartyName)
.put("receiverEPUI", receiverEPUI)
.put("receiverEPUICodeListName", receiverEPUICodeListName)
.put("receiverPublicKeyPEM", receiverPublicKeyPEM);
Expand All @@ -27,7 +27,7 @@ public ObjectNode toJson() {
public static ReceiverScenarioParameters fromJson(JsonNode jsonNode) {
return new ReceiverScenarioParameters(
jsonNode.required("eblPlatform").asText(),
jsonNode.required("receiverLegalName").asText(),
jsonNode.required("receiverPartyName").asText(),
jsonNode.required("receiverEPUI").asText(),
jsonNode.required("receiverEPUICodeListName").asText(),
jsonNode.required("receiverPublicKeyPEM").asText()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ public static String platform2CodeListName(String platform) {
return PLATFORM2CODELISTNAME.getOrDefault(platform, platform);
}

public static ObjectNode generateTransaction(String action, String sendingPlatform, String sendingLegalName, String sendingEPUI, String receivingPlatform, String receivingLegalName, String receivingEPUI, String receivingCodeListName) {
public static ObjectNode generateTransaction(String action, String sendingPlatform, String sendingPartyName, String sendingEPUI, String receivingPlatform, String receivingPartyName, String receivingEPUI, String receivingCodeListName) {
var actor = OBJECT_MAPPER.createObjectNode()
.put("eblPlatform", sendingPlatform)
.put("legalName", sendingLegalName);
.put("partyName", sendingPartyName);
actor.putArray("partyCodes")
.addObject()
.put("partyCode", sendingEPUI)
.put("codeListProvider", "EPUI")
.put("codeListName", platform2CodeListName(sendingPlatform));
var recipient = OBJECT_MAPPER.createObjectNode()
.put("eblPlatform", receivingPlatform)
.put("legalName", receivingLegalName);
.put("partyName", receivingPartyName);
recipient.putArray("partyCodes")
.addObject()
.put("partyCode", receivingEPUI)
Expand All @@ -146,7 +146,7 @@ public static ObjectNode generateTransaction(String action, String sendingPlatfo
return transaction;
}

public static String generateTransactionEntry(PayloadSigner payloadSigner, String previousEnvelopeTransferChainEntrySignedContentChecksum, String tdChecksum, String action, String sendingPlatform, String sendingLegalName, String sendingEPUI, String receivingPlatform, String receivingLegalName, String receivingEPUI, String receivingCodeListName) {
public static String generateTransactionEntry(PayloadSigner payloadSigner, String previousEnvelopeTransferChainEntrySignedContentChecksum, String tdChecksum, String action, String sendingPlatform, String sendingPartyName, String sendingEPUI, String receivingPlatform, String receivingPartyName, String receivingEPUI, String receivingCodeListName) {
var latestEnvelopeTransferChainUnsigned = OBJECT_MAPPER.createObjectNode()
.put("eblPlatform", sendingPlatform)
.put("transportDocumentChecksum", tdChecksum)
Expand All @@ -157,10 +157,10 @@ public static String generateTransactionEntry(PayloadSigner payloadSigner, Strin
.add(generateTransaction(
action,
sendingPlatform,
sendingLegalName,
sendingPartyName,
sendingEPUI,
receivingPlatform,
receivingLegalName,
receivingPartyName,
receivingEPUI,
receivingCodeListName
));
Expand All @@ -186,20 +186,20 @@ public void manipulateLatestTransaction(PayloadSigner payloadSigner, ReceiverSce
var sendingPlatform = "BOLE";
var receivingPlatform = rsp.eblPlatform();
var sendingEPUI = "1234";
var sendingLegalName = "DCSA CTK tester";
var sendingPartyName = "DCSA CTK tester";
var receivingEPUI = rsp.receiverEPUI();
var receivingLegalName = rsp.receiverLegalName();
var receivingPartyName = rsp.receiverPartyName();
var receiverCodeListName = rsp.receiverEPUICodeListName();
if (sendingPlatform.equals(receivingPlatform)) {
sendingPlatform = "WAVE";
}
var newTransactionEntry = generateTransaction(
"TRNS",
sendingPlatform,
sendingLegalName,
sendingPartyName,
sendingEPUI,
sendingPlatform,
receivingLegalName,
receivingPartyName,
receivingEPUI,
receiverCodeListName
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ private String generateTransactions(ObjectNode payload, String tdChecksum, Sende
var sendingPlatform = "BOLE";
var receivingPlatform = rsp.eblPlatform();
var sendingEPUI = "1234";
var sendingLegalName = "DCSA CTK tester";
var sendingPartyName = "DCSA CTK tester";
var receivingEPUI = rsp.receiverEPUI();
var receivingLegalName = rsp.receiverLegalName();
var receivingPartyName = rsp.receiverPartyName();
var receiverCodeListName = rsp.receiverEPUICodeListName();
if (sendingPlatform.equals(receivingPlatform)) {
sendingPlatform = "WAVE";
Expand All @@ -296,7 +296,7 @@ private String generateTransactions(ObjectNode payload, String tdChecksum, Sende
"DCSA CTK issuer",
"5432",
sendingPlatform,
sendingLegalName,
sendingPartyName,
sendingEPUI,
codeListName
);
Expand All @@ -317,10 +317,10 @@ private String generateTransactions(ObjectNode payload, String tdChecksum, Sende
tdChecksum,
action,
sendingPlatform,
sendingLegalName,
sendingPartyName,
sendingEPUI,
receivingPlatform,
receivingLegalName,
receivingPartyName,
receivingEPUI,
receiverCodeListName
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"platformHost": "https://exampleblplatform.net",
"actor": {
"eBLPlatformIdentifier": "[email protected]",
"legalName": "Some carrier"
"partyName": "Some carrier"
},
"recipient": {
"eBLPlatformIdentifier": "RECEIVER_PLATFORM_IDENTIFIER",
"legalName": "RECEIVER_LEGAL_NAME"
"partyName": "RECEIVER_LEGAL_NAME"
},
"action": "ISSU"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,99 @@
"shippedOnBoardDate": "2024-02-02",
"freightPaymentTermCode": "PRE",
"transportDocumentStatus": "ISSUED",
"utilizedTransportEquipments": [],
"utilizedTransportEquipments": [
{
"equipment": {
"equipmentReference": "NARU3472484"
},
"cargoGrossWeightUnit": "KGM",
"isShipperOwned": true,
"seals": [
{
"number": "1234"
}
]
}
],
"transports": {
"vesselName": "Emma Maersk",
"vesselIMONumber": "1234567",
"plannedDepartureDate": "2024-02-02",
"plannedArrivalDate": "2124-02-02",
"carrierExportVoyageNumber": "2433W",
"portOfLoading": {
"locationType": "UNCO",
"UNLocationCode": "DKCPH"
},
"portOfDischarge": {
"locationType": "UNCO",
"UNLocationCode": "NLRTM"
}
},
"vesselVoyage": [
{
"carrierExportVoyageNumber": "2433W",
"vesselName": "COFFEE BEANS"
}
]
},
"partyContactDetails": [
{
"name": "Nobody",
"phone": "+1234567890"
}
],
"consignmentItems": [],
"documentParties": [
{
"party": {
"partyName": "DCSA CTK SHIPPER",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
}
]
},
"partyFunction": "OS",
"isToBeNotified": false
},
{
"party": {
"partyName": "DCSA CTK Consignee",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
}
]
},
"partyFunction": "CN",
"isToBeNotified": false
},
"consignmentItems": [
{
"party": {
"partyName": "DCSA CTK Service Contract Owner",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
"carrierBookingReference": "1234",
"descriptionOfGoods": "Shoes - black, 400 boxes",
"HSCodes": ["640510"],
"cargoItems": [
{
"equipmentReference": "NARU3472484",
"weight": 12000,
"weightUnit": "KGM",
"outerPackaging": {
"numberOfPackages": 400,
"description": "Fibreboard boxes"
}
]
},
"partyFunction": "SCO",
"isToBeNotified": false
}
]
}
],
"documentParties": {
"shipper": {
"partyName": "DCSA CTK SHIPPER",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
}
]
},
"consignee": {
"partyName": "DCSA CTK Consignee",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
}
]
},
"other": [
{
"party": {
"partyName": "DCSA CTK Service Contract Owner",
"partyContactDetails": [
{
"name": "DCSA test person",
"email": "[email protected]"
}
]
},
"partyFunction": "SCO",
"isToBeNotified": false
}
]
},
"carrierCode": "ASDF",
"carrierCodeListProvider": "NMFTA",
"issuingParty": {
Expand All @@ -90,7 +119,13 @@
"name": "issuing party",
"phone": "+01234567890"
}
]
],
"address": {
"city": "Amsterdam",
"countryCode": "NL",
"street": "...some street ...",
"streetNumber": "... some street number ..."
}
},
"shippingInstruction": {
"shippingInstructionReference": "SHIPPING_INSTRUCTION_REFERENCE_PLACEHOLDER",
Expand Down
Loading
Loading