Skip to content

Conversation

paaragon
Copy link
Collaborator

@paaragon paaragon commented Aug 1, 2025

Summary

This PR adds the new jobs and provider_jobs parameters in the client:

  • status
  • created_after
  • function_name (only for jobs)

And in the backend the changes applied are:

  • Migrated /jobs and /jobs/provider endpoints to new architecture
  • Added new filters: status, function and created_after date
  • Added tests to cover new filters
  • Added a new ProgramSummarySerializer so we return less info about the program in the job lists

Details 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.

@paaragon paaragon requested a review from a team as a code owner August 1, 2025 08:55
Copy link
Collaborator

@korgan00 korgan00 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! 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 :)

@Tansito Tansito changed the base branch from main to feat/migrate-get-jobs-endpoint August 7, 2025 17:34
@Tansito Tansito changed the base branch from feat/migrate-get-jobs-endpoint to main August 7, 2025 17:35
@Tansito Tansito mentioned this pull request Aug 12, 2025
3 tasks
@Tansito Tansito changed the title Feat/migrate get jobs client methods Improve get jobs and get job logic with new search parameters Aug 12, 2025
@Tansito Tansito self-requested a review August 12, 2025 15:00
@korgan00
Copy link
Collaborator

the jobs_new folder should be renamed to jobs when we delete the jobs.py file. Then we should be able to delete also all the endpoints name properties because it will be auto-calculated

Copy link
Member

@Tansito Tansito left a 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.

@Tansito Tansito self-requested a review August 25, 2025 13:20
Copy link
Member

@Tansito Tansito left a comment

Choose a reason for hiding this comment

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

Now LGTM! Thanks @paaragon , @korgan00 !

@Tansito Tansito merged commit 6ebe99c into main Aug 25, 2025
13 of 15 checks passed
@Tansito Tansito deleted the feat/migrate-get-jobs-client-methods branch August 25, 2025 16:49
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