<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-07-02 | Updated: 2026-07-02 -->

# Repository

## Purpose
Doctrine repositories, one per entity. Hold custom query methods (finders, filtered/paginated product and order queries, statistics aggregations).

## Key Files
| File | Entity |
|------|--------|
| `AdminRepository.php` | `Admin` |
| `ClientRepository.php` | `Client` |
| `AdresseRepository.php` | `Adresse` |
| `ProduitRepository.php` | `Produit` (listing filters, home selection) |
| `TypeCouteauRepository.php` | `TypeCouteau` |
| `CommandeRepository.php` | `Commande` (order lookups, stats) |
| `ProductCommandeRepository.php` | `ProductCommande` (order lines) |
| `LivraisonRepository.php` | `Livraison` |
| `PaymentRepository.php` | `Payment` |
| `AnalyticsHitRepository.php` / `AnalyticsDailyRepository.php` | Cookieless audience measurement |

## For AI Agents

### Working In This Directory
- Each extends `ServiceEntityRepository` and is injected into controllers via autowiring.
- Add custom queries as methods here; use the QueryBuilder and return typed entities/arrays.
- Pagination in list views uses `knplabs/knp-paginator-bundle` — the paginator is applied in the controller over a repository query/QueryBuilder.
- Audience statistics are computed in `src/Service/Analytics/AnalyticsQueryService.php` (raw SQL over `analytics_hit` / `analytics_daily`), not in a repository.

## Dependencies

### Internal
- Bound to `src/Entity/`; called from `src/Controller/`.

### External
- Doctrine ORM 3, KnpPaginatorBundle.

<!-- MANUAL: -->
