# GetPeriodClose

## Overview

GetPeriodClose retrieves the PeriodClose record for a given accounting period. The PeriodClose record tracks the close workflow status, checklist completion percentage, the user who initiated each step, and timestamps for each state transition. This query supports period-end close workflow management, status monitoring, and audit review of the close process.

## Business Rules

- Accepts a single lookup parameter: `{ accountingPeriodId }`
- Returns the full PeriodClose record including close status, completionPercentage, initiator userId, step timestamps, and audit metadata
- Each accounting period has at most one PeriodClose record
- Returns null if no close record exists for the given accounting period (i.e., close has not been initiated)
- Lookup is an exact match on accountingPeriodId

## Process Flow

```mermaid
flowchart TD
    A[Receive input with accountingPeriodId] --> B[SELECT from PeriodClose where accountingPeriodId = input.accountingPeriodId]
    B --> C{PeriodClose record found?}
    C -->|Yes| D[Return PeriodClose record]
    C -->|No| E[Return null]
```

## External Dependencies

- None

## Error Scenarios

- **PERIOD_CLOSE_NOT_FOUND**: No PeriodClose record exists for the given accounting period — caller receives null

## Test Cases

- returns period close when found by accounting period id
- returns null when not found
