From 0ec9ec0addb71c1325a03d50d293bd7a9e2a7d7a Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Tue, 6 Sep 2022 09:06:14 +0200 Subject: [PATCH 1/2] feat(api): add ES score --- .../__tests__/__snapshots__/api.test.ts.snap | 232 +++++++----------- api/src/__tests__/api.test.ts | 8 +- api/src/elastic/queries.ts | 2 + 3 files changed, 101 insertions(+), 141 deletions(-) diff --git a/api/src/__tests__/__snapshots__/api.test.ts.snap b/api/src/__tests__/__snapshots__/api.test.ts.snap index 05d23ccc..03c594df 100644 --- a/api/src/__tests__/__snapshots__/api.test.ts.snap +++ b/api/src/__tests__/__snapshots__/api.test.ts.snap @@ -5,7 +5,7 @@ Object { "activitePrincipale": "Fabrication et rechapage de pneumatiques", "activitePrincipaleUniteLegale": "70.22Z", "caractereEmployeurUniteLegale": "O", - "categorieJuridiqueUniteLegale": "5710", + "categorieJuridiqueUniteLegale": "5308", "conventions": Array [ Object { "etat": "VIGUEUR_ETEN", @@ -29,19 +29,18 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2021-12-31", - "etablissements": 133, + "dateDebut": "2022-07-04", + "etablissements": 134, "etatAdministratifUniteLegale": "A", "firstMatchingEtablissement": Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND", + "address": "23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND", "categorieEntreprise": "GE", "codeCommuneEtablissement": "63113", "codePostalEtablissement": "63000", "etablissementSiege": true, "etatAdministratifEtablissement": "A", "idccs": Array [ - "1486", "0045", "9999", ], @@ -50,7 +49,8 @@ Object { }, "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", - "matching": 133, + "matching": 134, + "score": 12.82995, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", } @@ -61,10 +61,10 @@ Object { "activitePrincipale": "Traitement de données, hébergement et activités connexes", "activitePrincipaleEtablissement": "63.11Z", "activitePrincipaleUniteLegale": "70.22Z", - "address": "107 RUE SERVIENT 69003 LYON", + "address": "107 RUE SERVIENT 69003 LYON 3EME", "caractereEmployeurUniteLegale": "O", "categorieEntreprise": "GE", - "categorieJuridiqueUniteLegale": "5710", + "categorieJuridiqueUniteLegale": "5308", "codeCommuneEtablissement": "69383", "codePostalEtablissement": "69003", "conventions": Array [ @@ -80,9 +80,9 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2021-12-31", + "dateDebut": "2022-07-04", "etablissementSiege": false, - "etablissements": 133, + "etablissements": 134, "etatAdministratifEtablissement": "A", "etatAdministratifUniteLegale": "A", "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", @@ -92,6 +92,7 @@ Object { "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "libelleCommuneEtablissement": "LYON 3EME", "matching": 1, + "score": 16.97701, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", "siret": "85520050703169", @@ -100,238 +101,194 @@ Object { exports[`Test search generic search 1`] = ` Object { - "activitePrincipale": "Commerce de gros d'équipements automobiles", + "activitePrincipale": "Fabrication et rechapage de pneumatiques", "activitePrincipaleUniteLegale": "70.22Z", "allMatchingEtablissements": Array [ Object { - "activitePrincipaleEtablissement": "45.31Z", - "address": "ZAC DE L’ARNAHURT 33650 LA BRÈDE", - "codeCommuneEtablissement": "33213", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "22.11Z", + "address": "PL ALEXANDRE DIEU 18230 SAINT-DOULCHARD", + "codeCommuneEtablissement": "18205", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050702823", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050701106", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "RUE DE CHARLIEU 42300 ROANNE", - "codeCommuneEtablissement": "42187", - "codePostalEtablissement": "33650", + "address": "ZI N°01 1 RUE GUTENBERG 37300 JOUE-LES-TOURS", + "codeCommuneEtablissement": "37122", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050701445", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700850", }, Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "ZI BLAVOZY-ST GERM LAPRADE 43700 BLAVOZY", - "codeCommuneEtablissement": "43032", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "52.10B", + "address": "ZA PLATEAU D HERIN 59220 ROUVIGNIES", + "codeCommuneEtablissement": "59515", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050701866", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050703086", }, Object { - "activitePrincipaleEtablissement": "25.93Z", - "address": "AVENUE EDOUARD MICHELIN 56000 VANNES", - "codeCommuneEtablissement": "56260", - "codePostalEtablissement": "33650", - "etablissementSiege": false, + "activitePrincipaleEtablissement": "22.11Z", + "address": "23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND", + "codeCommuneEtablissement": "63113", + "codePostalEtablissement": "18230", + "etablissementSiege": true, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700637", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700017", }, Object { - "activitePrincipaleEtablissement": "25.93Z", - "address": "RUE DU XAY 88190 GOLBEY", - "codeCommuneEtablissement": "88209", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "63.11Z", + "address": "107 RUE SERVIENT 69003 LYON 3EME", + "codeCommuneEtablissement": "69383", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700108", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050703169", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "7 AVENUE DU PRÉSIDENT RENÉ COTY 10600 LA CHAPELLE-SAINT-LUC", - "codeCommuneEtablissement": "10081", - "codePostalEtablissement": "33650", + "address": "ZONE INDUST DE LA FIOLLE 71450 BLANZY", + "codeCommuneEtablissement": "71040", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050701171", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700306", }, Object { - "activitePrincipaleEtablissement": "71.20B", - "address": "ROUTE D’ARLES 13300 SALON-DE-PROVENCE", - "codeCommuneEtablissement": "13103", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "22.11Z", + "address": "USINE DE SERVICE 7 AV DU PRESIDENT RENE COTY 10600 LA CHAPELLE-SAINT-LUC", + "codeCommuneEtablissement": "10081", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050703094", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050701171", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "PLACE ALEXANDRE DIEU 18230 SAINT-DOULCHARD", - "codeCommuneEtablissement": "18205", - "codePostalEtablissement": "33650", + "address": "ZONE INDUSTR D AIGUUILLY RTE DE CHARLIEU 42300 ROANNE", + "codeCommuneEtablissement": "42187", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050701106", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050701445", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "1 RUE GUTENBERG 37300 JOUÉ-LÈS-TOURS", - "codeCommuneEtablissement": "37122", - "codePostalEtablissement": "33650", + "address": "ZI BLAVOZY-ST GERM LAPRADE 43700 BLAVOZY", + "codeCommuneEtablissement": "43032", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700850", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050701866", }, Object { "activitePrincipaleEtablissement": "22.11Z", "address": "16 RUE DE TOUTLEMONDE 49300 CHOLET", "codeCommuneEtablissement": "49099", - "codePostalEtablissement": "33650", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", "siret": "85520050700710", }, Object { - "activitePrincipaleEtablissement": "52.10B", - "address": "ZA PLATEAU D’HERIN 59220 ROUVIGNIES", - "codeCommuneEtablissement": "59515", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "25.93Z", + "address": "AV EDOUARD MICHELIN 56000 VANNES", + "codeCommuneEtablissement": "56260", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050703086", - }, - Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND", - "codeCommuneEtablissement": "63113", - "codePostalEtablissement": "33650", - "etablissementSiege": true, - "idccs": Array [ - "0045", - "1486", - "9999", - ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700017", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700637", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "ZI DE FELET 63300 THIERS", + "address": "FELET 63300 THIERS", "codeCommuneEtablissement": "63430", - "codePostalEtablissement": "33650", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", "siret": "85520050702278", }, Object { - "activitePrincipaleEtablissement": "63.11Z", - "address": "107 RUE SERVIENT 69003 LYON", - "codeCommuneEtablissement": "69383", - "codePostalEtablissement": "33650", - "etablissementSiege": false, - "idccs": Array [ - "0045", - ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050703169", - }, - Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "USINE MICHELIN DE BLANZY LA FIOLLE (ZONE INDUSTRIELLE) BLANZY", - "codeCommuneEtablissement": "71040", - "codePostalEtablissement": "33650", - "etablissementSiege": false, - "idccs": Array [ - "0045", - "9999", - ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700306", - }, - Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "ROUTE DE NANTES 85000 LA ROCHE-SUR-YON", - "codeCommuneEtablissement": "85191", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "52.10B", + "address": "ZI REPUBLIQUE 21 RUE MARCELLIN BERTHELOT 86000 POITIERS", + "codeCommuneEtablissement": "86194", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050701379", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700132", }, Object { - "activitePrincipaleEtablissement": "52.10B", - "address": "21 RUE MARCELLIN BERTHELOT 86000 POITIERS", - "codeCommuneEtablissement": "86194", - "codePostalEtablissement": "33650", + "activitePrincipaleEtablissement": "25.93Z", + "address": "ZI RUE DU XAY 88190 GOLBEY", + "codeCommuneEtablissement": "88209", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "LA BREDE", - "siret": "85520050700132", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "siret": "85520050700108", }, Object { "activitePrincipaleEtablissement": "58.11Z", - "address": "27 COURS DE L’ILE SEGUIN 92100 BOULOGNE-BILLANCOURT", + "address": "27 CRS DE L'ILE SEGUIN 92100 BOULOGNE-BILLANCOURT", "codeCommuneEtablissement": "92012", - "codePostalEtablissement": "33650", + "codePostalEtablissement": "18230", "etablissementSiege": false, "idccs": Array [ "0045", "1486", - "9999", ], - "libelleCommuneEtablissement": "LA BREDE", + "libelleCommuneEtablissement": "SAINT-DOULCHARD", "siret": "85520050703144", }, ], "caractereEmployeurUniteLegale": "O", - "categorieJuridiqueUniteLegale": "5710", + "categorieJuridiqueUniteLegale": "5308", "conventions": Array [ Object { "etat": "VIGUEUR_ETEN", @@ -355,12 +312,13 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2021-12-31", - "etablissements": 133, + "dateDebut": "2022-07-04", + "etablissements": 134, "etatAdministratifUniteLegale": "A", "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", - "matching": 18, + "matching": 15, + "score": 21.940681, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", } diff --git a/api/src/__tests__/api.test.ts b/api/src/__tests__/api.test.ts index b6a8921c..ca9d4b45 100644 --- a/api/src/__tests__/api.test.ts +++ b/api/src/__tests__/api.test.ts @@ -91,7 +91,7 @@ describe("Test search", () => { expect( b2.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); const { body: b3 } = await searchCall({ @@ -101,14 +101,14 @@ describe("Test search", () => { expect( b3.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); const { body: b4 } = await searchCall({ address: "63", query: "michelin" }); expect( b4.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); }, 15000); @@ -273,6 +273,6 @@ describe("Test api params", () => { const { body: { entreprises: resp3 }, } = await searchCall({ matchingLimit: -1, query: "carrefour" }); - expect(resp3[0].allMatchingEtablissements.length).toBe(194); + expect(resp3[0].allMatchingEtablissements.length).toBe(158); }); }); diff --git a/api/src/elastic/queries.ts b/api/src/elastic/queries.ts index 18b3b3bc..8536dea6 100644 --- a/api/src/elastic/queries.ts +++ b/api/src/elastic/queries.ts @@ -64,6 +64,7 @@ export const mapHit = libelleCommuneEtablissement, codePaysEtrangerEtablissement, }, + _score, inner_hits, highlight, }: any) => { @@ -169,6 +170,7 @@ export const mapHit = highlightLabel, label, matching, + score: _score, simpleLabel, siren, }; From 4a09f90da32149700a0c803674eb12e4fd8d447f Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Tue, 6 Sep 2022 09:13:05 +0200 Subject: [PATCH 2/2] fix: snaps --- .../__tests__/__snapshots__/api.test.ts.snap | 235 +++++++++++------- api/src/__tests__/api.test.ts | 8 +- 2 files changed, 144 insertions(+), 99 deletions(-) diff --git a/api/src/__tests__/__snapshots__/api.test.ts.snap b/api/src/__tests__/__snapshots__/api.test.ts.snap index 03c594df..f6865f8f 100644 --- a/api/src/__tests__/__snapshots__/api.test.ts.snap +++ b/api/src/__tests__/__snapshots__/api.test.ts.snap @@ -5,7 +5,7 @@ Object { "activitePrincipale": "Fabrication et rechapage de pneumatiques", "activitePrincipaleUniteLegale": "70.22Z", "caractereEmployeurUniteLegale": "O", - "categorieJuridiqueUniteLegale": "5308", + "categorieJuridiqueUniteLegale": "5710", "conventions": Array [ Object { "etat": "VIGUEUR_ETEN", @@ -29,18 +29,19 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2022-07-04", - "etablissements": 134, + "dateDebut": "2021-12-31", + "etablissements": 133, "etatAdministratifUniteLegale": "A", "firstMatchingEtablissement": Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND", + "address": "PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND", "categorieEntreprise": "GE", "codeCommuneEtablissement": "63113", "codePostalEtablissement": "63000", "etablissementSiege": true, "etatAdministratifEtablissement": "A", "idccs": Array [ + "1486", "0045", "9999", ], @@ -49,8 +50,8 @@ Object { }, "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", - "matching": 134, - "score": 12.82995, + "matching": 133, + "score": 12.817251, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", } @@ -61,10 +62,10 @@ Object { "activitePrincipale": "Traitement de données, hébergement et activités connexes", "activitePrincipaleEtablissement": "63.11Z", "activitePrincipaleUniteLegale": "70.22Z", - "address": "107 RUE SERVIENT 69003 LYON 3EME", + "address": "107 RUE SERVIENT 69003 LYON", "caractereEmployeurUniteLegale": "O", "categorieEntreprise": "GE", - "categorieJuridiqueUniteLegale": "5308", + "categorieJuridiqueUniteLegale": "5710", "codeCommuneEtablissement": "69383", "codePostalEtablissement": "69003", "conventions": Array [ @@ -80,9 +81,9 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2022-07-04", + "dateDebut": "2021-12-31", "etablissementSiege": false, - "etablissements": 134, + "etablissements": 133, "etatAdministratifEtablissement": "A", "etatAdministratifUniteLegale": "A", "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", @@ -92,7 +93,7 @@ Object { "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "libelleCommuneEtablissement": "LYON 3EME", "matching": 1, - "score": 16.97701, + "score": 16.958105, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", "siret": "85520050703169", @@ -101,194 +102,238 @@ Object { exports[`Test search generic search 1`] = ` Object { - "activitePrincipale": "Fabrication et rechapage de pneumatiques", + "activitePrincipale": "Commerce de gros d'équipements automobiles", "activitePrincipaleUniteLegale": "70.22Z", "allMatchingEtablissements": Array [ Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "PL ALEXANDRE DIEU 18230 SAINT-DOULCHARD", - "codeCommuneEtablissement": "18205", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "45.31Z", + "address": "ZAC DE L’ARNAHURT 33650 LA BRÈDE", + "codeCommuneEtablissement": "33213", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050701106", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050702823", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "ZI N°01 1 RUE GUTENBERG 37300 JOUE-LES-TOURS", - "codeCommuneEtablissement": "37122", - "codePostalEtablissement": "18230", + "address": "RUE DE CHARLIEU 42300 ROANNE", + "codeCommuneEtablissement": "42187", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700850", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050701445", }, Object { - "activitePrincipaleEtablissement": "52.10B", - "address": "ZA PLATEAU D HERIN 59220 ROUVIGNIES", - "codeCommuneEtablissement": "59515", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "22.11Z", + "address": "ZI BLAVOZY-ST GERM LAPRADE 43700 BLAVOZY", + "codeCommuneEtablissement": "43032", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050703086", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050701866", }, Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND", - "codeCommuneEtablissement": "63113", - "codePostalEtablissement": "18230", - "etablissementSiege": true, + "activitePrincipaleEtablissement": "25.93Z", + "address": "AVENUE EDOUARD MICHELIN 56000 VANNES", + "codeCommuneEtablissement": "56260", + "codePostalEtablissement": "33650", + "etablissementSiege": false, "idccs": Array [ "0045", - "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700017", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700637", }, Object { - "activitePrincipaleEtablissement": "63.11Z", - "address": "107 RUE SERVIENT 69003 LYON 3EME", - "codeCommuneEtablissement": "69383", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "25.93Z", + "address": "RUE DU XAY 88190 GOLBEY", + "codeCommuneEtablissement": "88209", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050703169", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700108", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "ZONE INDUST DE LA FIOLLE 71450 BLANZY", - "codeCommuneEtablissement": "71040", - "codePostalEtablissement": "18230", + "address": "7 AVENUE DU PRÉSIDENT RENÉ COTY 10600 LA CHAPELLE-SAINT-LUC", + "codeCommuneEtablissement": "10081", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700306", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050701171", }, Object { - "activitePrincipaleEtablissement": "22.11Z", - "address": "USINE DE SERVICE 7 AV DU PRESIDENT RENE COTY 10600 LA CHAPELLE-SAINT-LUC", - "codeCommuneEtablissement": "10081", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "71.20B", + "address": "ROUTE D’ARLES 13300 SALON-DE-PROVENCE", + "codeCommuneEtablissement": "13103", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050701171", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050703094", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "ZONE INDUSTR D AIGUUILLY RTE DE CHARLIEU 42300 ROANNE", - "codeCommuneEtablissement": "42187", - "codePostalEtablissement": "18230", + "address": "PLACE ALEXANDRE DIEU 18230 SAINT-DOULCHARD", + "codeCommuneEtablissement": "18205", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050701445", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050701106", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "ZI BLAVOZY-ST GERM LAPRADE 43700 BLAVOZY", - "codeCommuneEtablissement": "43032", - "codePostalEtablissement": "18230", + "address": "1 RUE GUTENBERG 37300 JOUÉ-LÈS-TOURS", + "codeCommuneEtablissement": "37122", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050701866", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700850", }, Object { "activitePrincipaleEtablissement": "22.11Z", "address": "16 RUE DE TOUTLEMONDE 49300 CHOLET", "codeCommuneEtablissement": "49099", - "codePostalEtablissement": "18230", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "libelleCommuneEtablissement": "LA BREDE", "siret": "85520050700710", }, Object { - "activitePrincipaleEtablissement": "25.93Z", - "address": "AV EDOUARD MICHELIN 56000 VANNES", - "codeCommuneEtablissement": "56260", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "52.10B", + "address": "ZA PLATEAU D’HERIN 59220 ROUVIGNIES", + "codeCommuneEtablissement": "59515", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700637", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050703086", }, Object { "activitePrincipaleEtablissement": "22.11Z", - "address": "FELET 63300 THIERS", + "address": "PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND", + "codeCommuneEtablissement": "63113", + "codePostalEtablissement": "33650", + "etablissementSiege": true, + "idccs": Array [ + "0045", + "1486", + "9999", + ], + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700017", + }, + Object { + "activitePrincipaleEtablissement": "22.11Z", + "address": "ZI DE FELET 63300 THIERS", "codeCommuneEtablissement": "63430", - "codePostalEtablissement": "18230", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "libelleCommuneEtablissement": "LA BREDE", "siret": "85520050702278", }, Object { - "activitePrincipaleEtablissement": "52.10B", - "address": "ZI REPUBLIQUE 21 RUE MARCELLIN BERTHELOT 86000 POITIERS", - "codeCommuneEtablissement": "86194", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "63.11Z", + "address": "107 RUE SERVIENT 69003 LYON", + "codeCommuneEtablissement": "69383", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700132", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050703169", }, Object { - "activitePrincipaleEtablissement": "25.93Z", - "address": "ZI RUE DU XAY 88190 GOLBEY", - "codeCommuneEtablissement": "88209", - "codePostalEtablissement": "18230", + "activitePrincipaleEtablissement": "22.11Z", + "address": "USINE MICHELIN DE BLANZY LA FIOLLE (ZONE INDUSTRIELLE) BLANZY", + "codeCommuneEtablissement": "71040", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", - "siret": "85520050700108", + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700306", + }, + Object { + "activitePrincipaleEtablissement": "22.11Z", + "address": "ROUTE DE NANTES 85000 LA ROCHE-SUR-YON", + "codeCommuneEtablissement": "85191", + "codePostalEtablissement": "33650", + "etablissementSiege": false, + "idccs": Array [ + "0045", + "9999", + ], + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050701379", + }, + Object { + "activitePrincipaleEtablissement": "52.10B", + "address": "21 RUE MARCELLIN BERTHELOT 86000 POITIERS", + "codeCommuneEtablissement": "86194", + "codePostalEtablissement": "33650", + "etablissementSiege": false, + "idccs": Array [ + "0045", + ], + "libelleCommuneEtablissement": "LA BREDE", + "siret": "85520050700132", }, Object { "activitePrincipaleEtablissement": "58.11Z", - "address": "27 CRS DE L'ILE SEGUIN 92100 BOULOGNE-BILLANCOURT", + "address": "27 COURS DE L’ILE SEGUIN 92100 BOULOGNE-BILLANCOURT", "codeCommuneEtablissement": "92012", - "codePostalEtablissement": "18230", + "codePostalEtablissement": "33650", "etablissementSiege": false, "idccs": Array [ "0045", "1486", + "9999", ], - "libelleCommuneEtablissement": "SAINT-DOULCHARD", + "libelleCommuneEtablissement": "LA BREDE", "siret": "85520050703144", }, ], "caractereEmployeurUniteLegale": "O", - "categorieJuridiqueUniteLegale": "5308", + "categorieJuridiqueUniteLegale": "5710", "conventions": Array [ Object { "etat": "VIGUEUR_ETEN", @@ -312,13 +357,13 @@ Object { }, ], "dateCreationUniteLegale": "1955-01-01", - "dateDebut": "2022-07-04", - "etablissements": 134, + "dateDebut": "2021-12-31", + "etablissements": 133, "etatAdministratifUniteLegale": "A", "highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", - "matching": 15, - "score": 21.940681, + "matching": 18, + "score": 21.91652, "simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN", "siren": "855200507", } diff --git a/api/src/__tests__/api.test.ts b/api/src/__tests__/api.test.ts index ca9d4b45..b6a8921c 100644 --- a/api/src/__tests__/api.test.ts +++ b/api/src/__tests__/api.test.ts @@ -91,7 +91,7 @@ describe("Test search", () => { expect( b2.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); const { body: b3 } = await searchCall({ @@ -101,14 +101,14 @@ describe("Test search", () => { expect( b3.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); const { body: b4 } = await searchCall({ address: "63", query: "michelin" }); expect( b4.entreprises[0].firstMatchingEtablissement.address ).toMatchInlineSnapshot( - `"23 PL DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` + `"PLACE DES CARMES DECHAUX 63000 CLERMONT-FERRAND"` ); }, 15000); @@ -273,6 +273,6 @@ describe("Test api params", () => { const { body: { entreprises: resp3 }, } = await searchCall({ matchingLimit: -1, query: "carrefour" }); - expect(resp3[0].allMatchingEtablissements.length).toBe(158); + expect(resp3[0].allMatchingEtablissements.length).toBe(194); }); });