diff --git a/internal/notification/handlers/commands.go b/internal/notification/handlers/commands.go index 7b1a333623..40a9c999b1 100644 --- a/internal/notification/handlers/commands.go +++ b/internal/notification/handlers/commands.go @@ -21,7 +21,7 @@ type Commands interface { HumanPasswordlessInitCodeSent(ctx context.Context, userID, resourceOwner, codeID string) error PasswordChangeSent(ctx context.Context, orgID, userID string) error HumanPhoneVerificationCodeSent(ctx context.Context, orgID, userID string, generatorInfo *senders.CodeGeneratorInfo) error - InviteCodeSent(ctx context.Context, orgID, userID string) error + InviteCodeSent(ctx context.Context, userID, orgID string) error UsageNotificationSent(ctx context.Context, dueEvent *quota.NotificationDueEvent) error MilestonePushed(ctx context.Context, instanceID string, msType milestone.Type, endpoints []string) error BackChannelLogoutSent(ctx context.Context, id, oidcSessionID, instanceID string) (err error) diff --git a/internal/notification/handlers/mock/commands.mock.go b/internal/notification/handlers/mock/commands.mock.go index 270b2b225c..9db75f6d14 100644 --- a/internal/notification/handlers/mock/commands.mock.go +++ b/internal/notification/handlers/mock/commands.mock.go @@ -142,17 +142,17 @@ func (mr *MockCommandsMockRecorder) HumanPhoneVerificationCodeSent(ctx, orgID, u } // InviteCodeSent mocks base method. -func (m *MockCommands) InviteCodeSent(ctx context.Context, orgID, userID string) error { +func (m *MockCommands) InviteCodeSent(ctx context.Context, userID, orgID string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InviteCodeSent", ctx, orgID, userID) + ret := m.ctrl.Call(m, "InviteCodeSent", ctx, userID, orgID) ret0, _ := ret[0].(error) return ret0 } // InviteCodeSent indicates an expected call of InviteCodeSent. -func (mr *MockCommandsMockRecorder) InviteCodeSent(ctx, orgID, userID any) *gomock.Call { +func (mr *MockCommandsMockRecorder) InviteCodeSent(ctx, userID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InviteCodeSent", reflect.TypeOf((*MockCommands)(nil).InviteCodeSent), ctx, orgID, userID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InviteCodeSent", reflect.TypeOf((*MockCommands)(nil).InviteCodeSent), ctx, userID, orgID) } // MilestonePushed mocks base method. diff --git a/internal/notification/handlers/notification_worker_test.go b/internal/notification/handlers/notification_worker_test.go index 9b8ecb66fe..04f38eeb9b 100644 --- a/internal/notification/handlers/notification_worker_test.go +++ b/internal/notification/handlers/notification_worker_test.go @@ -108,7 +108,7 @@ func Test_userNotifier_reduceNotificationRequested(t *testing.T) { } codeAlg, code := cryptoValue(t, ctrl, "testcode") expectTemplateWithNotifyUserQueries(queries, givenTemplate) - commands.EXPECT().InviteCodeSent(gomock.Any(), orgID, userID).Return(nil) + commands.EXPECT().InviteCodeSent(gomock.Any(), userID, orgID).Return(nil) return fieldsWorker{ queries: queries, commands: commands, diff --git a/internal/notification/handlers/user_notifier.go b/internal/notification/handlers/user_notifier.go index 0c9b609744..11a04640b9 100644 --- a/internal/notification/handlers/user_notifier.go +++ b/internal/notification/handlers/user_notifier.go @@ -79,7 +79,7 @@ func init() { ) RegisterSentHandler(user.HumanInviteCodeAddedType, func(ctx context.Context, commands Commands, id, orgID string, _ *senders.CodeGeneratorInfo, args map[string]any) error { - return commands.InviteCodeSent(ctx, orgID, id) + return commands.InviteCodeSent(ctx, id, orgID) }, ) }