From 8ba17bbeabe7fdc49b3a4a9c52ec50c5632010da Mon Sep 17 00:00:00 2001 From: antoineludeau <52679050+antoineludeau@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:15:38 +0100 Subject: [PATCH] Added district config in export to exploitation db --- lib/api/consumers/format-to-legacy-helpers.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/api/consumers/format-to-legacy-helpers.js b/lib/api/consumers/format-to-legacy-helpers.js index 087af921..b388d351 100644 --- a/lib/api/consumers/format-to-legacy-helpers.js +++ b/lib/api/consumers/format-to-legacy-helpers.js @@ -14,7 +14,7 @@ const districtsAddressesExtraDataIndex = districtsAddressesExtraData.reduce((acc }, {}) export const formatDistrictDataForLegacy = async (district, {totalCommonToponymRecords, totalSpecifCommonToponymRecords, totalAddressRecords, totalAddressCertifiedRecords}) => { - const {id, meta, labels} = district + const {id, meta, labels, config} = district const {insee: {cog}} = meta // District data from administrative division @@ -65,7 +65,8 @@ export const formatDistrictDataForLegacy = async (district, {totalCommonToponymR idRevision: meta?.bal?.idRevision, dateRevision: meta?.bal?.dateRevision, composedAt: new Date(), - withBanId: true + withBanId: true, + config } } @@ -141,7 +142,8 @@ export const formatCommonToponymDataForLegacy = async (commonToponym, {district, tiles: meta?.geography?.tiles, position: legacyPosition, displayBBox: commonToponymBbox, - dateMAJ: legacyUpdateDate + dateMAJ: legacyUpdateDate, + withBanId: true } } @@ -168,7 +170,8 @@ export const formatCommonToponymDataForLegacy = async (commonToponym, {district, tiles: meta?.geography?.tiles, sources: ['bal'], nbNumeros: Number.parseInt(addressCount, 10), - nbNumerosCertifies: Number.parseInt(certifiedAddressCount, 10) + nbNumerosCertifies: Number.parseInt(certifiedAddressCount, 10), + withBanId: true } } @@ -240,7 +243,8 @@ export const formatAddressDataForLegacy = async (address, {district, commonTopon certifie: certified, codePostal: meta?.laposte?.codePostal, libelleAcheminement: meta?.laposte?.libelleAcheminement, - adressesOriginales: [address] + adressesOriginales: [address], + withBanId: true } }