# GetLeaveGrant

## Overview

Retrieves a single LeaveGrant ledger record by id — its type, source, granted/remaining days, validity window, and expiration status — for detail views and audit lookups.

## Business Rules

- Returns the grant matching the given id regardless of whether it is expired, partially consumed, or untouched
- Returns the raw ledger fields as stored (`grantedDays`, `remainingDays`, `grantedDate`, `expirationDate`, `expiredAt`) — it does not compute an aggregate balance; use `getLeaveBalance` for that
- Does not filter by worker, leave type, or validity window — this is a direct id lookup

## Process Flow

```mermaid
flowchart TD
    A[Caller requests LeaveGrant by id] --> B{Grant with matching id exists?}
    B -- No --> C[Reject: LEAVE_GRANT_NOT_FOUND]
    B -- Yes --> D[Return the grant record]
```

## External Dependencies

- [leave-management::LeaveGrant](../model/LeaveGrant.md) model — entity being queried
- [workforce::Worker](../../../workforce/docs/model/Worker.md) model — referenced by the grant's `workerId`

## Error Scenarios

- **LEAVE_GRANT_NOT_FOUND**: no LeaveGrant exists with the given id

## Test Cases

- returns the grant when found by id
- returns an expired grant with expiredAt set, not just active grants
- returns LEAVE_GRANT_NOT_FOUND for a non-existent id
