Skip to content
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

feat: add ServiceFilter query #130

Merged
merged 11 commits into from
Aug 12, 2024
Merged

feat: add ServiceFilter query #130

merged 11 commits into from
Aug 12, 2024

Conversation

MR2011
Copy link
Collaborator

@MR2011 MR2011 commented Aug 8, 2024

No description provided.

@MR2011 MR2011 requested a review from drochow as a code owner August 8, 2024 08:55
return userNames, nil
}

func (h *HeurekaApp) ListUniqueUserID(filter *entity.UserFilter, options *entity.ListOptions) ([]string, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use plural? ListUniqueUserIDs

Copy link
Collaborator Author

@MR2011 MR2011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drochow please also review. I added a comment, but overall it looks good to me

Copy link
Collaborator

@drochow drochow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job,

The code looks clean and neat BUT:

We are missing all SQL queries and Grouping.

Why should we call "ListServiceNames" and get the same service name returned multiple times? Then, I could call the normal List function.

After thinking about it and seeing the Implementation, I also think that from the "Frontend" perspective, it might make sense not to have a dedicated endpoint for that but rather a ListOption to only return unique results by, e.g., ServiceName, like a grouping parameter. I'd still separate the logic in the Backend as done here, but on the API, I really doubt an additional endpoint does make sense.

@MR2011
WDYT?

internal/app/service_test.go Show resolved Hide resolved
internal/app/support_group_test.go Show resolved Hide resolved
internal/app/user_test.go Show resolved Hide resolved
internal/app/user_test.go Show resolved Hide resolved
internal/app/user_test.go Show resolved Hide resolved
internal/database/mariadb/user_test.go Show resolved Hide resolved
internal/e2e/service_filter_query_test.go Show resolved Hide resolved
internal/e2e/service_filter_query_test.go Show resolved Hide resolved
internal/e2e/service_filter_query_test.go Show resolved Hide resolved
internal/e2e/service_filter_query_test.go Show resolved Hide resolved
@drochow
Copy link
Collaborator

drochow commented Aug 9, 2024

After discussing with @MR2011 I've got it.

Lets keep it like it is for the Frontend devs 👍

drochow
drochow previously approved these changes Aug 9, 2024
@drochow drochow merged commit 3e80ebe into main Aug 12, 2024
4 checks passed
@drochow drochow deleted the ServiceFilter branch August 12, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants