# GetAssignment

## Overview

Retrieves a single Assignment generation by its id, returning the effective-dated placement of a WorkerEmployment into a Position, including the effective range and primary/non-primary flag.

## Business Rules

- Returns the Assignment generation exactly as stored, including `effectiveStart`, `effectiveEnd` (nullable), `versionOf`, and the `isPrimary` flag
- Does not resolve "as of" a date — this query returns one specific generation by id
- Returned Assignment always references exactly one WorkerEmployment and exactly one Position

## Process Flow

```mermaid
flowchart TD
    A[Caller requests assignment by id] --> B{Generation exists?}
    B -- No --> C[Reject: ASSIGNMENT_NOT_FOUND]
    B -- Yes --> D[Return Assignment: effectiveStart, effectiveEnd, versionOf, isPrimary, WorkerEmployment, Position]
```

## External Dependencies

- [workforce::Assignment](../model/Assignment.md) model — entity being queried
- [workforce::Position](../model/Position.md) model — referenced by the assignment's `positionId`

## Error Scenarios

- **ASSIGNMENT_NOT_FOUND**: the specified Assignment does not exist

## Test Cases

- returns the assignment generation when found by id
- returns NOT_FOUND when the id does not exist
- a returned assignment includes its effectiveStart, effectiveEnd, and versionOf
- a returned concurrent assignment reflects isPrimary = false when it is the non-primary post
