-
-
Notifications
You must be signed in to change notification settings - Fork 11
[BACK-3478] Add email notifications work system processors. #896
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
…sers on specific events.
darinkrauss
left a comment
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.
Some thoughts...
| } | ||
|
|
||
| func (c *Coordinator) startTimer() { | ||
| func (c *Coordinator) tick() <-chan time.Time { |
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.
Were the changes in this file due to a bug? If so, what were you seeing? This implementation is much cleaner, but curious to know why the change.
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.
Discussed during meeting, this is mainly because as of Go 1.23, the garbage collector will properly reclaim tickers so this isn't needed anymore.
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.
Ah, right. Sorry, I forgot.
| @@ -0,0 +1,129 @@ | |||
| package claimaccount | |||
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.
In order to fit in with the other platform and work implementations, how about we move this to notifications/work/users/claim. And, for the others, notifications/work/users/connections/new and notifications/work/users/connections/issues.
| @@ -0,0 +1,93 @@ | |||
| package v1 | |||
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.
Rename to just notifications.go?
| return nil | ||
| } | ||
|
|
||
| type confirmationClientConfig struct { |
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.
[nit] Move to top (as in the auth service) or bottom so it isn't buried here?
|
|
||
| client, err := confirmationClient.NewClientWithResponses(cfg.ServiceAddress, opts) | ||
| if err != nil { | ||
| return errors.Wrap(err, "unable to create confirmations client") |
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.
[nit] confirmations -> confirmation (for consistency)
| return errors.Wrap(err, "unable to create confirmations client") | |
| return errors.Wrap(err, "unable to create confirmation client") |
|
|
||
| cfg := &confirmationClientConfig{} | ||
| if err := cfg.Load(); err != nil { | ||
| return errors.Wrap(err, "unable to load confirmations client config") |
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.
[nit] confirmations -> confirmation
| return errors.Wrap(err, "unable to load confirmations client config") | |
| return errors.Wrap(err, "unable to load confirmation client config") |
| scheduledProcessors := []work.Processor{ | ||
| claimaccount.NewProcessor(notificationDependencies), | ||
| connectaccount.NewProcessor(notificationDependencies), | ||
| connectionissues.NewProcessor(notificationDependencies), |
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.
[nit] scheduledProcessors -> notificationsProcessors (for consistency)
| scheduledProcessors := []work.Processor{ | |
| claimaccount.NewProcessor(notificationDependencies), | |
| connectaccount.NewProcessor(notificationDependencies), | |
| connectionissues.NewProcessor(notificationDependencies), | |
| notificationsProcessors := []work.Processor{ | |
| claimaccount.NewProcessor(notificationsDependencies), | |
| connectaccount.NewProcessor(notificationsDependencies), | |
| connectionissues.NewProcessor(notificationsDependencies), |
| "github.com/tidepool-org/platform/conditionalnotifications/connectionissues" | ||
| ) | ||
|
|
||
| func NotificationRoutes() []dataService.Route { |
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.
[nit] Rename to NotificationsRoutes (note the plural to match).
| func NotificationRoutes() []dataService.Route { | |
| func NotificationsRoutes() []dataService.Route { |
| routes = append(routes, SourcesRoutes()...) | ||
| routes = append(routes, SummaryRoutes()...) | ||
| routes = append(routes, AlertsRoutes()...) | ||
| routes = append(routes, NotificationRoutes()...) |
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.
[nit] Rename to NotificationsRoutes (note the plural to match).
| routes = append(routes, NotificationRoutes()...) | |
| routes = append(routes, NotificationsRoutes()...) |
| } | ||
|
|
||
| type Metadata struct { | ||
| ClinicId string `json:"clinicId,omitempty"` |
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.
[nit] In platform, usually it is ClinicID to conform with the Go common style guide. Same for other Ids. (The Golang variable name is ID, but the exported JSON is Id.)
No description provided.