diff --git a/src/commands/__tests__/index.integration.ts b/src/commands/__tests__/index.integration.ts index 3195652..fa5b061 100644 --- a/src/commands/__tests__/index.integration.ts +++ b/src/commands/__tests__/index.integration.ts @@ -105,7 +105,7 @@ describe("Perform indexation", () => { throw new Error(`${r.warnings}`); } expect(r.body.hits.hits).toBeInstanceOf(Array); - expect(r.body.hits.total.value).toEqual(297); + expect(r.body.hits.total.value).toEqual(299); expect(r.body.hits.hits).toEqual( expect.arrayContaining([ expect.objectContaining({ @@ -114,16 +114,18 @@ describe("Perform indexation", () => { nic: "00010", siret: "00541034500010", statutDiffusionEtablissement: "O", - dateCreationEtablissement: "", + dateCreationEtablissement: "1900-01-01", trancheEffectifsEtablissement: "", anneeEffectifsEtablissement: "", activitePrincipaleRegistreMetiersEtablissement: "", - dateDernierTraitementEtablissement: "", + dateDernierTraitementEtablissement: "2024-03-22T15:40:57", etablissementSiege: "true", - nombrePeriodesEtablissement: "1", + nombrePeriodesEtablissement: "2", complementAdresseEtablissement: "", numeroVoieEtablissement: "", indiceRepetitionEtablissement: "", + dernierNumeroVoieEtablissement: "", + indiceRepetitionDernierNumeroVoieEtablissement: "", typeVoieEtablissement: "RTE", libelleVoieEtablissement: "DE DOULLENS", codePostalEtablissement: "80100", @@ -135,6 +137,9 @@ describe("Perform indexation", () => { libelleCedexEtablissement: "", codePaysEtrangerEtablissement: "", libellePaysEtrangerEtablissement: "", + identifiantAdresseEtablissement: "", + coordonneeLambertAbscisseEtablissement: "", + coordonneeLambertOrdonneeEtablissement: "", complementAdresse2Etablissement: "", numeroVoie2Etablissement: "", indiceRepetition2Etablissement: "", diff --git a/src/indexation/elasticSearch.helpers.ts b/src/indexation/elasticSearch.helpers.ts index 9bb9650..4fddafb 100644 --- a/src/indexation/elasticSearch.helpers.ts +++ b/src/indexation/elasticSearch.helpers.ts @@ -379,15 +379,13 @@ export const streamReadAndIndex = async ( indexConfig: IndexProcessConfig, isReleaseIndexation = true ): Promise => { - const headers = indexConfig.headers; // stop parsing CSV after MAX_ROWS const maxRows = parseInt(process.env.MAX_ROWS as string, 10); const readableStream = fs.createReadStream(csvPath); const parseCsvStream = parse({ - headers, + headers: true, ignoreEmpty: true, - discardUnmappedColumns: true, ...(maxRows && { maxRows }) }) .transform((data, callback) => { diff --git a/src/indexation/indexInsee.helpers.ts b/src/indexation/indexInsee.helpers.ts index beaee8a..f9583b6 100644 --- a/src/indexation/indexInsee.helpers.ts +++ b/src/indexation/indexInsee.helpers.ts @@ -250,6 +250,8 @@ export const siretIndexConfig: IndexProcessConfig = { "complementAdresseEtablissement", "numeroVoieEtablissement", "indiceRepetitionEtablissement", + "dernierNumeroVoieEtablissement", + "indiceRepetitionDernierNumeroVoieEtablissement", "typeVoieEtablissement", "libelleVoieEtablissement", "codePostalEtablissement", @@ -261,6 +263,9 @@ export const siretIndexConfig: IndexProcessConfig = { "libelleCedexEtablissement", "codePaysEtrangerEtablissement", "libellePaysEtrangerEtablissement", + "identifiantAdresseEtablissement", + "coordonneeLambertAbscisseEtablissement", + "coordonneeLambertOrdonneeEtablissement", "complementAdresse2Etablissement", "numeroVoie2Etablissement", "indiceRepetition2Etablissement", diff --git a/tests/fixtures/StockEtablissement_utf8_sample.zip b/tests/fixtures/StockEtablissement_utf8_sample.zip index 1862792..1d8eb7e 100644 Binary files a/tests/fixtures/StockEtablissement_utf8_sample.zip and b/tests/fixtures/StockEtablissement_utf8_sample.zip differ