Aller au contenu

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 contractguidelines/integrations/overview.md (placeholder).
  • Entity domain model (legal entities, ownership structure, consolidation) → docs/entity-model.md and apps/entities/ (reference).
  • FHIR API for practitioners (RPPS / ADELI) — separate concern; currently in apps/sync/ and apps/annuaire/ mixed. May warrant its own guidelines/integrations/fhir-rpps.md later.
  • Doctolib practitioner syncguidelines/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.mdreference_inpi_data_dictionary.md). Code→label mappings for roleEntreprise, 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.md and annuaire-api-display-fallback.md and annuaire-finess-enrichment.md — the active annuaire backlog; document what's done vs pending.

Starter hard rules to investigate

  1. SIREN/SIRET validation before lookup: client-side regex validates format; INPI lookup only happens on valid input.
  2. Code→label mappings cached locally: never round-trip to INPI for a formeJuridique label that's already in the dictionary.
  3. Refresh cadence is bounded: same SIREN isn't re-fetched more than 1×/day (or whatever the rule is — verify).
  4. Restructure detection (same SIRET, different role/form) is flagged for human review, not silently overwritten — see annuaire-restructure-detection backlog.
  5. API-display fallback when local NOS constants miss a code — see annuaire-api-display-fallback backlog.

Decision points to settle

  1. Cache invalidation strategy: TTL? Manual flush? Trigger on entity update?
  2. What triggers a re-lookup: user clicks refresh, beat schedule, on-demand at create-time?
  3. FINESS enrichment scope (per annuaire-finess-enrichment backlog) — overlap with this guideline?
  4. CDS chains detection — how to tell two centres are part of the same chain (overlaps with INPI roleEntreprise + practice grouping)?
  5. 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.