# GetWorker

## Overview

Retrieves a single Worker by its id, returning the person's HR identity record — worker code — independent of any specific employment period.

## Business Rules

- Returns the Worker exactly as stored; Worker holds only period-invariant personal attributes, never time-varying attributes such as employment type or organizational assignment
- `workerCode` is returned as the stable, human-facing identifier that is independent of the linked User's login identity

## Process Flow

```mermaid
flowchart TD
    A[Caller requests Worker by id] --> B{Worker exists?}
    B -- No --> C[Reject: WORKER_NOT_FOUND]
    B -- Yes --> D[Return Worker: workerCode, userId]
```

## External Dependencies

- [workforce::Worker](../model/Worker.md) model — entity being queried

## Error Scenarios

- **WORKER_NOT_FOUND**: the specified Worker does not exist

## Test Cases

- returns the Worker when found by id
- returns NOT_FOUND when the id does not exist
- a returned Worker includes its workerCode and userId
