# Performance Management API

The HR performance module provides several REST resources:

- `/api/employees`
- `/api/performance_reviews`
- `/api/performance_goals`
- `/api/feedback_notes`
- `/api/check_ins`

When a specific ID is requested and no matching row exists, these endpoints
return HTTP 200 with an empty array instead of a 404 error. Listing endpoints
also return an empty array when no records are found.

Example:

```bash
$ curl -b cookie.txt http://localhost/api/performance_reviews/999
[]
```

### Exporting Reports

Endpoints under `PerformanceDashboardController`, `AnalyticsController` and
`ReportsController` accept an optional `export` query parameter. Supported
values are `csv`, `pdf` and `xlsx`. When supplied, the response is returned as a
download in the requested format instead of JSON.

Example:

```bash
$ curl -b cookie.txt \
  "http://localhost/api/reports/daily?date=2024-06-01&export=csv" > daily.csv
```

### Goal Alignment Reports

`GET /api/goal_alignment_reports/summary` returns completion rates and counts of misaligned goals. Add `export=pdf` or `export=xlsx` to download.

Example:

```bash
$ curl -b cookie.txt http://localhost/api/goal_alignment_reports/summary
```

### Succession Risk

`GET /api/leadership/succession?employee_id=ID&role_id=ID` evaluates competency gaps and attrition risk for the specified employee.

Example:

```bash
$ curl -b cookie.txt "http://localhost/api/leadership/succession?employee_id=5&role_id=2"
```
