script(rdvsp): add an export script for checking data coherence with rdvsp #2217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #2148
PR coté RDVSP : betagouv/rdv-service-public#4452
J'ai remarqué certaines choses en lançant les scripts sur un dump local anonymisé :
Le scope
.active
n'est pas suffisant car vérifie uniquement le champdeleted_at
, or on a des usagers qui n'ont pas dedeleted_at
et qui n'ont pas derdv_solidarites_user_id
. Je ne comprend pas bien ce cas. Il faudrait peut être ajouter d'autres scopes pour éclaircir cela.On a aussi 30 users en production avec un
rdv_solidarites_user_id
mais qui n'ont pas d'organisation (on les skip ligne 13). Ils auraient du être supprimés je pense.Le script
scripts/export_organisations_rdvsp_ids.rb
m'a servi pour vérifier que toutes les organisations ont bien la verticalerdv_insertion
dans rdvsp (c'est le cas).Utilisation :
On génére les json avec les scripts de cette PR :
./scripts/export_organisations_rdvsp_ids.rb
./scripts/export_users_rdvsp_ids.rb
Copier les json générés à la racine du dossier de
rdv-solidarites
et lancer les scripts rdvsp (dans la PR) :./scripts/check_rdvi_organisations_verticales.rb
./scripts/check_rdvi_rdvsp_users_organisations.rb