Skip to content

Commit

Permalink
Merge pull request #19 from dcsaorg/DT-713_carrier_change
Browse files Browse the repository at this point in the history
DT-713 change 2.
  • Loading branch information
preetamnpr authored Dec 4, 2023
2 parents 18990f1 + ba3cad2 commit 92a8cc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -220,6 +224,7 @@ private void confirmBookingCompleted(JsonNode actionPrompt) {
String cbrr = actionPrompt.get("cbrr").asText();
String cbr = cbrrToCbr.get(cbrr);


processAndEmitNotificationForStateTransition(
actionPrompt,
BookingState.COMPLETED);
Expand Down

0 comments on commit 92a8cc8

Please sign in to comment.