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-713 change 2. #19

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -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(COMPLETED),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think that this continues with the happy paths from CONFIRMED, not from COMPLETED, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.. the last change had this state, but the new change is somewhat i overlooked it.. all good..

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
Loading