# GetUnit

## Overview

GetUnit retrieves a single unit of measure by its unique identifier or symbol. Returns the unit record if found, or null if no matching unit exists.

This function supports unit validation and lookup operations across all modules that reference units of measure.

## Business Rules

- Lookup by `id` performs an exact UUID match
- Lookup by `symbol` performs an exact string match (e.g., "kg", "lb", "g")
- Returns the full unit record including status, conversion factor, and rounding precision
- Does not filter by active status - returns both active and inactive units
- Exactly one lookup key must be provided (id or symbol)

## Process Flow

```mermaid
flowchart TD
    A[Receive lookup request] --> B{Lookup by id or symbol?}
    B -->|id| C[Query Unit by id]
    B -->|symbol| D[Query Unit by symbol]
    C --> E{Found?}
    D --> E
    E -->|Yes| F[Return unit]
    E -->|No| G[Return null]
```

## External Dependencies

- None

## Error Scenarios

- None (returns null when not found instead of throwing)

## Test Cases

- returns unit when found
- returns null when unit not found
- returns unit when found
- returns null when unit not found
