diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/association/dirigeants.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/association/dirigeants.tsx new file mode 100644 index 000000000..f3c9a3b8a --- /dev/null +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/association/dirigeants.tsx @@ -0,0 +1,112 @@ +'use client'; + +import FAQLink from '#components-ui/faq-link'; +import InformationTooltip from '#components-ui/information-tooltip'; +import { Tag } from '#components-ui/tag'; +import AgentWallAssociationProtected from '#components/espace-agent-components/agent-wall/association'; +import NonRenseigne from '#components/non-renseigne'; +import { DataSectionClient } from '#components/section/data-section'; +import { FullTable } from '#components/table/full'; +import { EAdministration } from '#models/administrations/EAdministration'; +import { IUniteLegale } from '#models/core/types'; +import { isUnauthorized } from '#models/data-fetching'; +import { ISession } from '#models/user/session'; +import { useAPIRouteData } from 'hooks/fetch/use-API-route-data'; + +type IProps = { + uniteLegale: IUniteLegale; + session: ISession | null; +}; + +const NoDirigeants = () => ( + <>Aucun(e) dirigeant(e) n’a été retrouvé pour cette association. +); + +/** + * Dirigeants for agents : RNA or Le compte asso + */ +function DirigeantsAssociationSection({ uniteLegale, session }: IProps) { + const associationProtected = useAPIRouteData( + 'espace-agent/association-protected', + uniteLegale.siren, + session + ); + + if (isUnauthorized(associationProtected)) { + return ( + + ); + } + + return ( + } + sources={[EAdministration.MI, EAdministration.DJEPVA]} + data={associationProtected} + > + {(associationProtected) => ( + <> + {associationProtected.dirigeants.length === 0 ? ( + + ) : ( + <> + Cette association possède {associationProtected.dirigeants.length}{' '} + dirigeant(s) enregistré(s) au{' '} + + Registre National des Associations + {' '} + : +
+
+ [ + <> + {fonction}{' '} + {valideur_cec && ( + + Validateur CEC + + )} + , + <> + {civilite} {(nom || '').toUpperCase()} {prenom} + , + publication_internet && courriel ? ( + {courriel} + ) : ( + + ), + ] + )} + /> + + )} + + )} +
+ ); +} + +export default DirigeantsAssociationSection; diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/beneficiaires.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/beneficiaires.tsx similarity index 100% rename from app/(header-default)/dirigeants/[slug]/_component/sections/beneficiaires.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/beneficiaires.tsx diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/dirigeant-content.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/dirigeant-content.tsx similarity index 96% rename from app/(header-default)/dirigeants/[slug]/_component/sections/dirigeant-content.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/dirigeant-content.tsx index ed6df6718..c23c4d5b9 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/dirigeant-content.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/dirigeant-content.tsx @@ -6,7 +6,12 @@ import { IPersonneMorale, } from '#models/immatriculation'; import { formatDateLong, formatDatePartial, formatIntFr } from '#utils/helpers'; -import { isPersonneMorale } from './is-personne-morale'; +import { isPersonneMorale } from '../is-personne-morale'; + +type IDirigeantContentProps = { + dirigeants: IDirigeant[]; + uniteLegale: IUniteLegale; +}; export function DirigeantContent({ dirigeants, @@ -83,9 +88,3 @@ export function DirigeantContent({ ); } - -type IDirigeantContentProps = { - dirigeants: IDirigeant[]; - uniteLegale: IUniteLegale; - isFallback: boolean; -}; diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/index.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx similarity index 77% rename from app/(header-default)/dirigeants/[slug]/_component/sections/index.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx index e0c114795..48447ed33 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/index.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/index.tsx @@ -2,7 +2,7 @@ import BreakPageForPrint from '#components-ui/print-break-page'; import { IUniteLegale } from '#models/core/types'; -import { EScope, hasRights } from '#models/user/rights'; +import { hasAnyError, isUnauthorized } from '#models/data-fetching'; import { ISession } from '#models/user/session'; import { useAPIRouteData } from 'hooks/fetch/use-API-route-data'; import BeneficiairesSection from './beneficiaires'; @@ -19,20 +19,29 @@ export function DirigeantInformation({ }) { const immatriculationRNE = useAPIRouteData('rne', uniteLegale.siren, session); + const mandatairesRCS = useAPIRouteData( + 'espace-agent/rcs-mandataires', + uniteLegale.siren, + session + ); + + const hasMandataireRCS = + !isUnauthorized(mandatairesRCS) && !hasAnyError(mandatairesRCS); + return ( <> - {!hasRights(session, EScope.mandatairesRCS) ? ( - ) : ( - diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/protected-dirigeants.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx similarity index 86% rename from app/(header-default)/dirigeants/[slug]/_component/sections/protected-dirigeants.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx index dd2f5d164..5f6f6f757 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/protected-dirigeants.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/protected-dirigeants.tsx @@ -11,10 +11,7 @@ import { isDataLoading, } from '#models/data-fetching'; import { IDirigeant, IImmatriculationRNE } from '#models/immatriculation'; -import { ISession } from '#models/user/session'; -import { useAPIRouteData } from 'hooks/fetch/use-API-route-data'; import { DirigeantContent } from './dirigeant-content'; -import DirigeantsSection from './rne-dirigeants'; type IProps = { immatriculationRNE: @@ -22,7 +19,10 @@ type IProps = { | IAPINotRespondingError | IDataFetchingState; uniteLegale: IUniteLegale; - session: ISession | null; + mandatairesRCS: + | Array + | IAPINotRespondingError + | IDataFetchingState; }; function RCSDiffersFromRNE({ @@ -71,23 +71,8 @@ function RCSDiffersFromRNE({ function DirigeantsProtectedSection({ uniteLegale, immatriculationRNE, - session, + mandatairesRCS, }: IProps) { - const mandatairesRCS = useAPIRouteData( - 'espace-agent/rcs-mandataires', - uniteLegale.siren, - session - ); - - if (hasAnyError(mandatairesRCS)) { - return ( - - ); - } - return ( diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/rne-dirigeants.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx similarity index 97% rename from app/(header-default)/dirigeants/[slug]/_component/sections/rne-dirigeants.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx index 0a827cd9f..8f62e3102 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/rne-dirigeants.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/rne-dirigeants.tsx @@ -68,7 +68,6 @@ function DirigeantsSection({ uniteLegale, immatriculationRNE }: IProps) { diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/summary.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/summary.tsx similarity index 94% rename from app/(header-default)/dirigeants/[slug]/_component/sections/summary.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/summary.tsx index 732eae2ae..15a096a70 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/summary.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/entreprise/summary.tsx @@ -110,15 +110,17 @@ const DirigeantSummary: React.FC = ({ } return ( - <> - Cette structure possède : + ); }; diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/service-public-responsables.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/service-public/index.tsx similarity index 98% rename from app/(header-default)/dirigeants/[slug]/_component/sections/service-public-responsables.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/service-public/index.tsx index a9f2d686e..02fb6e091 100644 --- a/app/(header-default)/dirigeants/[slug]/_component/sections/service-public-responsables.tsx +++ b/app/(header-default)/dirigeants/[slug]/_component/sections/service-public/index.tsx @@ -7,7 +7,7 @@ import { FullTable } from '#components/table/full'; import { EAdministration } from '#models/administrations/EAdministration'; import { IUniteLegale } from '#models/core/types'; import { useFetchServicePublic } from 'hooks/fetch/service-public'; -import SubServicesSection from './service-public-subservices'; +import SubServicesSection from './subservices'; export default function ResponsablesServicePublicSection({ uniteLegale, diff --git a/app/(header-default)/dirigeants/[slug]/_component/sections/service-public-subservices.tsx b/app/(header-default)/dirigeants/[slug]/_component/sections/service-public/subservices.tsx similarity index 100% rename from app/(header-default)/dirigeants/[slug]/_component/sections/service-public-subservices.tsx rename to app/(header-default)/dirigeants/[slug]/_component/sections/service-public/subservices.tsx diff --git a/app/(header-default)/dirigeants/[slug]/page.tsx b/app/(header-default)/dirigeants/[slug]/page.tsx index bcf73dc4d..e8fe96a00 100644 --- a/app/(header-default)/dirigeants/[slug]/page.tsx +++ b/app/(header-default)/dirigeants/[slug]/page.tsx @@ -3,7 +3,7 @@ import { DonneesPriveesSection } from '#components/donnees-privees-section'; import Title from '#components/title-section'; import { FICHE } from '#components/title-section/tabs'; import { estDiffusible } from '#models/core/statut-diffusion'; -import { isServicePublic } from '#models/core/types'; +import { isAssociation, isServicePublic } from '#models/core/types'; import { EScope, hasRights } from '#models/user/rights'; import { uniteLegalePageDescription, @@ -14,8 +14,9 @@ import extractParamsAppRouter, { AppRouterProps, } from '#utils/server-side-helper/app/extract-params'; import getSession from '#utils/server-side-helper/app/get-session'; -import { DirigeantInformation } from './_component/sections'; -import ResponsablesServicePublicSection from './_component/sections/service-public-responsables'; +import DirigeantsAssociationSection from './_component/sections/association/dirigeants'; +import { DirigeantInformation } from './_component/sections/entreprise'; +import ResponsablesServicePublicSection from './_component/sections/service-public'; export const generateMetadata = async ( props: AppRouterProps @@ -58,6 +59,11 @@ const DirigeantsPage = async (props: AppRouterProps) => { ) : !estDiffusible(uniteLegale) && !hasRights(session, EScope.nonDiffusible) ? ( + ) : isAssociation(uniteLegale) ? ( + ) : ( )} diff --git a/app/(header-default)/documents/[slug]/_components/actes/actes-association.tsx b/app/(header-default)/documents/[slug]/_components/actes/actes-association.tsx deleted file mode 100644 index 052124a29..000000000 --- a/app/(header-default)/documents/[slug]/_components/actes/actes-association.tsx +++ /dev/null @@ -1,50 +0,0 @@ -// 'use client'; - -// import { DataSectionClient } from '#components/section/data-section'; -// import { EAdministration } from '#models/administrations/EAdministration'; -// import { IUniteLegale } from '#models/core/types'; - -// const NoDocument = () => ( -// <>Aucun document n’a été retrouvé pour cette association. -// ); - -// export const AgentDocumentsAssociation: React.FC<{ -// uniteLegale: IUniteLegale; -// }> = ({ uniteLegale }) => { -// const documents = useFetchRNEDocuments(uniteLegale); - -// return ( -// } -// > -// {(documents) => -// documents.actes?.length === 0 ? ( -// -// ) : ( -// <> -//

-// Cette entreprise possède {documents.actes.length} document(s) au -// RNE. Chaque document peut contenir un ou plusieurs actes : -//

-// {/* {documents.actes.length >= 5 ? ( -// -// -// -// ) : ( -// -// )} */} -// -// ) -// } -//
-// ); -// }; diff --git a/app/(header-default)/documents/[slug]/_components/actes/associations.tsx b/app/(header-default)/documents/[slug]/_components/actes/associations.tsx new file mode 100644 index 000000000..72cbc0062 --- /dev/null +++ b/app/(header-default)/documents/[slug]/_components/actes/associations.tsx @@ -0,0 +1,113 @@ +'use client'; + +import ButtonLink from '#components-ui/button'; +import FAQLink from '#components-ui/faq-link'; +import { DataSectionClient } from '#components/section/data-section'; +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 { formatSiret } from '#utils/helpers'; +import { useAPIRouteData } from 'hooks/fetch/use-API-route-data'; + +const NoDocument = () => ( + <>Aucun document n’a été retrouvé pour cette association. +); + +export const AgentActesAssociation: React.FC<{ + uniteLegale: IUniteLegale; + session: ISession | null; +}> = ({ uniteLegale, session }) => { + const associationProtected = useAPIRouteData( + 'espace-agent/association-protected', + uniteLegale.siren, + session + ); + + return ( + } + > + {(associationProtected) => ( + <> + {associationProtected.documents.rna.length === 0 && + associationProtected.documents.dac.length === 0 && } + + {associationProtected.documents.rna.length > 0 && ( + <> +

+ Documents au{' '} + + Registre National des Associations + +

+ [ + date_depot, + sous_type.libelle, + + Télécharger + , + ] + )} + /> + + )} + {associationProtected.documents.dac.length > 0 && ( + <> +

+ + Documents déposés par l’association lors de démarches en ligne + sur{' '} + + Le Compte Asso + + +

+ [ + date_depot, + + {formatSiret(siret)} + , + annee_validite, + <> + {nom} +
+ {commentaire && {commentaire}} + , + + Télécharger + , + ] + )} + /> + + )} + + )} +
+ ); +}; diff --git a/app/(header-default)/documents/[slug]/_components/actes/index.tsx b/app/(header-default)/documents/[slug]/_components/actes/index.tsx index 241aa8bef..d5ad7d19e 100644 --- a/app/(header-default)/documents/[slug]/_components/actes/index.tsx +++ b/app/(header-default)/documents/[slug]/_components/actes/index.tsx @@ -1,14 +1,25 @@ +import AgentWallAssociationProtected from '#components/espace-agent-components/agent-wall/association'; import AgentWallDocuments from '#components/espace-agent-components/agent-wall/document'; -import { IUniteLegale } from '#models/core/types'; +import { IUniteLegale, isAssociation } from '#models/core/types'; import { EScope, hasRights } from '#models/user/rights'; import { ISession } from '#models/user/session'; -import { AgentActesRNE } from './actes-rne'; +import { AgentActesAssociation } from './associations'; +import { AgentActesRNE } from './rne'; const ActesSection: React.FC<{ uniteLegale: IUniteLegale; session: ISession | null; }> = ({ uniteLegale, session }) => { if (!hasRights(session, EScope.actesRne)) { + if (isAssociation(uniteLegale)) { + return ( + + ); + } return ( ); } + return ( <> + {isAssociation(uniteLegale) && ( + + )} - {/* {isAssociation(uniteLegale) && ( - - )} */} ); }; diff --git a/app/(header-default)/documents/[slug]/_components/actes/actes-rne.tsx b/app/(header-default)/documents/[slug]/_components/actes/rne.tsx similarity index 64% rename from app/(header-default)/documents/[slug]/_components/actes/actes-rne.tsx rename to app/(header-default)/documents/[slug]/_components/actes/rne.tsx index c7a67170c..09c430394 100644 --- a/app/(header-default)/documents/[slug]/_components/actes/actes-rne.tsx +++ b/app/(header-default)/documents/[slug]/_components/actes/rne.tsx @@ -1,17 +1,13 @@ 'use client'; import routes from '#clients/routes'; -import { Warning } from '#components-ui/alerts'; +import { Info } from '#components-ui/alerts'; import ButtonLink from '#components-ui/button'; import ShowMore from '#components-ui/show-more'; import { DataSectionClient } from '#components/section/data-section'; import { FullTable } from '#components/table/full'; import { EAdministration } from '#models/administrations/EAdministration'; -import { - IUniteLegale, - isAssociation, - isServicePublic, -} from '#models/core/types'; +import { IUniteLegale, isServicePublic } from '#models/core/types'; import { IActesRNE } from '#models/immatriculation'; import { ISession } from '#models/user/session'; import { formatDateLong } from '#utils/helpers'; @@ -21,7 +17,7 @@ export const AgentActesRNE: React.FC<{ uniteLegale: IUniteLegale; session: ISession | null; }> = ({ uniteLegale, session }) => { - const documents = useAPIRouteData( + const documentsRne = useAPIRouteData( 'espace-agent/rne/documents', uniteLegale.siren, session @@ -33,39 +29,34 @@ export const AgentActesRNE: React.FC<{ id="actes" isProtected sources={[EAdministration.INPI]} - data={documents} - //@ts-ignore + data={documentsRne} notFoundInfo={ - isAssociation(uniteLegale) ? null : ( - <> - {isServicePublic(uniteLegale) && ( - - Les services publics ne sont pas immatriculés au RNE. - - )} - + isServicePublic(uniteLegale) ? ( + + Les services publics ne sont pas immatriculés au RNE. + + ) : ( + <>Cette structure n’est pas immatriculée au RNE. ) } > - {(documents) => - documents.actes?.length === 0 ? ( - <> - Aucun document n’a été retrouvé dans le RNE pour cette entreprise. - + {(documentsRne) => + documentsRne.actes?.length === 0 ? ( + <>Aucun document n’a été retrouvé dans le RNE pour cette structure. ) : ( <>

- Cette entreprise possède {documents.actes.length} document(s) au - RNE. Chaque document peut contenir un ou plusieurs actes : + Cette entreprise possède {documentsRne.actes.length} document(s) + au RNE. Chaque document peut contenir un ou plusieurs actes :

- {documents.actes.length > 5 ? ( + {documentsRne.actes.length > 5 ? ( - + ) : ( - + )} ) @@ -77,7 +68,7 @@ export const AgentActesRNE: React.FC<{ type IActesTableProps = { actes: IActesRNE['actes']; }; -function ActesTable({ actes }: IActesTableProps) { +export function ActesTable({ actes }: IActesTableProps) { return ( ( + +); diff --git a/app/(header-default)/documents/[slug]/page.tsx b/app/(header-default)/documents/[slug]/page.tsx index c7da91341..52b332e0d 100644 --- a/app/(header-default)/documents/[slug]/page.tsx +++ b/app/(header-default)/documents/[slug]/page.tsx @@ -15,6 +15,7 @@ import extractParamsAppRouter, { import getSession from '#utils/server-side-helper/app/get-session'; import ActesSection from './_components/actes'; import CarteProfessionnelleTPSection from './_components/carte-professionnelle-TP-section'; +import { SummaryDocuments } from './_components/summary-documents'; export const generateMetadata = async ( props: AppRouterProps @@ -51,6 +52,7 @@ const UniteLegaleDocumentPage = async (props: AppRouterProps) => { session={session} /> + {hasRights(session, EScope.conformite) && ( )} diff --git a/app/(header-default)/justificatif/[slug]/_components/summary.tsx b/app/(header-default)/justificatif/[slug]/_components/summary.tsx index cf4fb6908..2cc810db3 100644 --- a/app/(header-default)/justificatif/[slug]/_components/summary.tsx +++ b/app/(header-default)/justificatif/[slug]/_components/summary.tsx @@ -9,8 +9,8 @@ const ImmatriculationSummary: React.FC = ({ immatriculationRNE, }) => { return ( - <> - Cette structure est : + ); }; diff --git a/app/api/data-fetching/routes-handlers.ts b/app/api/data-fetching/routes-handlers.ts index df1e108fc..63eb07e28 100644 --- a/app/api/data-fetching/routes-handlers.ts +++ b/app/api/data-fetching/routes-handlers.ts @@ -1,5 +1,6 @@ import { getAssociationFromSlug } from '#models/association'; import { getEORIValidation } from '#models/eori-validation'; +import { getAssociationProtected } from '#models/espace-agent/association-protected'; import { getCarteProfessionnelleTravauxPublic } from '#models/espace-agent/carte-professionnelle-travaux-publics'; import { getOpqibi } from '#models/espace-agent/certificats/opqibi'; import { getQualibat } from '#models/espace-agent/certificats/qualibat'; @@ -21,6 +22,7 @@ export const APIRoutesHandlers = { 'espace-agent/qualifelec': getQualifelec, 'espace-agent/rcs-mandataires': getMandatairesRCS, 'espace-agent/rne/documents': getDocumentsRNEProtected, + 'espace-agent/association-protected': getAssociationProtected, rne: getImmatriculationRNE, association: getAssociationFromSlug, 'verify-tva': buildAndVerifyTVA, diff --git a/app/api/data-fetching/routes-scopes.ts b/app/api/data-fetching/routes-scopes.ts index 3e682ab83..4b8f31698 100644 --- a/app/api/data-fetching/routes-scopes.ts +++ b/app/api/data-fetching/routes-scopes.ts @@ -10,6 +10,7 @@ export const APIRoutesScopes: Record = { 'espace-agent/qualifelec': EScope.protectedCertificats, 'espace-agent/rcs-mandataires': EScope.mandatairesRCS, 'espace-agent/rne/documents': EScope.documentsRne, + 'espace-agent/association-protected': EScope.associationProtected, rne: EScope.none, association: EScope.none, 'verify-tva': EScope.none, diff --git a/clients/api-entreprise/association/index.ts b/clients/api-entreprise/association/index.ts index 30fa86652..3ce1481e7 100644 --- a/clients/api-entreprise/association/index.ts +++ b/clients/api-entreprise/association/index.ts @@ -1,25 +1,40 @@ -// import routes from '#clients/routes'; -// import { Siren } from '#utils/helpers'; -// import clientAPIEntreprise from '../client'; -// import { IAPIEntrepriseAssociation } from './types'; +import routes from '#clients/routes'; +import { IAssociationProtected } from '#models/espace-agent/association-protected'; +import { Siren } from '#utils/helpers'; +import clientAPIEntreprise from '../client'; +import { IAPIEntrepriseAssociation } from './types'; -// /** -// * GET association from API Entreprise -// */ -// export const clientApiEntrepriseAssociation = async (siren: Siren) => { -// return await clientAPIEntreprise( -// `${ -// process.env.API_ENTREPRISE_URL -// }${routes.apiEntreprise.association.replace('{siren}', siren)}`, -// mapToDomainObject -// ); -// }; +/** + * GET association from API Entreprise + */ +export async function clientApiEntrepriseAssociation(siren: Siren) { + return await clientAPIEntreprise< + IAPIEntrepriseAssociation, + IAssociationProtected + >( + `${ + process.env.API_ENTREPRISE_URL + }${routes.apiEntreprise.association.replace('{siren}', siren)}`, + mapToDomainObject + ); +} -// const mapToDomainObject = (response: IAPIEntrepriseAssociation): unknown => { -// return { -// documentsRna: response.data.documents_rna, -// documentsDac: response.data.etablissements.flatMap((e) => { -// return { siret: e.siret, ...e.documents_dac }; -// }), -// }; -// }; +const mapToDomainObject = ( + response: IAPIEntrepriseAssociation +): IAssociationProtected => { + return { + documents: { + rna: response.data.documents_rna, + dac: response.data.etablissements.flatMap((e) => { + return e.documents_dac.map((d) => { + return { ...d, siret: e.siret }; + }); + }), + }, + dirigeants: response.data.etablissements.flatMap((e) => { + return e.representants_legaux.map((d) => { + return { ...d, siret: e.siret }; + }); + }), + }; +}; diff --git a/clients/api-proxy/association/index.ts b/clients/api-proxy/association/index.ts index f581be76f..4a7e5a9b5 100644 --- a/clients/api-proxy/association/index.ts +++ b/clients/api-proxy/association/index.ts @@ -45,6 +45,7 @@ const mapToDomainObject = ( eligibilite_cec = false, regime = '', util_publique = false, + impots_commerciaux, } = association.identite || {}; const { @@ -89,6 +90,7 @@ const mapToDomainObject = ( dateCreation: date_creat, dateDissolution: date_dissolution, eligibiliteCEC: eligibilite_cec, + impotCommerciaux: impots_commerciaux, adresseSiege: formatAdresse({ numeroVoie: num_voie, typeVoie: type_voie, diff --git a/components/association-section/index.tsx b/components/association-section/index.tsx index 368b31261..847f733c7 100644 --- a/components/association-section/index.tsx +++ b/components/association-section/index.tsx @@ -1,9 +1,9 @@ 'use client'; import AssociationAdressAlert from '#components-ui/alerts-with-explanations/association-adress'; +import FAQLink from '#components-ui/faq-link'; import { HorizontalSeparator } from '#components-ui/horizontal-separator'; import BreakPageForPrint from '#components-ui/print-break-page'; -import { Tag } from '#components-ui/tag'; import { AsyncDataSectionClient } from '#components/section/data-section/client'; import { TwoColumnTable } from '#components/table/simple'; import { EAdministration } from '#models/administrations/EAdministration'; @@ -38,6 +38,7 @@ const getTableData = ( siteWeb = '', agrement = [], eligibiliteCEC = false, + impotCommerciaux = false, } = association || {}; return [ @@ -46,17 +47,28 @@ const getTableData = ( ['Famille', libelleFamille], ['Objet', objet], [ - 'Forme juridique', - regime || formeJuridique || utilPublique || eligibiliteCEC ? ( - <> - {regime ? `${regime}, ` : ''} - {formeJuridique} - {utilPublique && Reconnue d’utilité publique} - {eligibiliteCEC && Éligible CEC} - - ) : ( - '' - ), + + Les deux régimes possibles sont “Loi 1901” (cas général des associations + établies en France) et “Alsace-Moselle” (associations dont le siège se + trouve en Alsace et en Moselle, régies par un droit local) + , + regime, + ], + ['Forme juridique', formeJuridique], + ['Reconnue d’utilité publique', utilPublique ? 'Oui' : 'Non'], + [ + + Compte d’Engagement Citoyen + , + eligibiliteCEC ? 'Oui' : 'Non', + ], + [ + + Indique si l’association est soumise aux impôts commerciaux (à la TVA ou + à l’impôt sur les sociétés). Cela concerne notamment les associations + exerçant une activité lucrative. + , + impotCommerciaux ? 'Oui' : 'Non', ], [ 'Agrément(s)', diff --git a/components/espace-agent-components/agent-wall/association.tsx b/components/espace-agent-components/agent-wall/association.tsx new file mode 100644 index 000000000..c51013b24 --- /dev/null +++ b/components/espace-agent-components/agent-wall/association.tsx @@ -0,0 +1,34 @@ +import { PropsWithChildren } from 'react'; +import { EAdministration } from '#models/administrations/EAdministration'; +import { IUniteLegale } from '#models/core/types'; +import AgentWall from '.'; + +const AgentWallAssociationProtected: React.FC< + PropsWithChildren<{ + title: string; + id: string; + uniteLegale: IUniteLegale; + }> +> = ({ uniteLegale, id, title }) => ( + + Les particuliers, salariés et{' '} + entrepreneurs, peuvent consulter cette donnée sur{' '} + + la fiche data-asso + {' '} + de cette association. + + } + /> +); + +export default AgentWallAssociationProtected; diff --git a/components/espace-agent-components/agent-wall/index.tsx b/components/espace-agent-components/agent-wall/index.tsx index d41f7e3ab..ecdf48545 100644 --- a/components/espace-agent-components/agent-wall/index.tsx +++ b/components/espace-agent-components/agent-wall/index.tsx @@ -10,9 +10,10 @@ const AgentWall: React.FC<{ id?: string; sectionIntro?: JSX.Element; modalFooter?: JSX.Element; -}> = ({ id, title, sectionIntro = null, modalFooter = null }) => { + sources?: EAdministration[]; +}> = ({ id, title, sectionIntro = null, modalFooter = null, sources = [] }) => { return ( -
+
{sectionIntro}
> = ({ : constants.colors.frBlue; return ( - +
+
Une erreur est survenue lors de l’affichage de cette section. @@ -22,7 +25,7 @@ export default function SectionErrorBoundary({ que nous puissions trouver la panne 🕵️‍♀️.

)} -
+
} > {children} diff --git a/data/changelog.yml b/data/changelog.yml index ce99c548f..9f97412dc 100644 --- a/data/changelog.yml +++ b/data/changelog.yml @@ -16,6 +16,11 @@ Le registre des bénéficiaires effectifs n’est plus accessible au public, en application de la [directive européenne 2024/1640 du 31 mai 2024](https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000049761732). Désormais, seules les [personnes en mesure de justifier d’un intérêt légitime](https://www.inpi.fr/faq/qui-peut-acceder-aux-donnees-des-beneficiaires-effectifs) peuvent [effectuer une demande d’accès au registre auprès de l’INPI](https://data.inpi.fr/content/editorial/acces_BE) +- date: 22/07/2024 + target: + agent: true + body: | + Les documents (actes, statuts et documents administratifs complémentaires) et les dirigeants des assoications sont désormais accessibles aux agents publics. - date: 27/06/2024 body: Ajout de la vérification du [numéro EORI](https://www.economie.gouv.fr/entreprises/numero-eori) pour tous les visiteurs. - date: 14/05/2024 diff --git a/models/association/types.ts b/models/association/types.ts index 952343d2d..f4c4408d3 100644 --- a/models/association/types.ts +++ b/models/association/types.ts @@ -7,6 +7,7 @@ export interface IDataAssociation { mail: string; siteWeb: string; utilPublique: boolean; + impotCommerciaux: boolean; regime: string; agrement: { type: string; diff --git a/models/espace-agent/association-protected/index.ts b/models/espace-agent/association-protected/index.ts new file mode 100644 index 000000000..b85d3279c --- /dev/null +++ b/models/espace-agent/association-protected/index.ts @@ -0,0 +1,60 @@ +import { clientApiEntrepriseAssociation } from '#clients/api-entreprise/association'; +import { IAPINotRespondingError } from '#models/api-not-responding'; +import { verifySiren } from '#utils/helpers'; +import { handleApiEntrepriseError } from '../utils'; + +type IDocumentAssociation = { + date_depot: string; //'2019-01-01'; + url: string; + id: string; + type: string; //'Budget prévisionnel'; +}; + +type IDocumentDAC = IDocumentAssociation & { + annee_validite: string; //'2019'; + commentaire: string; //'Les comptes annuels sont consolidés au niveau national'; + etat: string; //'courant'; + nom: string; //'Rapport annuel 2019.pdf'; + siret: string; +}; + +type IDocumentRNA = IDocumentAssociation & { + annee_depot: string; //'2019'; + sous_type: { + code: string; //'STC'; + libelle: string; //'Statuts'; + }; +}; + +type IAssociationDirigeant = { + civilite: string; + nom: string; + prenom: string; + fonction: string; + valideur_cec: boolean; + publication_internet: boolean; + telephone: string; + courriel: string; +}; + +export type IAssociationProtected = { + documents: { + rna: IDocumentRNA[]; + dac: IDocumentDAC[]; + }; + dirigeants: IAssociationDirigeant[]; +}; + +export const getAssociationProtected = async ( + maybeSiren: string +): Promise => { + const siren = verifySiren(maybeSiren); + const response = clientApiEntrepriseAssociation(siren).catch((error) => + handleApiEntrepriseError(error, { + siren, + apiResource: 'AssociationProtected', + }) + ); + + return response; +}; diff --git a/models/user/rights.ts b/models/user/rights.ts index 976d7e975..c557e536b 100644 --- a/models/user/rights.ts +++ b/models/user/rights.ts @@ -7,6 +7,7 @@ export enum EScope { documentsRne = 'rne', conformite = 'conformite', protectedCertificats = 'opendata', + associationProtected = 'opendata', mandatairesRCS = 'opendata', carteProfessionnelleTravauxPublics = 'opendata', nonDiffusible = 'nonDiffusible',