Skip to content

Commit

Permalink
chore(refactoring): made UniqueUserID plural
Browse files Browse the repository at this point in the history
  • Loading branch information
drochow committed Aug 12, 2024
1 parent fbe6307 commit cfbe65f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .test.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ DOCKER_CREDENTIAL_STORE=docker-credential-desktop

LOG_PRETTY_PRINT=true

LOCAL_TEST_DB=true
LOCAL_TEST_DB=false

SEED_MODE=false
2 changes: 1 addition & 1 deletion internal/api/graphql/graph/baseResolver/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func UniqueUserIDBaseResolver(app app.Heureka, ctx context.Context, filter *mode

opt := GetListOptions(requestedFields)

names, err := app.ListUniqueUserID(f, opt)
names, err := app.ListUniqueUserIDs(f, opt)

if err != nil {
return nil, NewResolverError("UniqueUserIDBaseResolver", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion internal/app/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Heureka interface {
UpdateUser(*entity.User) (*entity.User, error)
DeleteUser(int64) error
ListUserNames(*entity.UserFilter, *entity.ListOptions) ([]string, error)
ListUniqueUserID(*entity.UserFilter, *entity.ListOptions) ([]string, error)
ListUniqueUserIDs(*entity.UserFilter, *entity.ListOptions) ([]string, error)

ListSupportGroups(*entity.SupportGroupFilter, *entity.ListOptions) (*entity.List[entity.SupportGroupResult], error)
GetSupportGroup(int64) (*entity.SupportGroup, error)
Expand Down
4 changes: 2 additions & 2 deletions internal/app/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ func (h *HeurekaApp) ListUserNames(filter *entity.UserFilter, options *entity.Li
return userNames, nil
}

func (h *HeurekaApp) ListUniqueUserID(filter *entity.UserFilter, options *entity.ListOptions) ([]string, error) {
func (h *HeurekaApp) ListUniqueUserIDs(filter *entity.UserFilter, options *entity.ListOptions) ([]string, error) {
l := logrus.WithFields(logrus.Fields{
"event": "app.ListUniqueUserID",
"event": "app.ListUniqueUserIDs",
"filter": filter,
})

Expand Down
6 changes: 3 additions & 3 deletions internal/app/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ var _ = Describe("When listing User", Label("app", "ListUserNames"), func() {
})
})
})
var _ = Describe("When listing UniqueUserID", Label("app", "ListUniqueUserID"), func() {
var _ = Describe("When listing UniqueUserID", Label("app", "ListUniqueUserIDs"), func() {
var (
db *mocks.MockDatabase
heureka app.Heureka
Expand All @@ -265,7 +265,7 @@ var _ = Describe("When listing UniqueUserID", Label("app", "ListUniqueUserID"),

It("it return the results", func() {
heureka = app.NewHeurekaApp(db)
res, err := heureka.ListUniqueUserID(filter, options)
res, err := heureka.ListUniqueUserIDs(filter, options)
Expect(err).To(BeNil(), "no error should be thrown")
Expect(res).Should(BeEmpty(), "return correct result")
})
Expand All @@ -280,7 +280,7 @@ var _ = Describe("When listing UniqueUserID", Label("app", "ListUniqueUserID"),
})
It("returns filtered users according to the service type", func() {
heureka = app.NewHeurekaApp(db)
res, err := heureka.ListUniqueUserID(filter, options)
res, err := heureka.ListUniqueUserIDs(filter, options)
Expect(err).To(BeNil(), "no error should be thrown")
Expect(res).Should(ConsistOf(uuid), "should only consist of UniqueUserID")
})
Expand Down
6 changes: 3 additions & 3 deletions internal/mocks/mock_Heureka.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cfbe65f

Please sign in to comment.