# UpdateTaxonomyNode

## Permission Scope

taxonomy

## Overview

updateTaxonomyNode modifies the display name of an existing taxonomy node. The node can be looked up by `id` or `code`. This supports scenarios such as renaming a classification branch to better reflect its contents or aligning terminology across the organization.

## Business Rules

- Target node must exist in the system (looked up by `id` or `code`)
- Name is required and must not be empty
- Name update does not affect the node's position in the tree, child nodes, or item assignments

## Process Flow

```mermaid
flowchart TD
    A[Receive update request] --> B{Lookup by id or code}
    B -->|Not found| C[Return error: not found]
    B -->|Found| D{Name provided and non-empty?}
    D -->|No| E[Return error: name required]
    D -->|Yes| F[Update node name]
    F --> G[Return updated node]
```

## External Dependencies

- None

## Error Scenarios

- **NODE_NOT_FOUND**: Specified taxonomy node ID does not exist
- **MISSING_REQUIRED_FIELDS**: Name not provided or empty

## Test Cases

- returns error when node does not exist
- returns error when name is empty
- returns error when name is not provided
- updates node name
- looks up node by code and updates name
- passes custom fields through to set
