pub async fn hand_over(
pool: &PgPool,
actor: &Actor,
from: Uuid,
to: Uuid,
) -> AppResult<HandoverReport>Expand description
Moves the work of from to to.
ยงInvariants
- Permission: administrator (403).
fromandtodiffer;tois an active CAD editor or administrator (400).frommay be deactivated (the usual case). - Locks: both user rows, then every moved item, change and request
(
FOR UPDATE). - Moves: items owned by
from; changes authored byfromthat are drafts or rejected; change requests assigned tofromthat are not closed; pending reviews offromon changes in draft or in review. Objectstomay not own or review (cannot read them, already a reviewer, or four-eyes conflict) stay withfromand are listed as skipped with the reason. - Audit: one entry per moved object (
item.owner,change.handover,change_request.handover,change.review_handover) and oneuser.handoverwith the counts. - Notifications / webhooks: none.
- Atomic: one transaction.