fix: all enums same style (#262)

* fix: all enums same style

* fix: rename process to reduce

* add some missing enum renaming

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2020-06-23 14:47:47 +02:00
committed by GitHub
parent c376b92315
commit 3cd3a238c2
152 changed files with 1026 additions and 1024 deletions

View File

@@ -32,7 +32,7 @@ type Notification struct {
const (
notificationTable = "notification.notifications"
NOTIFY_USER = "NOTIFICATION"
NotifyUserID = "NOTIFICATION"
)
func (n *Notification) MinimumCycleDuration() time.Duration { return n.cycleDuration }
@@ -49,7 +49,7 @@ func (n *Notification) EventQuery() (*models.SearchQuery, error) {
return eventsourcing.UserQuery(sequence), nil
}
func (n *Notification) Process(event *models.Event) (err error) {
func (n *Notification) Reduce(event *models.Event) (err error) {
switch event.Type {
case es_model.InitializedUserCodeAdded:
err = n.handleInitUserCode(event)
@@ -168,5 +168,5 @@ func (n *Notification) OnError(event *models.Event, err error) error {
}
func getSetNotifyContextData(orgID string) context.Context {
return auth.SetCtxData(context.Background(), auth.CtxData{UserID: NOTIFY_USER, OrgID: orgID})
return auth.SetCtxData(context.Background(), auth.CtxData{UserID: NotifyUserID, OrgID: orgID})
}

View File

@@ -36,7 +36,7 @@ func (p *NotifyUser) EventQuery() (*models.SearchQuery, error) {
return eventsourcing.UserQuery(sequence), nil
}
func (p *NotifyUser) Process(event *models.Event) (err error) {
func (p *NotifyUser) Reduce(event *models.Event) (err error) {
user := new(view_model.NotifyUser)
switch event.Type {
case es_model.UserAdded,