♻️ Migrating join organization to @proconnect-gouv/proconnect.identite#1729
Draft
douglasduteil wants to merge 12 commits into
Draft
♻️ Migrating join organization to @proconnect-gouv/proconnect.identite#1729douglasduteil wants to merge 12 commits into
douglasduteil wants to merge 12 commits into
Conversation
Migrate isSmallAssociation from src/services/organization.ts to the packages/identite vertical slice and integrate it into joinOrganization.
1e34f54 to
c430af9
Compare
- 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
8e1032c to
c88e0c6
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.