- Une fois sur la page de l’entreprise, consultez l’onglet{' '}
- justificatifs et retrouvez-y les données
+ Une fois sur la page de l’entreprise, retrouvez les données
d’immatriculations issues du Registre National des Entreprises (RNE)
tenu par l’
.
@@ -81,7 +80,7 @@ export default function ExtraitKbis() {
NB : le lien se construit ainsi :
diff --git a/components/annonces-section/annonces/bodacc.tsx b/app/(header-default)/annonces/[slug]/_components/bodacc.tsx
similarity index 100%
rename from components/annonces-section/annonces/bodacc.tsx
rename to app/(header-default)/annonces/[slug]/_components/bodacc.tsx
diff --git a/components/annonces-section/annonces/joafe.tsx b/app/(header-default)/annonces/[slug]/_components/joafe.tsx
similarity index 100%
rename from components/annonces-section/annonces/joafe.tsx
rename to app/(header-default)/annonces/[slug]/_components/joafe.tsx
diff --git a/app/(header-default)/annonces/[slug]/_components/observations-rne.tsx b/app/(header-default)/annonces/[slug]/_components/observations-rne.tsx
new file mode 100644
index 000000000..88129c7fc
--- /dev/null
+++ b/app/(header-default)/annonces/[slug]/_components/observations-rne.tsx
@@ -0,0 +1,59 @@
+'use client';
+
+import { Tag } from '#components-ui/tag';
+import { AsyncDataSectionClient } from '#components/section/data-section/client';
+import { FullTable } from '#components/table/full';
+import { EAdministration } from '#models/administrations/EAdministration';
+import { IUniteLegale } from '#models/core/types';
+import { ISession } from '#models/user/session';
+import { useAPIRouteData } from 'hooks/fetch/use-API-route-data';
+
+export const ObservationsRNE: React.FC<{
+ uniteLegale: IUniteLegale;
+ session: ISession | null;
+}> = ({ uniteLegale, session }) => {
+ const immatriculationRNE = useAPIRouteData('rne', uniteLegale.siren, session);
+
+ return (
+
+ Cette structure ne possède pas de fiche d’immatriculation au{' '}
+ Registre National des Entreprises (RNE)
+ >
+ }
+ >
+ {(immatriculationRNE) =>
+ immatriculationRNE.observations &&
+ immatriculationRNE.observations.length > 0 ? (
+ <>
+
+
+ Cette structure possède également{' '}
+ {immatriculationRNE.observations.length} observation(s) au{' '}
+ RNE
+ :
+
+ [
+ o.dateAjout,
+ o.numObservation ? {o.numObservation} : '',
+ o.description,
+ ])}
+ />
+ >
+ ) : (
+ <>
+ Cette structure ne possède pas d’observations au{' '}
+ Registre National des Entreprises (RNE)
+ >
+ )
+ }
+
+ );
+};
diff --git a/app/(header-default)/annonces/[slug]/page.tsx b/app/(header-default)/annonces/[slug]/page.tsx
index 54b52b8e3..be39795d2 100644
--- a/app/(header-default)/annonces/[slug]/page.tsx
+++ b/app/(header-default)/annonces/[slug]/page.tsx
@@ -1,6 +1,3 @@
-import { Metadata } from 'next';
-import AnnoncesBodacc from '#components/annonces-section/annonces/bodacc';
-import AnnoncesJOAFESection from '#components/annonces-section/annonces/joafe';
import { DonneesPriveesSection } from '#components/donnees-privees-section';
import Title from '#components/title-section';
import { FICHE } from '#components/title-section/tabs';
@@ -16,6 +13,10 @@ import extractParamsAppRouter, {
AppRouterProps,
} from '#utils/server-side-helper/app/extract-params';
import getSession from '#utils/server-side-helper/app/get-session';
+import AnnoncesBodacc from 'app/(header-default)/annonces/[slug]/_components/bodacc';
+import AnnoncesJOAFESection from 'app/(header-default)/annonces/[slug]/_components/joafe';
+import { Metadata } from 'next';
+import { ObservationsRNE } from './_components/observations-rne';
export const generateMetadata = async (
props: AppRouterProps
@@ -50,7 +51,12 @@ const AnnoncesPage = async (props: AppRouterProps) => {
/>
{estDiffusible(uniteLegale) ||
hasRights(session, EScope.nonDiffusible) ? (
-
+ <>
+
+ {uniteLegale.dateMiseAJourInpi && (
+
+ )}
+ >
) : (
)}
diff --git a/app/(header-default)/documents/[slug]/_components/justificatifs/index.tsx b/app/(header-default)/documents/[slug]/_components/justificatifs/index.tsx
new file mode 100644
index 000000000..4e18f1571
--- /dev/null
+++ b/app/(header-default)/documents/[slug]/_components/justificatifs/index.tsx
@@ -0,0 +1,26 @@
+import { IUniteLegale, isAssociation } from '#models/core/types';
+import { ISession } from '#models/user/session';
+import AvisSituationSection from './insee';
+import { JustificatifImmatriculationJOAFE } from './joafe';
+import { JustificatifImmatriculationRNE } from './rne';
+
+const JustificatifsSection: React.FC<{
+ uniteLegale: IUniteLegale;
+ session: ISession | null;
+}> = ({ uniteLegale, session }) => {
+ return (
+ <>
+ {isAssociation(uniteLegale) && (
+
+ )}
+ {uniteLegale.dateMiseAJourInpi && (
+
+ )}
+
+ >
+ );
+};
+export default JustificatifsSection;
diff --git a/app/(header-default)/justificatif/[slug]/_components/insee.tsx b/app/(header-default)/documents/[slug]/_components/justificatifs/insee.tsx
similarity index 98%
rename from app/(header-default)/justificatif/[slug]/_components/insee.tsx
rename to app/(header-default)/documents/[slug]/_components/justificatifs/insee.tsx
index f63dcfd93..045da286f 100644
--- a/app/(header-default)/justificatif/[slug]/_components/insee.tsx
+++ b/app/(header-default)/documents/[slug]/_components/justificatifs/insee.tsx
@@ -1,4 +1,3 @@
-import React from 'react';
import ButtonLink from '#components-ui/button';
import IsActiveTag from '#components-ui/is-active-tag';
import { Tag } from '#components-ui/tag';
@@ -12,6 +11,7 @@ import { IEtablissement, IUniteLegale } from '#models/core/types';
import { EScope, hasRights } from '#models/user/rights';
import { ISession } from '#models/user/session';
import { formatSiret } from '#utils/helpers';
+import React from 'react';
const AvisSituationTable: React.FC<{
etablissements: IEtablissement[];
@@ -65,7 +65,7 @@ const AvisSituationNonDiffusible = () => (
const AvisSituationSection: React.FC = ({ uniteLegale, session }) => (
{!estDiffusible(uniteLegale) &&
diff --git a/app/(header-default)/documents/[slug]/_components/justificatifs/joafe.tsx b/app/(header-default)/documents/[slug]/_components/justificatifs/joafe.tsx
new file mode 100644
index 000000000..9288c51df
--- /dev/null
+++ b/app/(header-default)/documents/[slug]/_components/justificatifs/joafe.tsx
@@ -0,0 +1,78 @@
+'use client';
+
+import AssociationCreationNotFoundAlert from '#components-ui/alerts-with-explanations/association-creation-not-found-alert';
+import ButtonLink from '#components-ui/button';
+import { Icon } from '#components-ui/icon/wrapper';
+import { PrintNever } from '#components-ui/print-visibility';
+import { AsyncDataSectionClient } from '#components/section/data-section/client';
+import { EAdministration } from '#models/administrations/EAdministration';
+import { IAssociation } from '#models/core/types';
+import { formatDate, formatIntFr } from '#utils/helpers';
+import { useFetchJOAFE } from 'hooks';
+import React from 'react';
+import { TwoColumnTable } from '../../../../../../components/table/simple';
+
+type IProps = {
+ uniteLegale: IAssociation;
+};
+
+export const JustificatifImmatriculationJOAFE: React.FC = ({
+ uniteLegale,
+}) => {
+ const annoncesJOAFE = useFetchJOAFE(uniteLegale);
+
+ return (
+
+ }
+ >
+ {(annoncesJOAFE) => {
+ const annonceCreation = annoncesJOAFE.annonces.find(
+ (annonce) => annonce.typeAvisLibelle === 'Création'
+ );
+
+ if (typeof annonceCreation === 'undefined') {
+ return ;
+ } else {
+ const downloadLink = annonceCreation.path + '?format=pdf';
+
+ const data = [
+ ['Siren', formatIntFr(uniteLegale.siren)],
+ ['N°RNA', formatIntFr(uniteLegale.association.idAssociation)],
+ [
+ 'Date d’enregistrement',
+ formatDate(annonceCreation.datePublication),
+ ],
+ ];
+ return (
+ <>
+
+ Cette structure est enregistrée au{' '}
+ Journal Officiel des Association (JOAFE).
+
+
+ {downloadLink && (
+
+
+ Pour accéder à l’annonce de création de l’association,
+ téléchargez le document ci-dessous :
+
+
+
+ Télécharger le justificatif
+
+
+
+ )}
+ >
+ );
+ }
+ }}
+
+ );
+};
diff --git a/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx b/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx
new file mode 100644
index 000000000..9fef93856
--- /dev/null
+++ b/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx
@@ -0,0 +1,88 @@
+import routes from '#clients/routes';
+import ButtonLink from '#components-ui/button';
+import { Icon } from '#components-ui/icon/wrapper';
+import { PrintNever } from '#components-ui/print-visibility';
+import { INPI } from '#components/administrations';
+import { Section } from '#components/section';
+import { EAdministration } from '#models/administrations/EAdministration';
+import { estDiffusible } from '#models/core/diffusion';
+import { IUniteLegale } from '#models/core/types';
+import { EScope, hasRights } from '#models/user/rights';
+import { ISession } from '#models/user/session';
+
+export const JustificatifImmatriculationRNE = ({
+ uniteLegale,
+ session,
+}: {
+ uniteLegale: IUniteLegale;
+ session: ISession | null;
+}) => {
+ const siteLink = `${routes.rne.portail.entreprise}${uniteLegale.siren}`;
+
+ if (
+ !estDiffusible(uniteLegale) &&
+ !hasRights(session, EScope.nonDiffusible)
+ ) {
+ return (
+
+ Le(s) dirigeant(s) se sont opposés à la diffusion de leurs données
+ personnelles. Pour télécharger l’extrait d’immatriculation de cette
+ entreprise, rendez-vous sur le site{' '}
+ data.inpi.fr.
+
+ );
+ }
+ return (
+
+
+
+ Pour accéder aux données contenues dans un extrait d’immatriculation
+ (équivalent de{' '}
+
+ l’extrait KBIS ou D1
+
+ ), vous pouvez soit télécharger le{' '}
+
+ justificatif d’immatriculation au Registre National des Entreprises
+ (RNE)
+
+ , soit consulter la fiche complète sur le site de l’
+
+ :
+
+
+
+
+
+ Télécharger le justificatif d’immatriculation
+
+
+
- Cette structure est enregistrée au{' '}
- Journal Officiel des Association (JOAFE).
-
-
- {immatriculation.downloadLink && (
-
-
- Pour accéder à l’annonce de création de l’association,
- téléchargez le document ci-dessous :
-
-
-
- Télécharger le justificatif
-
-
-
- )}
- >
- );
- }}
-
-
- >
-);
-
-export default ImmatriculationJOAFE;
diff --git a/app/(header-default)/justificatif/[slug]/_components/rne.tsx b/app/(header-default)/justificatif/[slug]/_components/rne.tsx
deleted file mode 100644
index 8f6186357..000000000
--- a/app/(header-default)/justificatif/[slug]/_components/rne.tsx
+++ /dev/null
@@ -1,227 +0,0 @@
-import React from 'react';
-import routes from '#clients/routes';
-import { OpenClosedTag } from '#components-ui/badge/frequent';
-import ButtonLink from '#components-ui/button';
-import { HorizontalSeparator } from '#components-ui/horizontal-separator';
-import { Icon } from '#components-ui/icon/wrapper';
-import { PrintNever } from '#components-ui/print-visibility';
-import { Tag } from '#components-ui/tag';
-import { INPI } from '#components/administrations';
-import { DataSection } from '#components/section/data-section';
-import { FullTable } from '#components/table/full';
-import { TwoColumnTable } from '#components/table/simple';
-import { EAdministration } from '#models/administrations/EAdministration';
-import { IAPINotRespondingError } from '#models/api-not-responding';
-import {
- defaultNonDiffusiblePlaceHolder,
- estDiffusible,
-} from '#models/core/diffusion';
-import { IUniteLegale } from '#models/core/types';
-import { IImmatriculationRNE } from '#models/immatriculation';
-import { formatDate, formatIntFr } from '#utils/helpers';
-
-type IProps = {
- immatriculation: IImmatriculationRNE | IAPINotRespondingError;
- uniteLegale: IUniteLegale;
-};
-
-const ImmatriculationLinks = ({
- uniteLegale,
- siteLink,
-}: {
- uniteLegale: IUniteLegale;
- siteLink?: string;
-}) => {
- if (!estDiffusible(uniteLegale)) {
- return (
-
- Le(s) dirigeant(s) se sont opposés à la diffusion de leurs données
- personnelles. Pour télécharger l’extrait d’immatriculation de cette
- entreprise, rendez-vous sur le site{' '}
- data.inpi.fr.
-
- );
- }
- return (
- <>
-
-
- Pour accéder aux données contenues dans un extrait d’immatriculation
- (équivalent de{' '}
-
- l’extrait KBIS ou D1
-
- ), vous pouvez soit télécharger le{' '}
-
- justificatif d’immatriculation au Registre National des Entreprises
- (RNE)
-
- , soit consulter la fiche complète sur le site de l’
-
- :
-
-
-
-
-
- Télécharger le justificatif d’immatriculation
-
-
-
-
-
- ⇢ Voir la fiche sur le site de l’INPI
-
-
-
-
- >
- );
-};
-
-const ImmatriculationRNE: React.FC = ({
- immatriculation,
- uniteLegale,
-}) => {
- return (
- <>
-
- Cette structure ne possède pas de fiche d’immatriculation au{' '}
- Registre National des Entreprises (RNE)
- >
- }
- additionalInfoOnError={
-
- }
- >
- {(immatriculation) => (
- <>
-
- Cette structure possède une fiche d’immatriculation au{' '}
- Registre National des Entreprises (RNE) qui liste
- les entreprises de France et qui est tenu par l’
- .
-
+ Cette structure est une entreprise immatriculée au{' '}
+ Registre National des Entreprises (RNE). Ce
+ registre liste les entreprises de France. Il est tenu par l’
+ .
+
+
+ >
+ )}
+
+ );
+};
diff --git a/components/unite-legale-section/index.tsx b/components/unite-legale-section/index.tsx
index d63d78b75..c90e7aefa 100644
--- a/components/unite-legale-section/index.tsx
+++ b/components/unite-legale-section/index.tsx
@@ -1,6 +1,6 @@
-import React from 'react';
+import { OpenClosedTag } from '#components-ui/badge/frequent';
import FAQLink from '#components-ui/faq-link';
-import { HorizontalSeparator } from '#components-ui/horizontal-separator';
+import InformationTooltip from '#components-ui/information-tooltip';
import { ConventionCollectivesBadgesSection } from '#components/badges-section/convention-collectives';
import { ProtectedCertificatesBadgesSection } from '#components/badges-section/labels-and-certificates/protected-certificats';
import EORICell from '#components/eori-cell';
@@ -21,6 +21,7 @@ import { ISession } from '#models/user/session';
import { formatDate, formatIntFr, formatSiret } from '#utils/helpers';
import { libelleCategorieEntreprise } from '#utils/helpers/formatting/categories-entreprise';
import { libelleTrancheEffectif } from '#utils/helpers/formatting/codes-effectifs';
+import React from 'react';
import {
LabelsAndCertificatesBadgesSection,
checkHasLabelsAndCertificates,
@@ -85,22 +86,56 @@ const UniteLegaleSection: React.FC<{
libelleCategorieEntreprise(uniteLegale),
],
['Date de création', formatDate(uniteLegale.dateCreation)],
- [
- 'Dernière modification à l’Insee',
- formatDate(uniteLegale.dateMiseAJourInsee),
- ],
- ...(uniteLegale.dateMiseAJourInpi
- ? [
- [
- 'Dernière modification à l’Inpi',
- formatDate(uniteLegale.dateMiseAJourInpi),
- ],
- ]
- : []),
...(!estActif(uniteLegale)
? [['Date de fermeture', formatDate(uniteLegale.dateFermeture)]]
: []),
['', ],
+ [
+ 'Inscription aux registres',
+ <>
+ {uniteLegale.dateMiseAJourInsee && (
+
+
+
+ )}
+ {uniteLegale.dateMiseAJourInpi && (
+ <>
+ {' '}
+
+
+
+
+
+ >
+ )}
+ >,
+ ],
+ ['', ],
[
'Convention(s) collective(s)',
Annonce de création au JOAFE :{' '}
@@ -168,6 +203,27 @@ const UniteLegaleSection: React.FC<{
)}
{uniteLegale.dateMiseAJourInpi && (
)}
+ {isAssociation(uniteLegale) && (
+
+ )}
>
) : (
)}
- {isAssociation(uniteLegale) && (
-
- )}
>
);
diff --git a/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx b/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx
index 9fef93856..e2dbad3c1 100644
--- a/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx
+++ b/app/(header-default)/documents/[slug]/_components/justificatifs/rne.tsx
@@ -1,13 +1,7 @@
-import routes from '#clients/routes';
-import ButtonLink from '#components-ui/button';
-import { Icon } from '#components-ui/icon/wrapper';
-import { PrintNever } from '#components-ui/print-visibility';
-import { INPI } from '#components/administrations';
+import { DataInpiLinkWithExplanations } from '#components/justificatifs/data-inpi-link';
import { Section } from '#components/section';
import { EAdministration } from '#models/administrations/EAdministration';
-import { estDiffusible } from '#models/core/diffusion';
import { IUniteLegale } from '#models/core/types';
-import { EScope, hasRights } from '#models/user/rights';
import { ISession } from '#models/user/session';
export const JustificatifImmatriculationRNE = ({
@@ -16,73 +10,12 @@ export const JustificatifImmatriculationRNE = ({
}: {
uniteLegale: IUniteLegale;
session: ISession | null;
-}) => {
- const siteLink = `${routes.rne.portail.entreprise}${uniteLegale.siren}`;
-
- if (
- !estDiffusible(uniteLegale) &&
- !hasRights(session, EScope.nonDiffusible)
- ) {
- return (
-
- Le(s) dirigeant(s) se sont opposés à la diffusion de leurs données
- personnelles. Pour télécharger l’extrait d’immatriculation de cette
- entreprise, rendez-vous sur le site{' '}
- data.inpi.fr.
-
- );
- }
- return (
-
-
-
- Pour accéder aux données contenues dans un extrait d’immatriculation
- (équivalent de{' '}
-
- l’extrait KBIS ou D1
-
- ), vous pouvez soit télécharger le{' '}
-
- justificatif d’immatriculation au Registre National des Entreprises
- (RNE)
-
- , soit consulter la fiche complète sur le site de l’
-
- :
-
-
-
-
-
- Télécharger le justificatif d’immatriculation
-
-
-
-
-
- ⇢ Voir la fiche sur le site de l’INPI
-
-
-
-
-
- );
-};
+}) => (
+
+
+
+);
diff --git a/components/unite-legale-immatriculation-section/index.tsx b/app/(header-default)/entreprise/[slug]/_components/immatriculation-section.tsx
similarity index 51%
rename from components/unite-legale-immatriculation-section/index.tsx
rename to app/(header-default)/entreprise/[slug]/_components/immatriculation-section.tsx
index c29ae969d..4a4efff40 100644
--- a/components/unite-legale-immatriculation-section/index.tsx
+++ b/app/(header-default)/entreprise/[slug]/_components/immatriculation-section.tsx
@@ -1,14 +1,46 @@
+import FAQLink from '#components-ui/faq-link';
import { INPI } from '#components/administrations';
+import { DataInpiLinkWithExplanations } from '#components/justificatifs/data-inpi-link';
import { DataSection } from '#components/section/data-section';
import { TwoColumnTable } from '#components/table/simple';
import { EAdministration } from '#models/administrations/EAdministration';
import { IUniteLegale } from '#models/core/types';
+import { ISession } from '#models/user/session';
import { formatDate } from '#utils/helpers';
+const formatCapitalSocial = (
+ immatriculation: IUniteLegale['immatriculation']
+) => {
+ if (immatriculation?.capital) {
+ try {
+ return `${new Intl.NumberFormat('fr-FR', {
+ style: 'currency',
+ currency: immatriculation?.deviseCapital ?? 'EUR',
+ }).format(immatriculation?.capital)} ${
+ immatriculation.estCapitalVariable ? 'variable' : 'fixe'
+ }`;
+ } catch {
+ return `${immatriculation?.capital} ${immatriculation?.deviseCapital} ${
+ immatriculation.estCapitalVariable ? 'variable' : 'fixe'
+ }`;
+ }
+ }
+ return '';
+};
+
+const formatDateCloture = (DDMM: string) => {
+ if (DDMM && DDMM.length === 4) {
+ return `${DDMM.slice(0, 2)}/${DDMM.slice(2)}`;
+ }
+ return DDMM;
+};
+
export const UniteLegaleImmatriculationSection = ({
uniteLegale,
+ session,
}: {
uniteLegale: IUniteLegale;
+ session: ISession | null;
}) => {
const immatriculation = uniteLegale.immatriculation;
return (
@@ -41,18 +73,35 @@ export const UniteLegaleImmatriculationSection = ({
],
[
'Nature de l’entreprise',
- immatriculation?.natureEntreprise,
+ (immatriculation?.natureEntreprise || []).join(', '),
],
...(immatriculation?.isPersonneMorale
? [
- ['Capital social', immatriculation?.capital],
+ [
+
+ Le capital social d’une société est constitué des
+ apports (en argent ou en nature) de ses
+ actionnaires.
+
+ Il peut être fixe ou variable. La modification
+ d’un capital fixe nécessite une modification des
+ statuts tandis que le capital variable peut varier
+ dans certaines limites sans modification des
+ statuts.
+ ,
+ formatCapitalSocial(immatriculation),
+ ],
[
'Clôture de l’exercice comptable',
- immatriculation?.dateCloture,
+ formatDateCloture(immatriculation?.dateCloture),
],
+ ]
+ : []),
+ ...(immatriculation?.duree
+ ? [
[
'Durée de la personne morale',
- immatriculation?.duree,
+ `${immatriculation?.duree} ans`,
],
]
: []),
@@ -68,6 +117,10 @@ export const UniteLegaleImmatriculationSection = ({
: []),
]}
/>
+
>
)}
diff --git a/app/(header-default)/entreprise/[slug]/_components/inscriptions.tsx b/app/(header-default)/entreprise/[slug]/_components/inscriptions.tsx
new file mode 100644
index 000000000..43c5ed031
--- /dev/null
+++ b/app/(header-default)/entreprise/[slug]/_components/inscriptions.tsx
@@ -0,0 +1,145 @@
+import { OpenClosedTag } from '#components-ui/badge/frequent';
+import { Icon } from '#components-ui/icon/wrapper';
+import InformationTooltip from '#components-ui/information-tooltip';
+import AvisSituationLink from '#components/justificatifs/avis-situation-link';
+import ExtraitRNELink from '#components/justificatifs/extrait-rne-link';
+import { estActif } from '#models/core/etat-administratif';
+import { IUniteLegale } from '#models/core/types';
+import { ISession } from '#models/user/session';
+import { formatDate } from '#utils/helpers';
+import React, { PropsWithChildren } from 'react';
+import styles from './style.module.css';
+
+const Wrapper: React.FC> = ({
+ children,
+ link,
+}) => (
+
);
diff --git a/components/association-section/index.tsx b/components/association-section/index.tsx
index e1536444e..0a5bcc173 100644
--- a/components/association-section/index.tsx
+++ b/components/association-section/index.tsx
@@ -155,6 +155,7 @@ const AssociationSection = ({
}
>
diff --git a/components/justificatifs/data-inpi-link/index.tsx b/components/justificatifs/data-inpi-link/index.tsx
new file mode 100644
index 000000000..68f46677a
--- /dev/null
+++ b/components/justificatifs/data-inpi-link/index.tsx
@@ -0,0 +1,73 @@
+import routes from '#clients/routes';
+import ButtonLink from '#components-ui/button';
+import { Icon } from '#components-ui/icon/wrapper';
+import { PrintNever } from '#components-ui/print-visibility';
+import { INPI } from '#components/administrations';
+import { estDiffusible } from '#models/core/diffusion';
+import { IUniteLegale } from '#models/core/types';
+import { EScope, hasRights } from '#models/user/rights';
+import { ISession } from '#models/user/session';
+
+type IProps = { uniteLegale: IUniteLegale; session: ISession | null };
+
+export const DataInpiLinkWithExplanations = ({
+ uniteLegale,
+ session,
+}: IProps) => {
+ const siteLink = `${routes.rne.portail.entreprise}${uniteLegale.siren}`;
+
+ if (
+ !estDiffusible(uniteLegale) &&
+ !hasRights(session, EScope.nonDiffusible)
+ ) {
+ return (
+ <>
+ Le(s) dirigeant(s) se sont opposés à la diffusion de leurs données
+ personnelles. Pour télécharger l’extrait d’immatriculation de cette
+ entreprise, rendez-vous sur le site{' '}
+ data.inpi.fr.
+ >
+ );
+ }
+ return (
+
+
+ Pour accéder aux données contenues dans un extrait d’immatriculation
+ (équivalent de{' '}
+
+ l’extrait KBIS ou D1
+
+ ), vous pouvez soit télécharger l’{' '}
+
+ extrait des inscriptions au Registre National des Entreprises (RNE)
+
+ , soit consulter la fiche complète sur le site de l’
+
+ :
+
+
+
+
+
+ Télécharger le justificatif d’immatriculation
+
+
+
- formtInfos(beneficiaire))}
- />
- >
- )}
-
- >
- );
-}
-
const WarningRBE = () => (
À compter du 31 juillet 2024, le registre des bénéficiaires effectifs{' '}
diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx
index f18398d66..6731b90d3 100644
--- a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx
+++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx
@@ -1,15 +1,44 @@
'use client';
import BreakPageForPrint from '#components-ui/print-break-page';
+import { IAPINotRespondingError } from '#models/api-not-responding';
import { IUniteLegale } from '#models/core/types';
-import { isDataSuccess } from '#models/data-fetching';
+import {
+ IDataFetchingState,
+ isDataLoading,
+ isDataSuccess,
+ isUnauthorized,
+} from '#models/data-fetching';
+import { IDirigeants } from '#models/immatriculation';
import { ISession } from '#models/user/session';
import { useAPIRouteData } from 'hooks/fetch/use-API-route-data';
import BeneficiairesSection from './beneficiaires';
-import DirigeantsProtectedSection from './protected-dirigeants';
+import RCSRNEComparison from './rcs-rne-comparison';
import DirigeantsSection from './rne-dirigeants';
import DirigeantSummary from './summary';
+export type IDirigeantsFetching =
+ | IDirigeants
+ | IAPINotRespondingError
+ | IDataFetchingState;
+
+function mergeDirigeants(
+ dirigeantsRNE: IDirigeantsFetching,
+ dirigeantsRCS: IDirigeantsFetching
+) {
+ if (isUnauthorized(dirigeantsRCS)) {
+ return { dirigeants: dirigeantsRNE, isProtected: false };
+ } else {
+ if (isDataLoading(dirigeantsRCS) || isDataLoading(dirigeantsRNE)) {
+ return { dirigeants: IDataFetchingState.LOADING, isProtected: false };
+ }
+ if (isDataSuccess(dirigeantsRCS)) {
+ return { dirigeants: dirigeantsRCS, isProtected: true };
+ }
+ }
+ return { dirigeants: dirigeantsRNE, isProtected: false };
+}
+
export function DirigeantInformation({
uniteLegale,
session,
@@ -17,7 +46,11 @@ export function DirigeantInformation({
uniteLegale: IUniteLegale;
session: ISession | null;
}) {
- const immatriculationRNE = useAPIRouteData('rne', uniteLegale.siren, session);
+ const dirigeantsRNE = useAPIRouteData(
+ 'rne-dirigeants',
+ uniteLegale.siren,
+ session
+ );
const mandatairesRCS = useAPIRouteData(
'espace-agent/rcs-mandataires',
@@ -25,32 +58,33 @@ export function DirigeantInformation({
session
);
- const hasMandataireRCS = isDataSuccess(mandatairesRCS);
+ const { dirigeants, isProtected } = mergeDirigeants(
+ dirigeantsRNE,
+ mandatairesRCS
+ );
return (
<>
-
+
+ {/* {metadata.isFallback && dirigeants.length > 0 && (
+
+ )} */}
+
+ >
+ }
/>
- {hasMandataireRCS ? (
-
- ) : (
-
- )}
-
-
+
>
);
}
diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx
deleted file mode 100644
index 381ed1b71..000000000
--- a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import routes from '#clients/routes';
-import { Info, Warning } from '#components-ui/alerts';
-import { INPI } from '#components/administrations';
-import { DataSectionClient } from '#components/section/data-section';
-import { EAdministration } from '#models/administrations/EAdministration';
-import { IAPINotRespondingError } from '#models/api-not-responding';
-import { IUniteLegale } from '#models/core/types';
-import { IDataFetchingState, isDataSuccess } from '#models/data-fetching';
-import { IDirigeant, IImmatriculationRNE } from '#models/immatriculation';
-import { DirigeantContent } from './dirigeant-content';
-
-type IProps = {
- immatriculationRNE:
- | IImmatriculationRNE
- | IAPINotRespondingError
- | IDataFetchingState;
- uniteLegale: IUniteLegale;
- mandatairesRCS:
- | Array
- | IAPINotRespondingError
- | IDataFetchingState;
-};
-
-function RCSDiffersFromRNE({
- mandatairesRCS,
- immatriculationRNE,
- uniteLegale,
-}: {
- mandatairesRCS: Array;
- immatriculationRNE:
- | IImmatriculationRNE
- | IAPINotRespondingError
- | IDataFetchingState;
- uniteLegale: IUniteLegale;
-}) {
- if (!isDataSuccess(immatriculationRNE)) {
- return null;
- }
-
- if (immatriculationRNE.dirigeants.length === mandatairesRCS.length) {
- return null;
- }
-
- return (
-
- Les données d’Infogreffe sont issues du RNE mais il y a une différence
- entre le nombre de dirigeant(s) retourné(s) par l’
- ({immatriculationRNE.dirigeants.length}) et par Infogreffe (
- {mandatairesRCS.length}). Pour comparer, vous pouvez consulter la page de
- cette entreprise sur{' '}
-
- data.inpi.fr
-
- .
-
- );
-}
-
-/**
- * Dirigeants for agents : either from Infogreffe or from RNE
- */
-function DirigeantsProtectedSection({
- uniteLegale,
- immatriculationRNE,
- mandatairesRCS,
-}: IProps) {
- return (
-
- {(mandatairesRCS) => (
- <>
-
- Ces informations proviennent d’
-
- Infogreffe
- {' '}
- et incluent la date de naissance des dirigeant(e)s.
-
-
-
- Cette entreprise possède {mandatairesRCS.length} dirigeant(s)
- enregistré(s) au RNE :
-
-
- >
- )}
-
- );
-}
-
-export default DirigeantsProtectedSection;
diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rcs-rne-comparison.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rcs-rne-comparison.tsx
new file mode 100644
index 000000000..ee305cc79
--- /dev/null
+++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rcs-rne-comparison.tsx
@@ -0,0 +1,43 @@
+import routes from '#clients/routes';
+import { Warning } from '#components-ui/alerts';
+import { INPI } from '#components/administrations';
+import { IUniteLegale } from '#models/core/types';
+import { isDataSuccess } from '#models/data-fetching';
+import { IDirigeantsFetching } from '.';
+
+function RCSRNEComparison({
+ dirigeantsRNE,
+ dirigeantsRCS,
+ uniteLegale,
+}: {
+ dirigeantsRNE: IDirigeantsFetching;
+ dirigeantsRCS: IDirigeantsFetching;
+ uniteLegale: IUniteLegale;
+}) {
+ if (!isDataSuccess(dirigeantsRNE) || !isDataSuccess(dirigeantsRCS)) {
+ return null;
+ } else if (dirigeantsRNE.data.length === dirigeantsRCS.data.length) {
+ return null;
+ }
+
+ return (
+
+ Les données d’Infogreffe sont issues du RNE mais il y a une différence
+ entre le nombre de dirigeant(s) retourné(s) par l’
+ ({dirigeantsRNE.data.length}) et par Infogreffe (
+ {dirigeantsRCS.data.length}
+ ). Pour comparer, vous pouvez consulter la page de cette entreprise sur{' '}
+
+ data.inpi.fr
+
+ .
+
+ );
+}
+
+export default RCSRNEComparison;
diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx
index 8f62e3102..b635f45fe 100644
--- a/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx
+++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx
@@ -1,33 +1,42 @@
import routes from '#clients/routes';
-import InpiPartiallyDownWarning from '#components-ui/alerts-with-explanations/inpi-partially-down';
+import { Info } from '#components-ui/alerts';
import { INPI } from '#components/administrations';
import { AsyncDataSectionClient } from '#components/section/data-section/client';
import { UniteLegalePageLink } from '#components/unite-legale-page-link';
import { EAdministration } from '#models/administrations/EAdministration';
-import { IAPINotRespondingError } from '#models/api-not-responding';
import { IUniteLegale } from '#models/core/types';
-import { IDataFetchingState } from '#models/data-fetching';
-import { IImmatriculationRNE } from '#models/immatriculation';
+import { IDirigeantsFetching } from '.';
import { DirigeantContent } from './dirigeant-content';
type IProps = {
- immatriculationRNE:
- | IImmatriculationRNE
- | IAPINotRespondingError
- | IDataFetchingState;
+ dirigeants: IDirigeantsFetching;
uniteLegale: IUniteLegale;
+ isProtected: boolean;
+ warning: JSX.Element;
};
/**
* Dirigeants section
*/
-function DirigeantsSection({ uniteLegale, immatriculationRNE }: IProps) {
+function DirigeantsSection({
+ uniteLegale,
+ dirigeants,
+ isProtected,
+ warning,
+}: IProps) {
+ const sources = [EAdministration.INPI];
+
+ if (isProtected) {
+ sources.push(EAdministration.INFOGREFFE);
+ }
+
return (
Cette structure n’est pas enregistrée au{' '}
@@ -35,15 +44,26 @@ function DirigeantsSection({ uniteLegale, immatriculationRNE }: IProps) {
>
}
>
- {(immatriculationRNE) => {
- const plural = immatriculationRNE.dirigeants.length > 1 ? 's' : '';
+ {(dirigeants) => {
+ const plural = dirigeants.data.length > 1 ? 's' : '';
return (
<>
- {immatriculationRNE.metadata.isFallback &&
- immatriculationRNE.dirigeants.length > 0 && (
-
- )}
- {immatriculationRNE.dirigeants.length === 0 ? (
+ {warning ? warning : null}
+ {isProtected ? (
+
+ Ces informations proviennent d’
+
+ Infogreffe
+ {' '}
+ et incluent la date de naissance des dirigeant(e)s.
+
+ ) : null}
+ {dirigeants.data.length === 0 ? (
Cette entreprise est enregistrée au{' '}
Registre National des Entreprises (RNE), mais
@@ -52,9 +72,8 @@ function DirigeantsSection({ uniteLegale, immatriculationRNE }: IProps) {
) : (
<>
- Cette entreprise possède{' '}
- {immatriculationRNE.dirigeants.length} dirigeant{plural}{' '}
- enregistré{plural} au{' '}
+ Cette entreprise possède {dirigeants.data.length} dirigeant
+ {plural} enregistré{plural} au{' '}
Registre National des Entreprises (RNE) tenu
par l’
. Pour en savoir plus, vous pouvez consulter{' '}
@@ -67,7 +86,7 @@ function DirigeantsSection({ uniteLegale, immatriculationRNE }: IProps) {