Skip to content

refactor: block organization affiliation when segment name matches (CM-774)#3782

Merged
skwowet merged 13 commits intomainfrom
improve/CM-774-auto-block-org
Jan 27, 2026
Merged

refactor: block organization affiliation when segment name matches (CM-774)#3782
skwowet merged 13 commits intomainfrom
improve/CM-774-auto-block-org

Conversation

@skwowet
Copy link
Member

@skwowet skwowet commented Jan 26, 2026

Changes

When creating a new segment (project/subproject/project group):

  • Check if any organizations exist with the same name
  • Block affiliations for matching organizations

When creating a new organization:

  • Check if any segments exist with the same name
  • Block affiliations if a match is found

Note

Implements automatic affiliation blocking when organization and segment names match, and centralizes org update sync/recalc triggers.

  • When creating organizations, checks for a segment with the same displayName; sets isAffiliationBlocked and proceeds with normal creation and identity upsert; kicks off organizationUpdate workflow with optional OpenSearch sync
  • When creating project groups/projects/subprojects, finds organizations with the same name; sets isAffiliationBlocked, applies member affiliation policy, commits, then triggers organizationUpdate workflow per affected org to recalc affiliations and sync
  • Adds isAffiliationBlocked to org DB field lists and queries; updates DAL to include findOrganizationsByName (case/trim match), findSegmentByName, and makes updateOrganization return updated id
  • Refactors Temporal workflow invocation into startOrganizationUpdateWorkflow and replaces direct calls in create/update paths

Written by Cursor Bugbot for commit fdac630. This will update automatically on new commits. Configure here.

@skwowet skwowet self-assigned this Jan 26, 2026
@skwowet skwowet requested a review from ulemons January 26, 2026 14:10
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@skwowet skwowet merged commit 0b6eac9 into main Jan 27, 2026
15 checks passed
@skwowet skwowet deleted the improve/CM-774-auto-block-org branch January 27, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants