Skip to content

♻️ Migrating join organization to @proconnect-gouv/proconnect.identite#1729

Draft
douglasduteil wants to merge 12 commits into
mainfrom
douglasduteil/start-migrating-join-organization
Draft

♻️ Migrating join organization to @proconnect-gouv/proconnect.identite#1729
douglasduteil wants to merge 12 commits into
mainfrom
douglasduteil/start-migrating-join-organization

Conversation

@douglasduteil

Copy link
Copy Markdown
Contributor

No description provided.

Migrate isSmallAssociation from src/services/organization.ts to the
packages/identite vertical slice and integrate it into joinOrganization.
@douglasduteil douglasduteil force-pushed the douglasduteil/start-migrating-join-organization branch from 1e34f54 to c430af9 Compare January 30, 2026 21:30
- Add isEtablissementScolaireDuPremierEtSecondDegre
- Add isEducationNationaleDomain
- Add isArmeeDomain
- Add isWasteManagementOrganization
- Update imports in join.ts and official-contact-email-verification.ts
- Simplify src/services/organization.ts to re-export from packages/identite
@douglasduteil douglasduteil force-pushed the douglasduteil/start-migrating-join-organization branch from 8e1032c to c88e0c6 Compare January 30, 2026 21:48
Apply dependency rejection pattern to join-organization flow:
- Pure function takes JoinContext, returns JoinDecision discriminated union
- Orchestrator gathers data, calls pure function, executes side effects
- 24 tests covering all decision paths without mocking
- Extract domain lookup once instead of repeated .some() calls
- Add helper functions link() and error() for cleaner returns
- Consolidate commune/school logic into tryOfficialContactVerification()
- Rename context fields for clarity (isContactDomainFree, isContactEmailSameDomain)
- Keep switch for error mapping (explicit and type-safe)
The gouv.fr domain check must happen before entreprise unipersonnelle
and small association checks, otherwise users with gouv.fr emails can
join private organizations that should reject them.
- test/organization.test.ts: tests now live in packages/identite
- src/services/organization.ts: unused re-export shim
- Update oidc-account-adapter to import directly from identite package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant