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

Create api route to update district postal code with datanova #388

Conversation

FLoreauIGN
Copy link
Contributor

#363
Cette PR ajoute une route d'API pour mettre à jour les codes postaux des districts de la base postgres à l'aide de la base officielle des codes postaux.

@FLoreauIGN FLoreauIGN linked an issue Apr 18, 2024 that may be closed by this pull request
@FLoreauIGN FLoreauIGN force-pushed the create-api-route-to-update-district-postal-code-with-datanova branch from 225cece to b26b211 Compare April 18, 2024 13:29
lib/api/district/models.js Outdated Show resolved Hide resolved
lib/api/district/routes.js Outdated Show resolved Hide resolved
lib/api/district/routes.js Outdated Show resolved Hide resolved
lib/api/district/routes.js Outdated Show resolved Hide resolved
lib/api/district/utils.js Outdated Show resolved Hide resolved
lib/api/district/utils.js Show resolved Hide resolved
@antoineludeau
Copy link
Member

Comme vu ensemble, faire deux routes "PUT" :

  • district/postal-codes-from-datanova
  • district/postal-codes-from-datanova-url (avec "url" en paramètre de la requête)

@FLoreauIGN FLoreauIGN force-pushed the create-api-route-to-update-district-postal-code-with-datanova branch from b26b211 to 8d3c42c Compare April 30, 2024 16:24
lib/api/district/routes.js Outdated Show resolved Hide resolved
lib/api/district/utils.js Outdated Show resolved Hide resolved
@FLoreauIGN FLoreauIGN force-pushed the create-api-route-to-update-district-postal-code-with-datanova branch from 8d3c42c to 2cfb46e Compare May 7, 2024 15:09
@FLoreauIGN FLoreauIGN requested a review from antoineludeau May 13, 2024 12:30
Comment on lines +8 to +11
return bddDistrictMock
.map(district => [district.meta.insee.cog, district])
.filter(([cog]) => districtCOGs.includes(cog))
.map(([, district]) => district)
Copy link
Member

Choose a reason for hiding this comment

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

Ici, pourquoi ne pas faire un simple filter : bddDistrictMock.filter(district => districtCOGs.includes(district.meta?.insee?.cog))

@antoineludeau
Copy link
Member

Il manque la partie sur le déclenchement de l'export vers mongo. Qu'est ce qui est prévu pour ce cas-là ? Est-ce que l'on veut exporter tous les districts qui ont changés ou bien tous les districts de France?

@nkokla nkokla marked this pull request as draft July 4, 2024 09:33
@antoineludeau
Copy link
Member

New PR on this topic : #444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

intégrer les données CP de datanova - migration
2 participants