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

fix(check-monitored-trip): advance to next trip day when itinerary is no longer valid #284

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

josh-willis-arcadis
Copy link

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
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing
  • The description lists all relevant PRs included in this release (remove this if not merging to master)

Description

After submitting a trip with certain monitored days, the next trip can be shown on a day that is not monitored. Adds a check on the previous matching itinerary against days the trip should be monitored.

Copy link
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.

A few minors, but apart from them, all good.

import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

We use explict imports. Can you revert this please. There is also a setting in Intellij (assuming you are using this) that prevents this.

@@ -771,6 +764,33 @@ public boolean shouldSkipMonitoredTripCheck(boolean persist) throws Exception {
return true;
}

// Check if previous matching itinerary day is still valid
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change this to a method comment. Start with /** and end with */

Calendar calendar = Calendar.getInstance();
calendar.setTime(previousMatchingItinerary.startTime);

int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. You could in-line this variable.

@br648 br648 assigned josh-willis-arcadis and unassigned br648 Dec 23, 2024
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.

2 participants