# GetAccount

## Overview

GetAccount retrieves an account by id or by company-scoped code.

## Business Rules

- Lookup by `id` returns the matching account regardless of status
- Lookup by `companyId` and `code` returns the matching account within that company
- Returns null when no account matches

## Process Flow

```mermaid
flowchart TD
    A[Receive lookup request] --> B{Lookup by id?}
    B -->|Yes| C[Query Account by id]
    B -->|No| D[Query Account by company and code]
    C --> E[Return account or null]
    D --> E
```

## External Dependencies

- None

## Error Scenarios

- None

## Test Cases

- returns account when found by id
- returns null when account not found by id
- returns account when found by company-scoped code
- returns null when account not found by company-scoped code
