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

Candidature : vérifier la cohérence du NIR avec la date de naissance et la civilité #4746

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

EwenKorr
Copy link
Contributor

🤔 Pourquoi ?

Une nouvelle vérification pour être sûr que les données entrées soient cohérentes.

@EwenKorr EwenKorr added the ajouté Ajouté dans le changelog. label Sep 13, 2024
@EwenKorr EwenKorr self-assigned this Sep 13, 2024
@EwenKorr EwenKorr marked this pull request as draft September 13, 2024 15:25
@EwenKorr EwenKorr marked this pull request as ready for review September 20, 2024 09:24
itou/common_apps/nir/forms.py Outdated Show resolved Hide resolved
itou/users/models.py Outdated Show resolved Hide resolved
tests/users/factories.py Outdated Show resolved Hide resolved
"Une incohérence a été détectée parmi les informations suivantes : "
"la civilité, le numéro de sécurité sociale et la date de naissance. "
"Veuillez corriger celle(s) en erreur pour continuer."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Je verrais bien des erreurs plus spécifique plutôt que de laisser l'utilisateur essayer de deviner.
Peut-être en mettant d'ailleurs l'erreur sur le champs fautif via un self.add_error("birthdate", ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Des erreurs plus spécifiques d'accord, mais vu que ça concerne des paires de champs, on ne sait pas vraiment quel champ est fautif.

Certes, on a la vérification du NIR avec sa clé normalement, mais d'un point de vue UX je ne sais pas ce qui est le mieux. Je vais demander à Marion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

J'ai eu le retour de Marion. Elle propose ces messages (pas la peine d'expliquer la structure du NIR, trop complexe).

J'ai utilisé l'opérateur % pour inclure le NIR dans le message d'erreur quand il y a besoin, mais je ne suis pas sûr que ce soit une bonne pratique.

itou/users/models.py Outdated Show resolved Hide resolved
itou/users/models.py Outdated Show resolved Hide resolved
itou/users/models.py Outdated Show resolved Hide resolved
itou/www/apply/forms.py Show resolved Hide resolved
tests/www/apply/test_submit.py Outdated Show resolved Hide resolved
itou/users/models.py Outdated Show resolved Hide resolved
@EwenKorr EwenKorr force-pushed the ewen/nir-consistency branch 2 times, most recently from 3bfe425 to 0b2e7ec Compare September 24, 2024 06:29
itou/users/models.py Outdated Show resolved Hide resolved
itou/www/apply/forms.py Show resolved Hide resolved
tests/www/dashboard/test_edit_job_seeker_info.py Outdated Show resolved Hide resolved
tests/www/dashboard/test_edit_user_info.py Outdated Show resolved Hide resolved
@EwenKorr EwenKorr force-pushed the ewen/nir-consistency branch 2 times, most recently from 2d17540 to 52f3bfb Compare September 24, 2024 09:20
Comment on lines +1716 to +1741
"Une erreur a été détectée. "
"La date de naissance renseignée ne correspond pas au numéro de sécurité "
"sociale 178122978200508 enregistré."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

J'ai écrit le message d'erreur en dur pour être sûr le NIR soit bien inclus.

- added a static method in JobSeekerProfile
- used that static method in forms (CheckJobSeekerInfoForm,
  CreateOrUpdateJobSeekerStep1Form, EditJobSeekerInfoForm)

tests:
- updated the JobSeekerProfileFactory in order to
  generate a consistent NIR (depding on title and bdate)
- updated some tests (mainly setting fixed NIRs and bdates
  in test objects)
- added test cases in ApplyAs*
@EwenKorr EwenKorr added this pull request to the merge queue Sep 27, 2024
Merged via the queue into master with commit d2d5da6 Sep 27, 2024
11 checks passed
@EwenKorr EwenKorr deleted the ewen/nir-consistency branch September 27, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ajouté Ajouté dans le changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants