# Campaign Segment ES Queries (v1)

Source of truth:
- Service: `app/Services/Elasticsearch/CampaignSegmentElasticsearchService.php`
- Controller: `app/Http/Controllers/CampaignSegmentController.php`
- Index: `customer_subscription_v1`

## ES-backed service methods
- `fetchSegmentData(int $appId, string $status, string $period, ?string $packageId, int $start, int $length, int $orderColumnIndex, string $sortDir)`

## API endpoint
- `GET /campaign-segment`

## Notes
- Customer id is normalized from available roots/order-level sources before response mapping.
- Segment status filters are built in service, including date-window filters.
