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

# Entity

## Purpose
Doctrine ORM entities modelling the domain: users (admin/client), addresses, products, orders, order lines, deliveries, payments, and visit statistics. Entities are excluded from service autoregistration.

## Key Files
| File | Description |
|------|-------------|
| `Admin.php` | Back-office admin account; uses `AdminStatus` enum |
| `Client.php` | Customer account (auth identity for the store); uses `UserStatus` enum; relates to addresses, orders |
| `Adresse.php` | Postal address linked to a client |
| `Produit.php` | Product. Dual status system (`ProductState` internal + `ProductStateShop` shop-facing), `ProductType`/`ProductVariante`, relation to `TypeCouteau`, home-page priority flag |
| `TypeCouteau.php` | Knife type/category referenced by products |
| `Commande.php` | Order; `CommandeState` lifecycle, `PaymentCommandeStatus`; links client, product lines, delivery, payment |
| `ProductCommande.php` | Order line item (product ↔ order join with quantity/price snapshot) |
| `Livraison.php` | Delivery/shipping; `LivraisonType`, `LivraisonVisibility` enums |
| `Payment.php` | Payment record modelled on PayPal order/capture (order id, capture id, status) |
| `AnalyticsHit.php` / `AnalyticsDaily.php` | Cookieless audience measurement — raw hits (90-day retention) + daily aggregates. See `src/Service/Analytics/` |

## For AI Agents

### Working In This Directory
- **Never edit the database schema by hand.** Change the entity, then `php bin/console make:migration` and review the diff.
- Status/type columns are backed **enums** from `src/Enum/` (Doctrine `enumType`) — add new states there, not as raw strings.
- `Produit` has two distinct status axes (internal state vs. shop visibility); keep them separate when adding logic.
- Prices/amounts: check the existing column types before adding money fields (snapshot amounts live on `ProductCommande`/`Commande`).

### Common Patterns
- `#[ORM\Entity(repositoryClass: ...Repository::class)]`, typed properties, fluent getters/setters.
- Enum-typed columns via `#[ORM\Column(enumType: SomeEnum::class)]`.

## Dependencies

### Internal
- `src/Enum/` for status/type values; `src/Repository/` for queries.

### External
- Doctrine ORM 3 attributes.

<!-- MANUAL: -->
