INPI integration¶
Status: Placeholder — to be developed. Last reviewed: — Reference structural sibling:
guidelines/i18n/translation-rules.md(rule + workflow style).
Scope (when this guideline lands)¶
INPI RNE (Registre National des Entreprises) integration via apps/annuaire/: how SIREN/SIRET lookups work, code→label mappings (roleEntreprise, formeJuridique, etc. — see the data dictionary referenced in MEMORY.md), refresh cadence, what gets cached locally, how legal entities surface to apps/entities/.
Out of scope (cross-refs)¶
- Shared connector contract →
guidelines/integrations/overview.md(placeholder). - Entity domain model (legal entities, ownership structure, consolidation) →
docs/entity-model.mdandapps/entities/(reference). - FHIR API for practitioners (RPPS / ADELI) — separate concern; currently in
apps/sync/andapps/annuaire/mixed. May warrant its ownguidelines/integrations/fhir-rpps.mdlater. - Doctolib practitioner sync →
guidelines/integrations/doctolib.md(placeholder).
Sources to mine when writing this¶
apps/annuaire/— INPI client and data ingestion. Models (Practitioner,Organization,Movement), services, tasks.- The INPI data dictionary Excel (referenced in
MEMORY.md—reference_inpi_data_dictionary.md). Code→label mappings forroleEntreprise,formeJuridique, etc. apps/entities/— how INPI data flows into the entity model.roadmap/done/captable-improvements.md— captable-side changes that consume entity data from INPI.roadmap/backlog/annuaire-restructure-detection.mdandannuaire-api-display-fallback.mdandannuaire-finess-enrichment.md— the active annuaire backlog; document what's done vs pending.
Starter hard rules to investigate¶
- SIREN/SIRET validation before lookup: client-side regex validates format; INPI lookup only happens on valid input.
- Code→label mappings cached locally: never round-trip to INPI for a
formeJuridiquelabel that's already in the dictionary. - Refresh cadence is bounded: same SIREN isn't re-fetched more than 1×/day (or whatever the rule is — verify).
- Restructure detection (same SIRET, different role/form) is flagged for human review, not silently overwritten — see
annuaire-restructure-detectionbacklog. - API-display fallback when local NOS constants miss a code — see
annuaire-api-display-fallbackbacklog.
Decision points to settle¶
- Cache invalidation strategy: TTL? Manual flush? Trigger on entity update?
- What triggers a re-lookup: user clicks refresh, beat schedule, on-demand at create-time?
- FINESS enrichment scope (per
annuaire-finess-enrichmentbacklog) — overlap with this guideline? - CDS chains detection — how to tell two centres are part of the same chain (overlaps with INPI roleEntreprise + practice grouping)?
- Closed establishments: when INPI marks a SIREN as
cessation, what does Aletheia do to the corresponding entity?
Known deviations to look for during writing¶
- INPI lookups without SIREN format validation (wasted API call + error noise).
- Stale cached labels with no refresh path.
- Lookup failures handled with
try: … except: pass(silent quarantine). - Direct API calls in views (should be in tasks).
If found, file as roadmap/backlog/integrations-inpi-drift-2026-MM.md.