# GetWorkRuleAssignment

## Overview

GetWorkRuleAssignment retrieves a single `WorkRuleAssignment` generation by its surrogate id, returning the target binding (`targetType` / `targetId`), the referenced `workRuleId`, and effective-dating fields.

## Business Rules

- Resolves a single generation by surrogate `id`; because WorkRuleAssignment is effective-dated (ADR-013), an id identifies exactly one generation, not the whole history for its `versionOf`
- The returned record binds the WorkRule and target by stable identity/enum, never by display name (ADR-015)

## Process Flow

```mermaid
flowchart TD
    A[Caller provides WorkRuleAssignment id] --> B[Look up generation by id]
    B --> C{Found?}
    C -- Yes --> D[Return generation: targetType, targetId, workRuleId, effectiveStart/End]
    C -- No --> E[Return WORK_RULE_ASSIGNMENT_NOT_FOUND]
```

## External Dependencies

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

## Error Scenarios

- **WORK_RULE_ASSIGNMENT_NOT_FOUND**: no WorkRuleAssignment exists for the given id, or no assignment is in force for the relevant target/date
- **VALIDATION_ERROR**: the supplied input is malformed, out of range, or references an unrecognized enum value

## Test Cases

- returns the WorkRuleAssignment generation when found by id
- returns WORK_RULE_ASSIGNMENT_NOT_FOUND when no generation matches the id
