-
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
Conversation
booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java
Outdated
Show resolved
Hide resolved
booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java
Outdated
Show resolved
Hide resolved
booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java
Outdated
Show resolved
Hide resolved
booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
booking/src/main/java/org/dcsa/conformance/standards/booking/BookingScenarioListBuilder.java
Outdated
Show resolved
Hide resolved
BookingState.COMPLETED | ||
BookingState.COMPLETED, | ||
dsp.amendedBookingStatus() != null ? BookingState.AMENDMENT_CONFIRMED : null | ||
), |
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.
This does not look correct. It should be possible to end with a AMENDEDMENT that was declined/cancelled when reaching the UC12_Carrier_ConfirmBookingCompletedAction
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.
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 comment
The 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.
If a confirmed booking can have a grey state, then it could have any of the grey states AMENDMENT CONFIRMED
, AMENDMENT DECLINED
or AMENDMENT CANCELLED
.
Either way, the code is inconsistent by saying that if there is an amended status, it must be AMENDMENT CONFIRMED
.
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.
For me, this one is still "unanswered". I suspect it is because the scenarios do not cover the case of (as an example): ... -> UC5 -> UC7 -> UC9 -> UC12
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.
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 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would expect the amendedBookingStatus
in UC12 should match the value of dsp.amendedBookingStatus()
.
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.
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 comment
The 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 UC4a
, the RECEIVED
state is actually RECEIVED
+ UPDATE CONFIRMED
even though the UPDATE CONFIRMED
is not visible).
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: ... -> UC5 -> UC7 -> UC8a -> UC12
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 comment
The 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.
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
booking/src/main/java/org/dcsa/conformance/standards/booking/party/Carrier.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
private static final Set<BookingState> MAY_UPDATE_REQUEST_STATES = Set.of( | ||
RECEIVED, | ||
PENDING_UPDATE, | ||
PENDING_UPDATE_CONFIRMATION | ||
UPDATE_RECEIVED | ||
); | ||
|
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.
This is mixing original
and amended
states but it is used only with original states in putBooking
, which makes me suspect the logic is not correctly updated.
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.
Is NOT_APPLICABLE_FOR_SIMPLE_STATE_CHANGE
and MAY_UPDATE_REQUEST_STATES
still used? If not, please remove them.
If they are, then that code is probably still broken because of how we do state checks now.
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 removed NOT_APPLICABLE_FOR_SIMPLE_STATE_CHANGE.
MAY_UPDATE_REQUEST_STATES is still being used in PutBooking.. Hence I didnt touch it
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.
Ok, but the use of MAY_UPDATE_REQUEST_STATES
in putBooking
is from the time where getBookingState()
could return the amended or the original booking. Given getBookingState()
(now getOriginalBookingState()
) always returns the original booking state, the state in putBooking
must be updated to align with the new semantics.
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
...ng/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
Outdated
Show resolved
Hide resolved
@@ -123,7 +130,9 @@ public void confirmBooking(String reference, Supplier<String> cbrGenerator, Stri | |||
setReason(reason); | |||
} | |||
|
|||
|
|||
public void resetAmendedBookingState() { |
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.
This method should be private
as it is not intended for external usage.
String cbrr = actionPrompt.get("cbrr").asText(); | ||
String cbr = actionPrompt.get("cbr").asText(); |
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.
(for a future change): The actionPrompt.get
should be actiopnPrompt.required
(generally anywhere you see them).
I have begun replacing them in the eBL code. But as said, do it in a later commit
case AMENDMENT_CONFIRMED -> then( | ||
shipper_GetBooking(CONFIRMED,bookingState) | ||
.thenEither( | ||
uc12_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED), |
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:
uc12_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED), | |
noAction().thenHappyPathFrom(CONFIRMED), |
The noAction() is a stepping stone for enabling the .thenHappyPathFrom
call.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
From AMENDMENT_CANCELLED
and AMENDMENT_DECLINED
the possible actions depend on the original booking state.
I think this case can be simplified into:
case AMENDMENT_CANCELLED, AMENDMENT_DECLINED -> then( | |
shipper_GetBooking(originalBookingState,bookingState) | |
.then( | |
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT) | |
) | |
); | |
}; | |
case AMENDMENT_CANCELLED, AMENDMENT_DECLINED -> then( | |
shipper_GetBooking(originalBookingState,bookingState) | |
.thenHappyPathFrom(originalBookingState)); |
uc12_carrier_confirmBookingCompleted().thenHappyPathFrom(COMPLETED), | ||
uc6_carrier_requestUpdateToConfirmedBooking().thenHappyPathFrom(PENDING_AMENDMENT) | ||
noAction().thenHappyPathFrom(CONFIRMED), | ||
noAction().thenHappyPathFrom(PENDING_AMENDMENT) |
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.
Logically, this looks weird. Code wise, this looks like we are in two different states at the same time.
Line 104 asserts we are in CONFIRMED
so there for the thenHappyPathFrom(PENDING_AMENDMENT)
does not fit the bill. Either line 104 is not correct or line 107 is misleading.
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.
Because the State of the booking is in two states CONFIRMED and PENDING_AMENDMENT
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.
For future reference: As far as this state flow generation works, it is in state PENDING_AMENDMENT
(for when computing future states)
As an example, it does not make sense for the booking to be completed while it is in PENDING_AMENDMENT
. The PENDING_AMENDMENT
state means the carrier cannot complete the booking in its current form. This means that the complete booking
action is too forgiving. It should not allow a booking in PENDING_AMENDMENT
to complete.
No description provided.