-
Notifications
You must be signed in to change notification settings - Fork 40
Improve get jobs and get job logic with new search parameters #1695
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
Conversation
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.
Good job! this is nice.
Since I was working in the files migration in parallel, naturally we didn't developed same solution. I have some lines to discuss.
If you have some time, take a look to the PR and review it because you probably have some comments for me :)
# Conflicts: # gateway/api/v1/views/files.py
the |
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.
I just left a couple of comments plus we need to add also in the client
the same filters as we added for the jobs
method.
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.
Summary
This PR adds the new jobs and provider_jobs parameters in the client:
And in the backend the changes applied are:
/jobs
and/jobs/provider
endpoints to new architecturestatus
,function
andcreated_after
dateProgramSummarySerializer
so we return less info about the program in the job listsDetails and comments
After trying multiple solutions, I think the best pattern is to return a QuerySet in the repository but not propagate it to the endpoint. The use-case should return a business object, not the QuerySet.
I created the
create_paginated_response
utility method that should be used in future endpoints to maintain consistency between responses.Also, the previous response was returning different response types. I removed the non-paginated response because it wasn't being used in the client.