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

Éligibilité : Rattrapage de dates de fin incorrectes de l’API Particulier #5339

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

francoisfreitag
Copy link
Contributor

@francoisfreitag francoisfreitag commented Jan 6, 2025

🤔 Pourquoi ?

L’API particulier calculait le champ dateFin avec la formule : dateDebut + 3 mois. Cette information est très déroutante, car une personne bénéficiaire depuis 2009-06-01 aurait comme réponse:

{
    "statut": "beneficiaire",
    "dateDebut": "2009-06-01",
    "dateFin": "2009-09-01",
}

Cependant, le statut indique que cette personne est bénéficiaire aujourd’hui, malgré la dateFin (qui est erronée).

L’API vient d’évoluer pour toujours définir dateFin=null afin de limiter les mauvaises interprétations. #5337

Correction d’environ 11 000 diagnostics, en utilisant la date d’appel à l’API pour le calcul de la date de fin de certification.

L’exemple ci-dessus provient de données actuellement en production.

⚠️ Ne relire que le second commit

Copy link
Collaborator

@celine-m-s celine-m-s left a comment

Choose a reason for hiding this comment

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

Peut-être ajouter un petit log ? Je serais curieuse de savoir combien de dates de fin sont bien différentes (plus d'une semaine).

@celine-m-s
Copy link
Collaborator

cf #5337 (comment)

@francoisfreitag francoisfreitag force-pushed the ff/api-part-changes-2 branch 2 times, most recently from ed05755 to 3bc9bbd Compare January 9, 2025 11:37
@francoisfreitag
Copy link
Contributor Author

Sur un backup d’il y a quelques jours:

Changed selected administrative criteria:
- 11218 end dates moved more than a week
- 3 end dates moved less than or a week

The API particulier computed the dateFin with dateDebut + 3 months.
That’s very misleading, as a person who has been a beneficiary since
2009-06-01 would have:
```json
{
    "statut": "beneficiaire",
    "dateDebut": "2009-06-01",
    "dateFin": "2009-09-01",
}
```

However, the `statut` means the person is beneficiary **today**.

The API recently evolved to always set `dateFin` to `null` to avoid
suggesting the end date is known and in the past.

Fix about 11,000 incorrect records, by using `certified_at`: if the API
response for `statut` was "beneficiaire", that person was beneficiary on
the day the API was queried.

The example from above comes from the production environment and is an
example of bad data.
@francoisfreitag
Copy link
Contributor Author

Il y a donc pas mal de rattrapage à faire, ce qui est logique : on comptait une dateFin complètement erronée dans nos données.

@celine-m-s
Copy link
Collaborator

Merci pour la moulinette !

@francoisfreitag francoisfreitag added this pull request to the merge queue Jan 9, 2025
Merged via the queue into master with commit 347d776 Jan 9, 2025
9 checks passed
@francoisfreitag francoisfreitag deleted the ff/api-part-changes-2 branch January 9, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants