-
Notifications
You must be signed in to change notification settings - Fork 26
Diagnostic d'éligibilité : ajouter un type et supprimer certifiable
#4540
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
xavfernandez
left a comment
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.
👍 avec quelques remarques sur les codes utilisés: comme la plupart sont des abréviations françaises, ne serait-il pas cohérent de rester dans le français ?
itou/eligibility/admin.py
Outdated
| @admin.display(boolean=True, description="vérifiable par l'API Particuliers") | ||
| def certifiable(self, obj): | ||
| return obj.administrative_criteria.certifiable | ||
| return obj.administrative_criteria.certifiable() |
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.
J'ai le cerveau cramé mais je comprend pas ce changement, le champ est supprimé et rien ne le remplace 🤔.
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.
C'est ce certifiable là qui est appelé:
les-emplois/itou/eligibility/models/common.py
Lines 103 to 104 in 444d56d
| def certifiable(self): | |
| return self.filter(self.certifiable_lookup) |
904c41d to
1c623e4
Compare
itou/eligibility/admin.py
Outdated
| @admin.display(boolean=True, description="vérifiable par l'API Particuliers") | ||
| def certifiable(self, obj): | ||
| return obj.administrative_criteria.certifiable | ||
| return obj.administrative_criteria.certifiable() |
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.
C'est ce certifiable là qui est appelé:
les-emplois/itou/eligibility/models/common.py
Lines 103 to 104 in 444d56d
| def certifiable(self): | |
| return self.filter(self.certifiable_lookup) |
| GEIQ = "geiq", "GEIQ" | ||
|
|
||
|
|
||
| class AdministrativeCriteriaKind(models.TextChoices): |
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 qu'on bikeshed sur les noms, je me demande si on ne devrait pas juste rajouter RSA & AUTRE pour le moment ? Voir AAH et PI en plus vu qu'on sait qu'on va bientôt les rajouter.
L'ajout des autres se fera au fur et à mesure des besoins. Comme il suffit de rajouter une clef dans l'enum et de mettre à jour les fichiers json, ça pourra très bien se faire au fil de l'eau...
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.
C'est vrai mais maintenant que c'est fait, ce serait plus long de revenir en arrière, non ? J'aime autant garder tous les critères en tant qu'enum à un seul et même endroit, c'est plus clair.
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 ne devrait pas être très long de supprimer des valeurs et mettre OTHER/AUTRE :)
Car là il y a de bonnes chances que sur les 29 valeurs ajoutées, un certain nombre ne servent pas tout de suite (voir jamais ?)
Mais ça reste du bikeshed, donc on peut aussi partir sur les valeurs définies.
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.
Je pense que j'avais mal compris.
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.
Si je comprends bien, tu proposes d'ajouter en tant qu'enum uniquement les valeurs utiles à la certification (donc RSA uniquement pour la moment), étant donné que cette classe ne sert qu'à cela. C'est bien ça ?
Alors en effet, ce n'est pas long du tout mais cela me pose un souci de cohérence. L'ajout de cette colonne servait à mieux filtrer les critères par type, pas forcément et uniquement pour la certification. Ce ne serait pas bizarre d'avoir RSA et AUTRE, alors qu'on en affiche bien plus à l'utilisateur ?
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.
Oui c'était bien cela. Mais ça me va également de partir là dessus :)
| "parent_id": null, | ||
| "annex": "1", | ||
| "level": null, | ||
| "slug": "beneficiaire-des-minimas-sociaux", |
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.
Je n'ai pas touché au slug car les tests cassaient quand j'ai voulu le faire (et pas envie de me lancer dans ça maintenant).
0c9faa3 to
941db74
Compare
xavfernandez
left a comment
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.
Est-ce qu'on ne voudrait pas un test qui vérifie la cohérence entre les kinds des fixtures et les valeurs de enums (globalement appeler AdministrativeCriteriaKind(criteria.kind) sur toutes les critères ?
| GEIQ = "geiq", "GEIQ" | ||
|
|
||
|
|
||
| class AdministrativeCriteriaKind(models.TextChoices): |
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.
Oui c'était bien cela. Mais ça me va également de partir là dessus :)
itou/eligibility/enums.py
Outdated
| # Only for the migration | ||
| AUTRE = "AUTRE", "Autre" |
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.
Je pense que tu peux directement supprimer cette valeur et mettre "" en default. Le chargement des fixtures remplira très vite le champs.
Merci pour la suggestion. Deux critères s'étaient faufilés mais ont été repérés grâce à ce nouveau test ! 🕵️ Je pousse la mise à jour et je MEP. |
941db74 to
5667066
Compare
5667066 to
2266e5b
Compare
🤔 Pourquoi ?
C'est plus lisible. Il sera plus simple de retrouver les critères vérifiables et d'appeler le bon endpoint en fonction (RSA pour le critère RSA, AAH pour l'AAH et le parent isolé pour PI).
J'ai supprimé AAH et PI dans CAN_BE_CERTIFIED_KINDS car le premier endpoint à être mis en place sera le RSA.
🍰 Comment ?
🚨 À vérifier
🏝️ Comment tester
💻 Captures d'écran