Skip to content

Candidature : ajout de la commune de naissance et du pays de naissance au formulaire d'acceptation#4420

Merged
celine-m-s merged 12 commits intomasterfrom
celinems/jobseekerform
Aug 5, 2024
Merged

Candidature : ajout de la commune de naissance et du pays de naissance au formulaire d'acceptation#4420
celine-m-s merged 12 commits intomasterfrom
celinems/jobseekerform

Conversation

@celine-m-s
Copy link
Copy Markdown
Contributor

@celine-m-s celine-m-s commented Jul 14, 2024

🤔 Pourquoi ?

L'API Particuliers permet de vérifier certains critères administratifs déclarés sur les emplois. Étant donné qu'ils étaient déclaratifs seulement, les employeurs devaient conserver les justificatifs en cas de contrôle (le fameux contrôle a posteriori).
Nous avons accès à trois endpoints : RSA, Adulte Handicapé et Parent Isolé.
Afin que l'API identifie un bénéficiaire, il faut lui envoyer certaines informations dont le pays de naissance (et la commune si le pays de naissance est la France).

🍰 Comment ?

Ajout des champs « Pays de naissance » et « Commune de naissance » au formulaire d'acceptation de candidature si un critère vérifiable est présent dans le dernier diagnostic valide et si l'entreprise qui embauche est éligible aux aides de l'IAE.

Modification du modèle AdministrativeCriteria : ajout d'une colonne « certifiable » pour désigner les critères vérifiables par l'API.

À noter que la modification concerne les diags de l'IAE ainsi que ceux pour les GEIQ.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

🏝️ Comment tester

Se connecter en tant qu'employeur. Réaliser une auto-prescription et cocher le critère BRSA, Adulte handicapé ou parent isolé pendant l'étape du diagnostic. Puis acceptez la candidature. Deux nouveaux champs devraient s'afficher : Pays et commune de naissance. Si le pays est la France, la commune est obligatoire.

Réaliser la même manipulation avec un GEIQ (le formulaire devrait s'afficher) et une entreprise non éligible à l'IAE (le formulaire ne devrait pas apparaître).

💻 Captures d'écran

image

@celine-m-s celine-m-s added the ajouté Ajouté dans le changelog. label Jul 14, 2024
@celine-m-s celine-m-s self-assigned this Jul 14, 2024
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch 4 times, most recently from 996b0c2 to a60d08c Compare July 23, 2024 10:08
@celine-m-s celine-m-s changed the base branch from master to celinems/refactor-accept July 23, 2024 10:09
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch from a60d08c to 13989e1 Compare July 23, 2024 12:25
@celine-m-s celine-m-s force-pushed the celinems/refactor-accept branch 2 times, most recently from dd524e0 to 2742232 Compare July 25, 2024 13:14
Base automatically changed from celinems/refactor-accept to master July 25, 2024 13:30
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch 5 times, most recently from a952c64 to 95cf778 Compare July 29, 2024 21:06
@celine-m-s celine-m-s marked this pull request as ready for review July 29, 2024 21:09
Comment thread itou/www/apply/views/common.py Outdated
form_user_address = JobSeekerAddressForm(instance=job_seeker, data=request.POST or None)
forms.append(form_user_address)

diagnosis = EligibilityDiagnosis.objects.last_considered_valid(job_seeker=job_seeker, for_siae=siae)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Je l'ai enlevé pour éviter une double requête mais on court le risque d'associer un diag IAE à une candidature GEIQ. Ajouter un garde-fou ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On est dans le bloc if siae.is_subject_to_eligibility_rules: donc a priori ça ne peut pas être une candidature GEIQ ?

@celine-m-s celine-m-s added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jul 29, 2024
@github-actions
Copy link
Copy Markdown

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

Comment thread itou/www/apply/forms.py Outdated
Comment thread itou/eligibility/migrations/0003_administrativecriteria_certifiable.py Outdated
Comment thread tests/eligibility/factories.py
Comment thread itou/eligibility/migrations/0004_geiqadministrativecriteria_certifiable.py Outdated
Comment thread itou/www/apply/views/common.py Outdated
form_user_address = JobSeekerAddressForm(instance=job_seeker, data=request.POST or None)
forms.append(form_user_address)

diagnosis = EligibilityDiagnosis.objects.last_considered_valid(job_seeker=job_seeker, for_siae=siae)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On est dans le bloc if siae.is_subject_to_eligibility_rules: donc a priori ça ne peut pas être une candidature GEIQ ?

Comment thread itou/www/apply/forms.py Outdated
)
except asp_models.Commune.DoesNotExist as ex:
raise forms.ValidationError(
f"Le code INSEE {birth_place.code} n'est pas référencé par l'ASP en date du {birth_date:%d/%m/%Y}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comme birthdate et birth_place ne sont pas dans le même formulaire, cela peut être perturbant pour l'utilisateur de voir une autre date de naissance que celle qu'il a saisi: il faudrait idéalement que les deux champs soient vérifiés ensemble.

Copy link
Copy Markdown
Contributor Author

@celine-m-s celine-m-s Jul 31, 2024

Choose a reason for hiding this comment

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

Je ne suis pas sure de comprendre. Effectivement, la date de naissance est saisie ailleurs mais c'est bien celle-ci qui est affichée. 🤔 J'ai relu le code des fiches salarié et je comprends mieux.

Copy link
Copy Markdown
Contributor Author

@celine-m-s celine-m-s Jul 31, 2024

Choose a reason for hiding this comment

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

Proposition : b407cf7
Je ne sais pas si la date de naissance du candidat est obligatoirement connue à ce moment-là du parcours pour toutes les entreprises, même les non-SIAE. Je demande.
La date de naissance est obligatoire en amont.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Une autre possibilité serait d'ajouter un formulaire uniquement pour la date de naissance et de supprimer le champ de JobSeekerPersonalDataForm mais c'est plus lourd et cela ferait éventuellement deux save. :/

Copy link
Copy Markdown
Member

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

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

Ça m’a l’air de bien fonctionner 👍

Comment thread itou/eligibility/models/common.py Outdated
Comment on lines +73 to +74
@property
def criteria_certification_required(self):
return self.administrative_criteria.certifiable().exists()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Comme ce n’est utilisé qu’à un seul endroit, je ne créerais pas de méthode. Aussi, comme ça fait une requête, je trouve que property est un peu trompeur. Une requête n’est pas gratuit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

C'est vrai, ce n'est jamais gratuit.
La vue _accept étant déjà très longue, j'ai préféré isoler la requête. En fait, je me suis dit que la condition pouvait évoluer dans un futur proche : afficher le formulaire si les critères n'ont pas été certifiés depuis XX mois par exemple, ou utilisés ailleurs dans l'app.
Je prends la remarque sur la propriété.

Comment thread itou/eligibility/models/common.py
Comment thread itou/eligibility/models/iae.py Outdated

The table is automatically populated with a fixture at the end of
eligibility's migration #0007.
The table is automatically populated on app load.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: On peuple actuellement au migrate. Comme la méthode ci dessous est connectée au signal post_migrate, c’est facile de savoir quand on l’appelle. J’aurais plutôt tendance à laisser le commentaire vague et laisser le développeur suivre le fil.

Suggested change
The table is automatically populated on app load.
The table is automatically populated.

Copy link
Copy Markdown
Contributor Author

@celine-m-s celine-m-s Jul 31, 2024

Choose a reason for hiding this comment

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

J'avoue que j'ai eu du mal à retrouver où et comment était chargée la table. Je ne serai peut-être pas la seule.

Comment thread itou/www/apply/forms.py Outdated
Comment thread itou/www/apply/views/process_views.py
Comment thread tests/eligibility/test_iae.py Outdated
Comment thread tests/www/apply/test_process.py Outdated
Comment thread tests/www/apply/test_process.py Outdated
Comment thread tests/www/apply/test_process.py Outdated
Comment thread tests/www/apply/test_process.py Outdated
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch from b407cf7 to 55db2af Compare July 31, 2024 13:48
@celine-m-s celine-m-s added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC and removed 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC labels Jul 31, 2024
@github-actions
Copy link
Copy Markdown

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

@celine-m-s celine-m-s removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jul 31, 2024
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch from 7001135 to 1510a1a Compare August 5, 2024 13:26
@celine-m-s
Copy link
Copy Markdown
Contributor Author

Retours traités. 💪

@celine-m-s
Copy link
Copy Markdown
Contributor Author

Je commence un travail de squash massif. :)

