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 fe783c5d..2f87df2d 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 @@ -44,6 +44,12 @@ public static BookingScenarioListBuilder buildTree( .then( shipper_GetBooking(CONFIRMED) .thenEither( + uc5_carrier_confirmBookingRequest() + .then( + shipper_GetBooking(CONFIRMED) + .then( + uc11_carrier_confirmBookingCompleted() + .then(shipper_GetBooking(COMPLETED)))), uc11_carrier_confirmBookingCompleted() .then(shipper_GetBooking(COMPLETED)), uc6_carrier_requestUpdateToConfirmedBooking() @@ -110,6 +116,7 @@ private BookingScenarioListBuilder thenAllPathsFrom( case CONFIRMED -> then( shipper_GetBooking(bookingState) .thenEither( + uc5_carrier_confirmBookingRequest().thenHappyPathFrom(CONFIRMED), uc6_carrier_requestBookingAmendment().thenAllPathsFrom(PENDING_AMENDMENT), uc7_shipper_submitBookingAmendment() .thenAllPathsFrom(AMENDMENT_RECEIVED, CONFIRMED), diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Carrier.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Carrier.java index 6098ccb2..276ff255 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Carrier.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/party/Carrier.java @@ -156,6 +156,10 @@ private void confirmBookingRequest(JsonNode actionPrompt) { "Confirmed the booking request with CBRR '%s'".formatted(cbrr)); var persistableCarrierBooking = PersistableCarrierBooking.fromPersistentStore(persistentMap, cbrr); + var bookingStatus = persistableCarrierBooking.getBooking().get("bookingStatus").asText(); + if (bookingStatus.equals(BookingState.CONFIRMED.wireName())) { + persistableCarrierBooking.getBooking().put("importLicenseReference","importLicenseRefUpdate"); + } persistableCarrierBooking.confirmBooking(cbrr, () -> generateAndAssociateCBR(cbrr), null); persistableCarrierBooking.save(persistentMap); generateAndEmitNotificationFromBooking(actionPrompt, persistableCarrierBooking, true); @@ -220,6 +224,7 @@ private void confirmBookingCompleted(JsonNode actionPrompt) { String cbrr = actionPrompt.get("cbrr").asText(); String cbr = cbrrToCbr.get(cbrr); + processAndEmitNotificationForStateTransition( actionPrompt, BookingState.COMPLETED);