-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: master
Are you sure you want to change the base?
Conversation
…tmentTokenAuthentication
🥁 La recette jetable est prête ! 👉 Je veux tester cette PR ! |
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 🙏 |
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.
Ça me semble être la bonne direction
) | ||
statut = serializers.ChoiceField( | ||
source="state", | ||
choices=JobApplicationState.choices, |
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.
on ne veut pas mettre le label en valeur dans l'api (pour avoir du texte en français) ?
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.
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)
source="to_company.email", | ||
label="Adresse e-mail de l’entreprise", | ||
) | ||
orientation_emetteur_type = serializers.ChoiceField( |
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.
il faut sans doute distinguer prescripteur habilité et orienteur, non ?
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.
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.
assert len(results) == 3 | ||
|
||
first_application = results[-1] # Reversed sorting | ||
assert first_application["cree_le"] == _str_with_tz(self.job_application.created_at) |
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.
à 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
00f287c
to
f3c1942
Compare
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.
Très propre :)
from itou.api.models import DepartmentToken | ||
|
||
|
||
class JobApplicationSearcAPIPermission(IsAuthenticated): |
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.
class JobApplicationSearcAPIPermission(IsAuthenticated): | |
class JobApplicationSearchAPIPermission(IsAuthenticated): |
"cree_le": "2025-02-06T14:48:06.595973+01:00", | ||
"statut": "obsolete", | ||
"candidat_nom": "Durand", | ||
"candidat_prenom": "Nathalie", |
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.
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 ?
🤔 Pourquoi ?
🍰 Comment ?
En mettant une API à disposition de leur éditeur de logiciel
🚨 À vérifier