-
Notifications
You must be signed in to change notification settings - Fork 2
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
Post deviated trip notification #260
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
9fc6822
feat(TrackedJourney): Add method to compute total deviation.
binh-dam-ibigroup 6507d5a
feat(TrackedJourney): Persist total deviation upon completing journey.
binh-dam-ibigroup 44c456e
.feat(OtpUser): Add field for last survey notif sent.
binh-dam-ibigroup 9e19b1e
refactor(ApiController): Extract const for mongo id field.
binh-dam-ibigroup 462639b
refactor(MonitoredTrip): Extract const for trip id field.
binh-dam-ibigroup 1f31842
feat(TripSurveySenderJob): Add basic logic for trip survey job.
binh-dam-ibigroup 2e2473f
refactor(TripSurveySenderJob): Convert methods to static.
binh-dam-ibigroup 2432090
test(TripSurveySenderJob): Reuse journeys.
binh-dam-ibigroup c00ac92
feat(TripSurveySenderJob): Send push notification using current svc f…
binh-dam-ibigroup ca2b8aa
feat(OtpMiddlewareMain): Schedule trip survey job.
binh-dam-ibigroup 20fdb33
docs(swagger): Update snapshot.
binh-dam-ibigroup ab5a82f
fix(TripSurveySenderJob): Include missing last trip survey field in u…
binh-dam-ibigroup 828afdc
refactor(TripSurveySenderJob): Remove day of week in survey push mess…
binh-dam-ibigroup 3ed298b
docs(OtpMiddlewareMain): Fix trip survey comment typo.
binh-dam-ibigroup fa6b838
refactor(TrackedJourney): Introduce consecutive deviation metric.
binh-dam-ibigroup 72ecf80
refactor(TripSurveySenderJob): Add a minimum 1-minute deviation thres…
binh-dam-ibigroup e46abca
Merge branch 'dev' into post-deviated-trip-notification
binh-dam-ibigroup 25d19f9
Merge branch 'dev' into post-deviated-trip-notification
binh-dam-ibigroup be37335
refactor(TrackedJourney): Remove cumulative deviation field.
binh-dam-ibigroup 653b62c
Merge branch 'dev' into post-deviated-trip-notification
binh-dam-ibigroup eb59c11
fix(TripSurveySenderJob): Send survey notifications within 30 mins of…
binh-dam-ibigroup cd2b05a
docs: Introduce new TRIP_SURVEY_ID config parameter.
binh-dam-ibigroup b27a4dd
refactor(Message): Extract i18n message for trip survey notification,…
binh-dam-ibigroup 4cd55b0
refactor(TripSurveySenderJob): Streamline notification for trip surveys.
binh-dam-ibigroup 740fdc7
refactor(NotificationUtils): Add surveyId and userId fields and rewor…
binh-dam-ibigroup 6c55481
feat(NotificationUtils): Pass surveyId with trip survey notifications.
binh-dam-ibigroup 90d1f4b
docs(swagger): Update snapshot.
binh-dam-ibigroup b89e1db
refactor(TripSurveySenderJob): Rename variable.
binh-dam-ibigroup 8d92c4f
refactor(NotificationUtils): Check for TRIP_SURVEY_ID before attempti…
binh-dam-ibigroup 1381b06
refactor(NotificationUtils): Check for devices before rest of trip su…
binh-dam-ibigroup edb9392
refactor(TripSurveySenderJob): Tweak comments.
binh-dam-ibigroup 4755ba8
refactor(TrackedJourney): Remove unused method.
binh-dam-ibigroup 0a8a81b
style(ManageTripTracking):Wrap line
binh-dam-ibigroup 2065188
style(NotificationUtils): Use static import
binh-dam-ibigroup de1d9f4
docs: Introduce TRIP_SURVEY_SUBDOMAIN config param
binh-dam-ibigroup 5bfe653
feat(NotificationUtils): Include survey subdomain to push notification
binh-dam-ibigroup e8256da
refactor(OtpUser): Use list of sent notifications for traceability.
binh-dam-ibigroup e096f84
refactor(TripSurveySenderJob): Support instances where users had prev…
binh-dam-ibigroup 402383f
refactor(TripSurveySenderJob): Improve Mongo filters.
binh-dam-ibigroup 986d5ce
refactor(TripSurveySenderJob): Include notification id.
binh-dam-ibigroup 8dba681
Merge branch 'dev' into post-deviated-trip-notification
binh-dam-ibigroup 9f2ab38
refactor(OtpUser): Fix imports
binh-dam-ibigroup bb99963
docs(Swagger): Update snapshots
binh-dam-ibigroup 6128725
Merge branch 'dev' into post-deviated-trip-notification
binh-dam-ibigroup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/org/opentripplanner/middleware/models/TripSurveyNotification.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.opentripplanner.middleware.models; | ||
|
||
import java.util.Date; | ||
import java.util.UUID; | ||
|
||
/** Contains information regarding survey notifications sent after a trip is completed. */ | ||
public class TripSurveyNotification { | ||
|
||
public static final String TIME_SENT_FIELD = "timeSent"; | ||
|
||
/** | ||
* Unique ID to link a survey entry to the corresponding notification | ||
* (and to find which notifications were dismissed without opening the survey) | ||
*/ | ||
public String id; | ||
|
||
/** Date/time when the trip survey notification was sent. */ | ||
public Date timeSent; | ||
|
||
/** The {@link TrackedJourney} (and, indirectly, the {@link MonitoredTrip}) that this notification refers to. */ | ||
public String journeyId; | ||
|
||
public TripSurveyNotification() { | ||
// Default constructor for deserialization | ||
} | ||
|
||
public TripSurveyNotification(String id, Date timeSent, String journeyId) { | ||
this.id = id; | ||
this.timeSent = timeSent; | ||
this.journeyId = journeyId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think the trigger location is fine. Perhaps follow the approach of
ConnectedDataManager.scheduleTripHistoryUploadJob();
and have the schduler in the class. It might also be benefical to have the ability to disable this via a config property.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.
@binh-dam-ibigroup thoughts on these two points?
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.
We'd have to rethink where to run periodic tasks.