Add organization merge and domain health monitoring#502
Merged
Conversation
Implements tools to detect and resolve organization duplicates in the membership system, ensuring every corporate email domain maps to a known organization (member or prospect). New features: - Organization merge tool (mergeOrganizations, previewMerge) in db layer - Addie admin tools: merge_organizations, find_duplicate_orgs, check_domain_health - Domain Health admin page at /admin/domain-health with: - Orphan domains (corporate emails without organizations) - Misaligned users (corporate users in personal workspaces) - Unverified organizations (orgs without verified domains) - Domain conflicts (multiple orgs claiming same domain) - API endpoint at /api/admin/domain-health 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e792ff6 to
c95cf1b
Compare
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.
Summary
/admin/domain-healthfor visualizing domain health issuesmerge_organizations,find_duplicate_orgs,check_domain_healthDetails
This implements tools to detect and resolve organization duplicates in the membership system. The core principle: every corporate email domain should map to a known organization (member or prospect).
New Files
server/src/db/org-merge-db.ts- Core merge logic with transaction safetyserver/public/admin-domain-health.html- Admin UI for domain health monitoringModified Files
server/src/addie/mcp/admin-tools.ts- Added 3 new Addie admin toolsserver/src/routes/admin/domains.ts- Added/api/admin/domain-healthendpointserver/src/routes/admin.ts- Added route for domain health pageserver/public/admin-sidebar.js- Added nav linkDomain Health Categories
Test plan
escapeHtml()andencodeURIComponent()🤖 Generated with Claude Code