Skip to content

Commit

Permalink
Merge branch 'main' of github.com:etalab/annuaire-entreprises-site
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Aug 13, 2024
2 parents c389238 + c41bb83 commit f288ecd
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions clients/sirene-insee/siren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
IUniteLegale,
} from '#models/core/types';
import {
agregateTripleFields,
formatFirstNames,
formatNameFull,
isEntrepreneurIndividuelFromNatureJuridique,
Expand Down Expand Up @@ -60,9 +59,10 @@ type IPeriodeUniteLegale = {
caractereEmployeurUniteLegale: string;
nomUniteLegale: string;
nomUsageUniteLegale: string;
denominationUsuelle1UniteLegale: string;
denominationUsuelle2UniteLegale: string;
denominationUsuelle3UniteLegale: string;
// deprecated :
// denominationUsuelle1UniteLegale: string;
// denominationUsuelle2UniteLegale: string;
// denominationUsuelle3UniteLegale: string;
};

const clientUniteLegaleInsee = async (
Expand Down Expand Up @@ -93,7 +93,6 @@ const mapToDomainObject = (
anneeEffectifsUniteLegale,
statutDiffusionUniteLegale,
prenomUsuelUniteLegale,
sexeUniteLegale,
identifiantAssociationUniteLegale,
categorieEntreprise,
anneeCategorieEntreprise,
Expand All @@ -111,9 +110,6 @@ const mapToDomainObject = (
caractereEmployeurUniteLegale,
nomUniteLegale,
nomUsageUniteLegale,
denominationUsuelle1UniteLegale,
denominationUsuelle2UniteLegale,
denominationUsuelle3UniteLegale,
} = periodesUniteLegale[0];

const siege = createDefaultEtablissement();
Expand All @@ -140,14 +136,6 @@ const mapToDomainObject = (
)
);

// pre 2008 denomination https://www.sirene.fr/sirene/public/variable/denominationUsuelleEtablissement
const denominationUsuelle =
agregateTripleFields(
denominationUsuelle1UniteLegale,
denominationUsuelle2UniteLegale,
denominationUsuelle3UniteLegale
) || '';

// EI names and firstName
// remove trailing whitespace in case name or firstname is missing
const names = `${formatFirstNames([prenomUsuelUniteLegale])} ${formatNameFull(
Expand All @@ -156,8 +144,8 @@ const mapToDomainObject = (
)}`.trim();

const nomComplet = `${denominationUniteLegale || names || 'Nom inconnu'}${
denominationUsuelle ? ` (${denominationUsuelle})` : ''
}${sigleUniteLegale ? ` (${sigleUniteLegale})` : ''}`;
sigleUniteLegale ? ` (${sigleUniteLegale})` : ''
}`;

const defaultUniteLegale = createDefaultUniteLegale(siren);

Expand Down

0 comments on commit f288ecd

Please sign in to comment.