# GetCalculatedBlock

## Overview

Retrieves a single `CalculatedTimeBlock` by its id. Used when a caller already has a specific calculated block id — for example when following `sourceReportedBlockIds`/`calculationTagKeys` traceability links back from a payroll or Article-36 agreement read, or when drilling into one block from a list result.

## Business Rules

- Returns the block regardless of whether it is the current calculation for its Assignment/workDate, since a CalculatedTimeBlock is never mutated in place — recalculation replaces the set of blocks for a period rather than editing a row
- `minutes` is returned as a non-negative integer (no float hours)
- `timeEntryCodeKey`, `payCodeKey`, and `calculationTagKeys` are returned by stable key, never by display name
- `sourceReportedBlockIds` is returned so the caller can reconstruct the derivation for audit

## Process Flow

```mermaid
flowchart TD
    A[Caller supplies calculatedBlockId] --> B{Block exists?}
    B -- No --> C[Return CALCULATED_BLOCK_NOT_FOUND]
    B -- Yes --> D[Return CalculatedTimeBlock with minutes, keys, calculationTagKeys, sourceReportedBlockIds]
```

## External Dependencies

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

## Error Scenarios

- **CALCULATED_BLOCK_NOT_FOUND**: no CalculatedTimeBlock exists with the supplied id

## Test Cases

- returns the calculated block when found by id, including minutes, timeEntryCodeKey, payCodeKey, and calculationTagKeys
- returns CALCULATED_BLOCK_NOT_FOUND when the id does not exist
- returned minutes value is an integer
- returned sourceReportedBlockIds references only current (non-superseded) reported blocks
