-
Notifications
You must be signed in to change notification settings - Fork 0
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 740 #27
Dt 740 #27
Changes from 10 commits
6838f00
0d9eb00
3f7c40e
5c58271
928ff07
ae5a6e4
dd30c31
8d93f87
17bf9db
7ff3153
dd0b4e2
7e55896
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -32,85 +32,6 @@ public static BookingScenarioListBuilder buildTree( | |||||||||||||||||||||
threadLocalComponentFactory.set(componentFactory); | ||||||||||||||||||||||
threadLocalCarrierPartyName.set(carrierPartyName); | ||||||||||||||||||||||
threadLocalShipperPartyName.set(shipperPartyName); | ||||||||||||||||||||||
if (System.currentTimeMillis() > 0) { // FIXME remove this | ||||||||||||||||||||||
// This is what's been implemented so far and should still work on PR. | ||||||||||||||||||||||
return carrier_SupplyScenarioParameters() | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc1_shipper_SubmitBookingRequest(BookingVariant.REEFER).then( | ||||||||||||||||||||||
shipper_GetBooking(RECEIVED) | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest() | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking(CONFIRMED) | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
uc11_carrier_confirmBookingCompleted() | ||||||||||||||||||||||
.then(shipper_GetBooking(COMPLETED)))))), | ||||||||||||||||||||||
uc1_shipper_SubmitBookingRequest(BookingVariant.REGULAR) | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking(RECEIVED) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest() | ||||||||||||||||||||||
.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() | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking(PENDING_AMENDMENT) | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
uc7_shipper_submitBookingAmendment() | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking( | ||||||||||||||||||||||
PENDING_AMENDMENT, | ||||||||||||||||||||||
AMENDMENT_RECEIVED) | ||||||||||||||||||||||
.then (uc9_shipper_cancelBookingAmendment() | ||||||||||||||||||||||
.then(shipper_GetBooking( | ||||||||||||||||||||||
PENDING_AMENDMENT, | ||||||||||||||||||||||
CANCELLED)))))), | ||||||||||||||||||||||
uc7_shipper_submitBookingAmendment() | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking(CONFIRMED, AMENDMENT_RECEIVED) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc8a_carrier_approveBookingAmendment() | ||||||||||||||||||||||
.then(shipper_GetBooking( | ||||||||||||||||||||||
CONFIRMED, CONFIRMED)), | ||||||||||||||||||||||
uc8b_carrier_declineBookingAmendment() | ||||||||||||||||||||||
.then(shipper_GetBooking( | ||||||||||||||||||||||
CONFIRMED, DECLINED)), | ||||||||||||||||||||||
uc9_shipper_cancelBookingAmendment() | ||||||||||||||||||||||
.then(shipper_GetBooking( | ||||||||||||||||||||||
CONFIRMED, CANCELLED)), | ||||||||||||||||||||||
uc10_carrier_declineBooking() | ||||||||||||||||||||||
.then(shipper_GetBooking( | ||||||||||||||||||||||
DECLINED, DECLINED)) | ||||||||||||||||||||||
)), | ||||||||||||||||||||||
uc10_carrier_declineBooking() | ||||||||||||||||||||||
.then(shipper_GetBooking(DECLINED)), | ||||||||||||||||||||||
uc12_shipper_cancelBooking() | ||||||||||||||||||||||
.then(shipper_GetBooking(CANCELLED)))), | ||||||||||||||||||||||
uc4_carrier_rejectBookingRequest().then(shipper_GetBooking(REJECTED)), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().then(shipper_GetBooking(CANCELLED)), | ||||||||||||||||||||||
uc2_carrier_requestUpdateToBookingRequest() | ||||||||||||||||||||||
.then(shipper_GetBooking(PENDING_UPDATE)), | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest() | ||||||||||||||||||||||
.then(shipper_GetBooking(PENDING_UPDATE_CONFIRMATION)), | ||||||||||||||||||||||
shipper_GetAmendedBooking404().then( | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest().then( | ||||||||||||||||||||||
shipper_GetAmendedBooking404().then(uc7_shipper_submitBookingAmendment() | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
shipper_GetBooking( | ||||||||||||||||||||||
CONFIRMED, | ||||||||||||||||||||||
AMENDMENT_RECEIVED, | ||||||||||||||||||||||
true | ||||||||||||||||||||||
)))))))); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
return carrier_SupplyScenarioParameters().thenAllPathsFrom(START); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -121,79 +42,96 @@ private BookingScenarioListBuilder thenAllPathsFrom(BookingState bookingState) { | |||||||||||||||||||||
private BookingScenarioListBuilder thenAllPathsFrom( | ||||||||||||||||||||||
BookingState bookingState, BookingState originalBookingState) { | ||||||||||||||||||||||
return switch (bookingState) { | ||||||||||||||||||||||
case CANCELLED, COMPLETED, DECLINED, REJECTED -> then(shipper_GetBooking(bookingState)); | ||||||||||||||||||||||
case CANCELLED, COMPLETED, DECLINED, REJECTED -> then(shipper_GetBooking(bookingState)); | ||||||||||||||||||||||
case CONFIRMED -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest().thenHappyPathFrom(CONFIRMED), | ||||||||||||||||||||||
uc6_carrier_requestBookingAmendment().thenAllPathsFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc6_carrier_requestUpdateToConfirmedBooking().thenAllPathsFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc7_shipper_submitBookingAmendment() | ||||||||||||||||||||||
.thenAllPathsFrom(AMENDMENT_RECEIVED, CONFIRMED), | ||||||||||||||||||||||
uc10_carrier_declineBooking().thenAllPathsFrom(DECLINED), | ||||||||||||||||||||||
uc11_carrier_confirmBookingCompleted().thenAllPathsFrom(COMPLETED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
uc12_carrier_confirmBookingCompleted().thenAllPathsFrom(COMPLETED), | ||||||||||||||||||||||
uc11_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
case PENDING_UPDATE -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc2_carrier_requestUpdateToBookingRequest().thenHappyPathFrom(PENDING_UPDATE), | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest() | ||||||||||||||||||||||
.thenHappyPathFrom(PENDING_UPDATE_CONFIRMATION), | ||||||||||||||||||||||
.thenHappyPathFrom(UPDATE_RECEIVED), | ||||||||||||||||||||||
uc4_carrier_rejectBookingRequest().thenHappyPathFrom(REJECTED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
case PENDING_UPDATE_CONFIRMATION -> then( | ||||||||||||||||||||||
uc11_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
case UPDATE_RECEIVED -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc2_carrier_requestUpdateToBookingRequest().thenHappyPathFrom(PENDING_UPDATE), | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest() | ||||||||||||||||||||||
.thenHappyPathFrom(PENDING_UPDATE_CONFIRMATION), | ||||||||||||||||||||||
.thenHappyPathFrom(UPDATE_RECEIVED), | ||||||||||||||||||||||
uc4_carrier_rejectBookingRequest().thenHappyPathFrom(REJECTED), | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest().thenHappyPathFrom(CONFIRMED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
uc11_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
case RECEIVED -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc2_carrier_requestUpdateToBookingRequest().thenAllPathsFrom(PENDING_UPDATE), | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest() | ||||||||||||||||||||||
.thenAllPathsFrom(PENDING_UPDATE_CONFIRMATION), | ||||||||||||||||||||||
.thenAllPathsFrom(UPDATE_RECEIVED), | ||||||||||||||||||||||
uc4_carrier_rejectBookingRequest().thenAllPathsFrom(REJECTED), | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest().thenAllPathsFrom(CONFIRMED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenAllPathsFrom(CANCELLED))); | ||||||||||||||||||||||
uc11_shipper_cancelBooking().thenAllPathsFrom(CANCELLED))); | ||||||||||||||||||||||
case START -> thenEither( | ||||||||||||||||||||||
uc1_shipper_SubmitBookingRequest(BookingVariant.REGULAR).thenAllPathsFrom(RECEIVED), | ||||||||||||||||||||||
uc1_shipper_SubmitBookingRequest(BookingVariant.REEFER).thenHappyPathFrom(RECEIVED)); | ||||||||||||||||||||||
case PENDING_AMENDMENT -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc6_carrier_requestBookingAmendment().thenHappyPathFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc7_shipper_submitBookingAmendment() | ||||||||||||||||||||||
.thenAllPathsFrom(AMENDMENT_RECEIVED, PENDING_AMENDMENT), | ||||||||||||||||||||||
uc10_carrier_declineBooking().thenHappyPathFrom(DECLINED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
uc11_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
case AMENDMENT_RECEIVED -> then( | ||||||||||||||||||||||
shipper_GetBooking(bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc6_carrier_requestBookingAmendment().thenHappyPathFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc8a_carrier_approveBookingAmendment().thenHappyPathFrom(CONFIRMED), | ||||||||||||||||||||||
uc8b_carrier_declineBookingAmendment().thenHappyPathFrom(CONFIRMED), | ||||||||||||||||||||||
uc9_shipper_cancelBookingAmendment().thenHappyPathFrom(originalBookingState), | ||||||||||||||||||||||
uc10_carrier_declineBooking().thenHappyPathFrom(DECLINED), | ||||||||||||||||||||||
uc12_shipper_cancelBooking().thenHappyPathFrom(CANCELLED))); | ||||||||||||||||||||||
shipper_GetBooking(originalBookingState,AMENDMENT_RECEIVED) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT), | ||||||||||||||||||||||
uc8a_carrier_approveBookingAmendment().thenAllPathsFrom(AMENDMENT_CONFIRMED,originalBookingState), | ||||||||||||||||||||||
uc8b_carrier_declineBookingAmendment().thenAllPathsFrom(AMENDMENT_DECLINED,originalBookingState), | ||||||||||||||||||||||
uc9_shipper_cancelBookingAmendment().thenAllPathsFrom(AMENDMENT_CANCELLED,originalBookingState), | ||||||||||||||||||||||
uc10_carrier_declineBooking().thenHappyPathFrom(DECLINED) | ||||||||||||||||||||||
) | ||||||||||||||||||||||
); | ||||||||||||||||||||||
case AMENDMENT_CONFIRMED -> then( | ||||||||||||||||||||||
shipper_GetBooking(CONFIRMED,bookingState) | ||||||||||||||||||||||
.thenEither( | ||||||||||||||||||||||
uc12_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED), | ||||||||||||||||||||||
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT) | ||||||||||||||||||||||
) | ||||||||||||||||||||||
); | ||||||||||||||||||||||
case AMENDMENT_CANCELLED, AMENDMENT_DECLINED -> then( | ||||||||||||||||||||||
shipper_GetBooking(originalBookingState,bookingState) | ||||||||||||||||||||||
.then( | ||||||||||||||||||||||
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT) | ||||||||||||||||||||||
) | ||||||||||||||||||||||
); | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From I think this case can be simplified into:
Suggested change
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
private BookingScenarioListBuilder thenHappyPathFrom(BookingState bookingState) { | ||||||||||||||||||||||
return switch (bookingState) { | ||||||||||||||||||||||
case CANCELLED, COMPLETED, DECLINED, REJECTED -> then(noAction()); | ||||||||||||||||||||||
case CONFIRMED -> then(uc11_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED)); | ||||||||||||||||||||||
case CONFIRMED, AMENDMENT_CONFIRMED -> then( | ||||||||||||||||||||||
uc12_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED)); | ||||||||||||||||||||||
case PENDING_AMENDMENT -> then( | ||||||||||||||||||||||
uc7_shipper_submitBookingAmendment().thenHappyPathFrom(AMENDMENT_RECEIVED)); | ||||||||||||||||||||||
case AMENDMENT_RECEIVED -> then( | ||||||||||||||||||||||
uc8a_carrier_approveBookingAmendment().thenHappyPathFrom(CONFIRMED)); | ||||||||||||||||||||||
case PENDING_UPDATE -> then( | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest().thenHappyPathFrom(PENDING_UPDATE_CONFIRMATION)); | ||||||||||||||||||||||
case PENDING_UPDATE_CONFIRMATION, RECEIVED -> then( | ||||||||||||||||||||||
uc3_shipper_submitUpdatedBookingRequest().thenHappyPathFrom(UPDATE_RECEIVED)); | ||||||||||||||||||||||
case UPDATE_RECEIVED, RECEIVED -> then( | ||||||||||||||||||||||
uc5_carrier_confirmBookingRequest().thenHappyPathFrom(CONFIRMED)); | ||||||||||||||||||||||
case START -> then(uc1_shipper_SubmitBookingRequest(BookingVariant.REGULAR).thenHappyPathFrom(RECEIVED)); | ||||||||||||||||||||||
case AMENDMENT_DECLINED, AMENDMENT_CANCELLED -> throw new AssertionError( | ||||||||||||||||||||||
"This happyPath from this state requires a context state"); | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -265,8 +203,6 @@ private static BookingScenarioListBuilder uc1_shipper_SubmitBookingRequest(Booki | |||||||||||||||||||||
variant)); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
private static BookingScenarioListBuilder carrierStateChange( | ||||||||||||||||||||||
CarrierNotificationUseCase constructor) { | ||||||||||||||||||||||
BookingComponentFactory componentFactory = threadLocalComponentFactory.get(); | ||||||||||||||||||||||
|
@@ -314,10 +250,6 @@ private static BookingScenarioListBuilder uc6_carrier_requestUpdateToConfirmedBo | |||||||||||||||||||||
return carrierStateChange(UC6_Carrier_RequestUpdateToConfirmedBookingAction::new); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
private static BookingScenarioListBuilder uc6_carrier_requestBookingAmendment() { | ||||||||||||||||||||||
return tbdCarrierAction(); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
private static BookingScenarioListBuilder uc7_shipper_submitBookingAmendment() { | ||||||||||||||||||||||
BookingComponentFactory componentFactory = threadLocalComponentFactory.get(); | ||||||||||||||||||||||
String carrierPartyName = threadLocalCarrierPartyName.get(); | ||||||||||||||||||||||
|
@@ -363,17 +295,17 @@ private static BookingScenarioListBuilder uc10_carrier_declineBooking() { | |||||||||||||||||||||
return carrierStateChange(UC10_Carrier_DeclineBookingAction::new); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
private static BookingScenarioListBuilder uc11_carrier_confirmBookingCompleted() { | ||||||||||||||||||||||
return carrierStateChange(UC11_Carrier_ConfirmBookingCompletedAction::new); | ||||||||||||||||||||||
private static BookingScenarioListBuilder uc12_carrier_confirmBookingCompleted() { | ||||||||||||||||||||||
return carrierStateChange(UC12_Carrier_ConfirmBookingCompletedAction::new); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
private static BookingScenarioListBuilder uc12_shipper_cancelBooking() { | ||||||||||||||||||||||
private static BookingScenarioListBuilder uc11_shipper_cancelBooking() { | ||||||||||||||||||||||
BookingComponentFactory componentFactory = threadLocalComponentFactory.get(); | ||||||||||||||||||||||
String carrierPartyName = threadLocalCarrierPartyName.get(); | ||||||||||||||||||||||
String shipperPartyName = threadLocalShipperPartyName.get(); | ||||||||||||||||||||||
return new BookingScenarioListBuilder( | ||||||||||||||||||||||
previousAction -> | ||||||||||||||||||||||
new UC12_Shipper_CancelEntireBookingAction( | ||||||||||||||||||||||
new UC11_Shipper_CancelEntireBookingAction( | ||||||||||||||||||||||
carrierPartyName, | ||||||||||||||||||||||
shipperPartyName, | ||||||||||||||||||||||
(BookingAction) previousAction, | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,26 +6,25 @@ | |
import org.dcsa.conformance.core.check.*; | ||
import org.dcsa.conformance.core.traffic.HttpMessageType; | ||
import org.dcsa.conformance.standards.booking.checks.CarrierBookingNotificationDataPayloadRequestConformanceCheck; | ||
import org.dcsa.conformance.standards.booking.checks.CarrierBookingRefStatusPayloadResponseConformanceCheck; | ||
import org.dcsa.conformance.standards.booking.party.BookingRole; | ||
import org.dcsa.conformance.standards.booking.party.BookingState; | ||
|
||
@Getter | ||
public class UC11_Carrier_ConfirmBookingCompletedAction extends StateChangingBookingAction { | ||
public class UC12_Carrier_ConfirmBookingCompletedAction extends StateChangingBookingAction { | ||
private final JsonSchemaValidator requestSchemaValidator; | ||
|
||
public UC11_Carrier_ConfirmBookingCompletedAction( | ||
public UC12_Carrier_ConfirmBookingCompletedAction( | ||
String carrierPartyName, | ||
String shipperPartyName, | ||
BookingAction previousAction, | ||
JsonSchemaValidator requestSchemaValidator) { | ||
super(carrierPartyName, shipperPartyName, previousAction, "UC11", 204); | ||
super(carrierPartyName, shipperPartyName, previousAction, "UC12", 204); | ||
this.requestSchemaValidator = requestSchemaValidator; | ||
} | ||
|
||
@Override | ||
public String getHumanReadablePrompt() { | ||
return ("UC11: Complete the booking request with CBR %s" | ||
return ("UC12: Complete the booking request with CBR %s" | ||
.formatted(getDspSupplier().get().carrierBookingReference())); | ||
} | ||
|
||
|
@@ -42,14 +41,16 @@ public ConformanceCheck createCheck(String expectedApiVersion) { | |
return new ConformanceCheck(getActionTitle()) { | ||
@Override | ||
protected Stream<? extends ConformanceCheck> createSubChecks() { | ||
var dsp = getDspSupplier().get(); | ||
return Stream.of( | ||
new UrlPathCheck( | ||
BookingRole::isCarrier, getMatchedExchangeUuid(), "/v2/booking-notifications"), | ||
new ResponseStatusCheck( | ||
BookingRole::isShipper, getMatchedExchangeUuid(), expectedStatus), | ||
new CarrierBookingNotificationDataPayloadRequestConformanceCheck( | ||
getMatchedExchangeUuid(), | ||
BookingState.COMPLETED | ||
BookingState.COMPLETED, | ||
dsp.amendedBookingStatus() != null ? BookingState.AMENDMENT_CONFIRMED : null | ||
), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not look correct. It should be possible to end with a AMENDEDMENT that was declined/cancelled when reaching the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we are not calling UC12 for amendment Declined or cancelled. https://miro.com/app/board/uXjVND1csI8=/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a confirmed booking never has a grey state, then having line 53 is incorrect. Either way, the code is inconsistent by saying that if there is an amended status, it must be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, this one is still "unanswered". I suspect it is because the scenarios do not cover the case of (as an example): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get ur point. The amendedBookingStatus shouldnt be checked in the UC12. 👍 because the flow of confirmed amendment itself complete after UC8A . am I right ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I would expect the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the miro board, UC12 shouldnt be having any AMENDMENT status. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please verify that assertion with Flavia. Sometimes the states can inherit the amendment/updated state even though it is not visible in the Miro board. (In eBL, after When discussing the scenario with Flavia, be sure to show an exceptional case where you could end up in UC12 with an amended state. Example: I hope she agrees with you, because then we can just "reset" the amendment state + content when doing UC12 and simplify the check here. But as said, please confirm with the PO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed with internally, at UC12 we dont need to check the final AmendmentStatus for Booking. |
||
ApiHeaderCheck.createNotificationCheck( | ||
BookingRole::isCarrier, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace this line with:
The noAction() is a stepping stone for enabling the
.thenHappyPathFrom
call.