Comment thread itou/static/js/utils.js
Comment thread tests/www/apply/test_process.py
Copy link
Copy Markdown
Member

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

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

Je pourrai rejeter un petit œil après LE GRAND SQUASH, mais ça m’a l’air nickel 💯

@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch from b48412b to 148f7b7 Compare August 5, 2024 15:01
@celine-m-s
Copy link
Copy Markdown
Contributor Author

LE GRAND SQUASH© fini ! J'en ai profité pour ajouter le test suivant : b88d346#diff-07cb9d1ec9cf7ca71cd5f84924b252cda4d5781c3b97a998785fa5f370d7d32fR2450-R2455

En effet, j'ai réalisé en effectuant un test manuel que le pays n'était pas enregistré mais que la ville, oui. C'est réglé !

@celine-m-s
Copy link
Copy Markdown
Contributor Author

Désactiver le champ en JS aurait clairement dû être traité dans une PR séparée. Ça m'apprendra ! 😆

@celine-m-s
Copy link
Copy Markdown
Contributor Author

Je veux bien un dernier regard mais ça peut être demain si tu es HS ce soir. Pas de pression. :)

Comment thread tests/www/apply/test_process.py Outdated
Comment thread tests/www/apply/test_process.py
We have been granted access to the API Particulier
that can certify some administrative criteria.
For the moment, only 3 are in the scope: Allocation Adulte Handicapé,
RSA and Allocation Parent Isolé.

This certification should replace the need for "written proof"
and hence make the "siae evaluation" unnecessary in the (hopefully)
near future.
Show the form on job application's acceptance view only if
the company is subjects to eligibility rules and if a
certification is required.
One of the tests failed once (and only once) in the CI but not locally.
If it fails again, we will be able to dig into it.
@celine-m-s celine-m-s force-pushed the celinems/jobseekerform branch from 148f7b7 to cd196f4 Compare August 5, 2024 16:27
@celine-m-s celine-m-s enabled auto-merge August 5, 2024 16:28
@celine-m-s celine-m-s added this pull request to the merge queue Aug 5, 2024
Merged via the queue into master with commit e027add Aug 5, 2024
@celine-m-s celine-m-s deleted the celinems/jobseekerform branch August 5, 2024 16:42
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