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

API: Ajout d'une API pour rechercher les candidatures pour les CD [GEN-1651] #5588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leo-naeka
Copy link
Contributor

🤔 Pourquoi ?

  • Permettre aux CD de suivre les candidatures des bénéficiaires du RSA (peu importe l’émetteur de la candidature)
  • Supprimer les doubles saisies pour les agents du CD

🍰 Comment ?

En mettant une API à disposition de leur éditeur de logiciel

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

@leo-naeka leo-naeka added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog. labels Feb 11, 2025
@leo-naeka leo-naeka self-assigned this Feb 11, 2025
Copy link

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@leo-naeka leo-naeka marked this pull request as ready for review February 11, 2025 19:23
@leo-naeka
Copy link
Contributor Author

Comme je vous disais, j'envisage de modifier le dernier test pour instancier des objets stables et comparer avec un snapshot plutôt que faire 36 assertions. Mais je veux bien déjà votre avis sur le reste 🙏

Copy link
Contributor

@tonial tonial left a comment

Choose a reason for hiding this comment

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

Ça me semble être la bonne direction

)
statut = serializers.ChoiceField(
source="state",
choices=JobApplicationState.choices,
Copy link
Contributor

Choose a reason for hiding this comment

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

on ne veut pas mettre le label en valeur dans l'api (pour avoir du texte en français) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vu avec Zohra, pour tous les enums on préfère la valeur (stable dans le temps) que le label.
J'avais proposé de rajouter les deux. Ils auront l'info dans la doc : https://c1-review-leo-job-seekers-api.cleverapps.io/api/v1/redoc/#tag/candidatures/operation/candidatures_recherche

Par ailleurs dans certains cas (type prescripteur/employeur, on ne voulait que la valeur : l'acronyme)

itou/api/job_application_api/serializers.py Outdated Show resolved Hide resolved
source="to_company.email",
label="Adresse e-mail de l’entreprise",
)
orientation_emetteur_type = serializers.ChoiceField(
Copy link
Contributor

Choose a reason for hiding this comment

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

il faut sans doute distinguer prescripteur habilité et orienteur, non ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vu avec Zohra on n'affiche que les 3 types de base. J'avais proposé de rajouter un autre attribut (bool) pour indiquer si le prescripteur était habilité ou non, a priori pas nécessaire.

https://www.notion.so/gip-inclusion/Type-metteur-de-la-candidature-18a5f321b60481f58314d4df37c67030?pvs=4

assert len(results) == 3

first_application = results[-1] # Reversed sorting
assert first_application["cree_le"] == _str_with_tz(self.job_application.created_at)
Copy link
Contributor

Choose a reason for hiding this comment

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

à défaut d'un snapshot, si c'est trop pénible de fixer les donnée, du peux tester l'égalité de first_application avec un dictionnaire qui contient les données structurées, ce sera peut être plus lisible

Copy link
Contributor

@xavfernandez xavfernandez left a comment

Choose a reason for hiding this comment

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

Très propre :)

from itou.api.models import DepartmentToken


class JobApplicationSearcAPIPermission(IsAuthenticated):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class JobApplicationSearcAPIPermission(IsAuthenticated):
class JobApplicationSearchAPIPermission(IsAuthenticated):

"cree_le": "2025-02-06T14:48:06.595973+01:00",
"statut": "obsolete",
"candidat_nom": "Durand",
"candidat_prenom": "Nathalie",
Copy link
Contributor

Choose a reason for hiding this comment

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

Supprimer une ligne ici ne casse rien: il faudrait idéalement qu'il y ait un test qui vérifie que les exemples correspondent au schéma ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants