-
Notifications
You must be signed in to change notification settings - Fork 62
Introduce a deprecation reminder service #459
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
base: master
Are you sure you want to change the base?
Conversation
ce46279
to
d7ca889
Compare
@@ -0,0 +1,13 @@ | |||
CREATE TABLE deprecation_reminders ( | |||
id bigint(20) NOT NULL AUTO_INCREMENT, | |||
registered_backfill_id bigint(20) NOT 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.
Just add a last_messaged_on to registered_backfill
*/ | ||
@Singleton | ||
class DeprecationNotificationService @Inject constructor( | ||
private val notificationHelper: DeprecationNotificationHelper, |
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.
Two steps to sending a reminders.
-
Figure out registered backfills should have reminders sent this hour.
-
Determine if a reminder should go out for each backfill.
-
look at the registered backfill
- has a backfill run - pick the most recent run (run with the latest updated_at) look for the latest customer event and pick that time
- no backfill run - pick registration time (approximate deploy time so this should be a good time in the day)
- Now that you have a time and day of the week. Are we in that window?
- Make a call to the thing that is in cash-server whether to message now or not. Call will have a bunch of data:
- data structure around the last backfill run
-
- last user to touch the backfill
-
- the last status change (Complete, Fail, Paused) & time that happened
- Delete By date
- Backfill creation time
Return nothing or a message to send.
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.
ReminderMessagingDecider
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.
Always return false. If nothing is set do this? (Although maybe we make people pick.)
Remind monthly if there is a latest backfill or after 3 months if creation only.
Effective Delete-by Date Calculation
Takes the latest of:
Service Activity Check
Notification Frequency
Business Hours
The config comes from cash-server side - https://github.com/squareup/cash-server/pull/18643
WIP - test