Bulk reassign
Reusable per-affected-branch reassignment partial used wherever a partner user
is about to lose access to one or more branches — disabling a user, removing
branch access during membership edit, or disabling an entire branch. Backed
by QuoteReassignmentPlanner.
Partial
Pages/Shared/_ReassignReferrerStep.cshtml takes a
ReassignReferrerStepModel with one entry per affected branch.
Each entry shows the open quote count, an Alpine dropdown of replacement
referrers (others with access to that branch), and a "Skip — leave as
<name>" option. The empty-state message renders when nobody else has
access to the branch.
Two-step OnPost
Pages embed the partial conditionally: first POST builds the plan and
re-renders, second POST (with ConfirmedReassignment=true and
binding for Reassignments[]) applies the change inside a
database transaction:
BeginTransaction RestrictToBranches / GrantAllBranchesAccess ApplyAsync (per-branch SQL update + per-branch QuoteReferrerReassignedBulk activity) membership activity SaveChangesAsync Commit
Skip semantics
Skipped quotes keep their original referrer. The §7 read-path union on the partner-area Quotes / Transactions / ViewQuote / ViewTransaction pages ensures the original referrer can still see those quotes after their access is revoked — they just can't access new quotes on that branch.
Used by
EditPartnerMembership+EditMembership— when removing branches from a userListTeam.OnPostDisable— disable user = revoke everywhereDisableBranch(conveyancing + partner area) — disabling a branch