# GetPurchaseRequisition

## Overview

GetPurchaseRequisition retrieves a single purchase requisition with its lines, requester context, and estimated cost totals.

## Business Rules

- Accepts lookup by `{ id }`
- Returns purchase requisitions in any `status` so cancelled, converted, and closed documents remain auditable
- Response includes `status` reflecting the current lifecycle state (DRAFT, SUBMITTED, APPROVED, CONVERTED, CANCELLED, CLOSED)
- Response includes requester, justification, and desired delivery date when present
- Response includes line-level item, description, quantity, estimated unit price, and suggested supplier
- Response includes estimated total amount per line and for the requisition
- Returns null when no purchase requisition matches the lookup

## Process Flow

```mermaid
flowchart TD
    A[Receive lookup input] --> B[Select PurchaseRequisition by id]
    B --> C{Requisition found?}
    C -->|Yes| D[Load lines, requester context, and computed totals]
    C -->|No| E[Return null]
    D --> F[Return purchase requisition]
```

## External Dependencies

- None

## Error Scenarios

- **PURCHASE_REQUISITION_NOT_FOUND**: Referenced purchase requisition does not exist

## Test Cases

- returns purchase requisition when found by id
- returns lines and estimated totals with the requisition
- returns suggested supplier on lines when present
- returns null when purchase requisition is not found
