# GetTimeEntryCode

## Overview

GetTimeEntryCode retrieves a single `TimeEntryCode` catalog entry by its surrogate id, returning the stable `key`, `category`, `displayName`, and `payMapKey`.

## Business Rules

- Resolves by the surrogate `id`, not by `key` — use `getTimeEntryCodeByKey` to resolve by the stable business key instead
- `key` is returned as the immutable, stable identifier; `displayName` is UI-only and carries no calculation semantics
- `TimeEntryCode` is master data, not effective-dated — there is no `asOf` history to resolve; the catalog entry returned is the current record, corrected in place if renamed

## Process Flow

```mermaid
flowchart TD
    A[Caller provides TimeEntryCode id] --> B[Look up record by id]
    B --> C{Found?}
    C -- Yes --> D[Return TimeEntryCode: key, category, displayName, payMapKey]
    C -- No --> E[Return TIME_ENTRY_CODE_NOT_FOUND]
```

## External Dependencies

- [time-tracking::TimeEntryCode](../model/TimeEntryCode.md) model — entity being queried

## Error Scenarios

- **TIME_ENTRY_CODE_NOT_FOUND**: no TimeEntryCode exists for the given id
- **VALIDATION_ERROR**: the supplied input is malformed, out of range, or references an unrecognized enum value

## Test Cases

- returns the TimeEntryCode when found by id
- returns TIME_ENTRY_CODE_NOT_FOUND when no record matches the id
- renaming `displayName` leaves the `key` and all calculation results unchanged
