Skip to content

Improve Itinerary Checks#376

Merged
binh-dam-ibigroup merged 15 commits intodevfrom
improve-itinerary-checks
May 4, 2026
Merged

Improve Itinerary Checks#376
binh-dam-ibigroup merged 15 commits intodevfrom
improve-itinerary-checks

Conversation

@binh-dam-ibigroup
Copy link
Copy Markdown
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Apr 28, 2026

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • [na] The description lists all applicable issues this PR seeks to resolve
  • [na] The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR improves itinerary checks:

  • For new monitored trips, where a /checkitinerary call is made by a client prior to persisting, the itinerary check result is placed in a cache and consumed when the trip that triggered the check is persisted, with the condition that the client provides the check id in the trip's itineraryExistence.id field. This avoids performing the check again upon initial POST. If itineraryExistence.id is not provided, the check is performed on POST as before.
  • For existing trips, a request to /checkitinerary causes the returned ItineraryExistence to be also persisted into the existing trip. The PUT operation on an existing trip does not touch existing content in itineraryExistence.

Tests are added for the new logic and to solidify the existing logic.

Copy link
Copy Markdown
Contributor

@br648 br648 left a comment

Choose a reason for hiding this comment

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

Just one minor suggestion. Tests all pass. Approving.

HttpStatus.BAD_REQUEST_400,
monitoredTrip.itineraryExistence.message
);
String checkId = monitoredTrip.itineraryExistence != null ? monitoredTrip.itineraryExistence.id : null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this block would be cleaner in it's own method. Is the FIXME still a thing? The PR has been merged.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I extracted the block in 76034a1. Good remark on the TODO, I got rid of it with fc0fe3b but kept the old behavior to let persist regardless of existence result.

@br648 br648 assigned binh-dam-ibigroup and unassigned br648 Apr 29, 2026
Copy link
Copy Markdown
Contributor

@br648 br648 left a comment

Choose a reason for hiding this comment

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

Yep, that looks much better. Thanks for updating.

Copy link
Copy Markdown
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

I think this makes sense! Thank you for the changes

@binh-dam-ibigroup binh-dam-ibigroup merged commit 48e47a4 into dev May 4, 2026
2 checks passed
@binh-dam-ibigroup binh-dam-ibigroup deleted the improve-itinerary-checks branch May 4, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants