# Business Units ES Queries (v1)

Source of truth:
- Service: `app/Services/Elasticsearch/BusinessUnitsElasticsearchService.php`
- Controllers:
  - `app/Http/Controllers/Tax/BusinessUnitController.php`
  - `app/Http/Controllers/Analytics/BusinessUnitsApiController.php`
- Index: `customer_subscription_v1`

## ES-backed service methods
- `fetchBusinessUnitsCurrencyStats(?int $appId)`

## API endpoints
- `GET /admin/business-units/widgets/data`
- `GET /admin/api/system-admin/business-units/list`
- `GET /admin/api/system-admin/business-units/summary`

## Notes
- Subscriber/revenue totals are currency-grouped from ES aggregations.
- Status matching supports v1 nested subscription shape where present.
