Skip to content

Jlc/cert url programs#296

Merged
johanseto merged 6 commits intomasterfrom
jlc/cert-url-programs
Nov 10, 2025
Merged

Jlc/cert url programs#296
johanseto merged 6 commits intomasterfrom
jlc/cert-url-programs

Conversation

@johanseto
Copy link
Collaborator

@johanseto johanseto commented Oct 17, 2025

Description

  • Add certificate url to program metadata endpoint.
  • Add query param to load only the certificated URL filter. &certificated_only=true

Jira story: https://edunext.atlassian.net/browse/FUTUREX-1491

Testing instructions

  • Checkout this branch.
  • Configure a user with a generated certificate.
image - Use the api using the national_id of that user. eg `/eox-nelp/api/programs/v1/program-lookup/?national_id=1234567890` - Check certificate URL. image - Filter by `certificated_only=true` queryparam. - Check the result shows only the certificated.
Screencast.from.17-10-25.10.54.47.webm
  • Check the certificate url Certificate_URL field works.
image

@github-actions github-actions bot added test size/m m lines label labels Oct 17, 2025
Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

In general, the code looks good.
What really concerns me is the mixed functionality in the following endpoint:

/eox-nelp/api/programs/v1/program-lookup/

Originally, this returned the list of all programs.
On the other hand, we also have:

/eox-nelp/api/programs/v1/program-lookup/?national_id=1234567890

which returns the programs related to a specific user.

However, with these new changes, the endpoint:

/eox-nelp/api/programs/v1/program-lookup/

— as I understand it — will now start returning certificate information for the user making the request.
I personally see this endpoint as something not tied to any specific user, simply returning general program information.
That makes me think a small refactor would make more sense.

Suggested structure:

  • GET /eox-nelp/api/programs/v1/program-lookup/
    → Returns all programs.

  • GET /eox-nelp/api/programs/v1/program-lookup/?query=
    → Returns all programs filtered by the query params (only for program filters).

  • GET /eox-nelp/api/programs/v1/user-programs/<national_id or id>
    → Returns the programs for a specific user and can support the filters proposed in this PR.

Alternatively:

/eox-nelp/api/programs/v1/user-programs/all/?national_id=xxx
  • If national_id is not provided, we could return a Bad Request.
  • We could also return all results by default, but that might be excessive.

Personally, I prefer:

/eox-nelp/api/programs/v1/user-programs/<national_id or id>

But this should definitely be discussed with the client.

Comment on lines +65 to +66
Certificate_PATH = serializers.CharField(required=False, allow_null=True)
Certificate_URL = serializers.SerializerMethodField()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are you keeping this invalid format ? why do you need the certificate path ?

@johanseto johanseto force-pushed the jlc/cert-url-programs branch 2 times, most recently from ea12ec7 to 09354de Compare October 29, 2025 23:38
@johanseto
Copy link
Collaborator Author

New workflow of the endpoint.

2025-10-29_18-33
Screencast.from.29-10-25.18.33.38.webm

@johanseto johanseto changed the base branch from master to jlc/national-id-constraint-programs October 29, 2025 23:41
Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

could you please include the last field(completion_date) asked by the client ?

Base automatically changed from jlc/national-id-constraint-programs to master November 4, 2025 22:02
feat: update test with new change

feat: add certificated_only test

chore: quality adjustments

chore: complexity lint improvement
@johanseto johanseto force-pushed the jlc/cert-url-programs branch from 09354de to 712527c Compare November 4, 2025 22:05
@johanseto
Copy link
Collaborator Author

could you please include the last field(completion_date) asked by the client ?

image

cce00ec

Copy link
Collaborator

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

LGTM and the basic functionality is working for me

2025-11-07.17-53-10.mp4

@johanseto johanseto merged commit 4e0cfc5 into master Nov 10, 2025
9 checks passed
@johanseto johanseto deleted the jlc/cert-url-programs branch November 10, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m m lines label test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants