# GetProfitCenter

## Overview

GetProfitCenter retrieves a single profit center record by id, returning all fields including code, name, description, status (DRAFT, ACTIVE, INACTIVE), responsible person, validity period (valid-from/to), company reference, and hierarchy node assignment. This is the primary query for viewing profit center details, validating profit center configuration, and supporting transaction tagging and profitability reporting workflows.

## Business Rules

- Accepts a single lookup parameter: `{ id }`
- Returns the full profit center record including all master data fields
- Includes the hierarchy node assignment within the profit center hierarchy
- Returns null if no matching profit center is found
- Lookup is an exact match on id

## Process Flow

```mermaid
flowchart TD
    A[Receive input with id] --> B[SELECT from ProfitCenter where id = input.id]
    B --> C{Profit center found?}
    C -->|Yes| D[Return profit center with all fields]
    C -->|No| E[Return null]
```

## External Dependencies

- None

## Error Scenarios

- **PROFIT_CENTER_NOT_FOUND**: Profit center with the specified ID does not exist

## Test Cases

- returns profit center with all fields when found by id
- returns profit center with hierarchy node assignment populated
- returns profit center with responsible person and validity period
- returns null when no profit center matches the given id
