-- Insert/update labeler service on actors table (denormalized)
-- Parameters: $1=actor_id, $2=cid(bytea), $3=reasons, $4=subject_types, $5=subject_collections
-- NOTE: actor_id is provided by dispatcher after ensuring actor exists
-- Sets labeler_* columns on actors table instead of separate labelers table
UPDATE actors
SET
    labeler_cid = $2::bytea,
    labeler_created_at = COALESCE(labeler_created_at, NOW()),
    labeler_reasons = $3::text[]::reason_type[],
    labeler_subject_types = $4::text[]::subject_type[],
    labeler_subject_collections = $5,
    labeler_status = 'complete'::labeler_status,
    labeler_like_count = COALESCE(labeler_like_count, 0)
WHERE id = $1
