docs(adr-0026): person + user portal-side data model (proposed) #213

Merged
julien merged 1 commits from docs/adr-0026-person-user-schema-proposed into main 2026-05-24 02:19:30 +02:00

1 Commits

Author SHA1 Message Date
Julien Gautier 7a4ebe75ea docs(adr-0026): person + user portal-side data model (proposed)
CI / commits (pull_request) Successful in 2m36s
CI / check (pull_request) Successful in 2m46s
CI / scan (pull_request) Successful in 2m56s
CI / a11y (pull_request) Successful in 3m23s
Docs site / build (pull_request) Successful in 3m27s
CI / perf (pull_request) Successful in 6m17s
ADR-0025 left several anchors as proposed-follow-up:
- Principal.user.id / personId carry the Entra oid as a placeholder.
- StubScopeResolver returns unrestricted for everyone.
- @RequireScope's ScopableResource shape references an
  Etablissement / Delegation / Region chain that has no table.

ADR-0026 specifies the portal-side data model that closes those
stubs without dragging the upstream Pléiades / Acteurs+ syncs into
scope:

- Person golden record (stable identity; lazy-created on first
  sign-in in v1, source-stamped 'self-signin' for traceability).
- User overlay (one-to-zero-or-one with Person; portal-only state
  like lastSignInAt rides here, not on the shared Person row).
- UserScope migration confirming the ADR-0025 §"Sources of truth"
  shape.
- Region / Delegation / Etablissement hierarchy with
  externally-meaningful codes (INSEE / dept / FINESS) as primary
  keys, matching scope literals' on-the-wire shape.

Facet schemas (Salarié / Élu / Adhérent / Bénéficiaire) are
deferred to ADR-0027 alongside the Pléiades and Acteurs+ sync
that populates them - keeping the v1 migration small enough to
land + roll back cleanly.

Status: proposed. Implementation lands in two PRs once accepted:
the schema + lazy provisioner, then the PrismaScopeResolver +
admin-UI scope-seeding screen + test-tenant seed for the 19
personas.

Index updated.
2026-05-24 02:10:40 +02:00