# GetCurrency

## Overview

GetCurrency retrieves a single currency by its unique identifier or ISO 4217 code. Returns the currency record if found, or null if no matching currency exists.

This function supports currency validation and lookup operations across all modules that reference currencies.

## Business Rules

- Lookup by `id` performs an exact UUID match
- Lookup by `code` performs an exact string match against ISO 4217 codes (e.g., "USD", "EUR", "JPY")
- Returns the full currency record including status, decimal places, and base currency flag
- Does not filter by active status - returns both active and inactive currencies
- Exactly one lookup key must be provided (id or code)

## Process Flow

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

## External Dependencies

- None

## Error Scenarios

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

## Test Cases

- returns currency when found
- returns null when currency not found
- returns currency when found
- returns null when currency not found
