Skip to content

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

Merged
francoisfreitag merged 1 commit into
masterfrom
ff/api-part-changes-2
Jan 9, 2025
Merged

Éligibilité : Rattrapage de dates de fin incorrectes de l’API Particulier#5339
francoisfreitag merged 1 commit into
masterfrom
ff/api-part-changes-2

Conversation

@francoisfreitag

@francoisfreitag francoisfreitag commented Jan 6, 2025

Copy link
Copy Markdown
Member

🤔 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

@francoisfreitag francoisfreitag added the modifié Modifié dans le changelog. label Jan 6, 2025
@francoisfreitag francoisfreitag self-assigned this Jan 6, 2025

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

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.

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
Copy Markdown
Contributor

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
Copy Markdown
Member 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
Copy Markdown
Member 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
Copy Markdown
Contributor

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
@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

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants