# Application Amendes Football — Ligue de Martinique

Gestion et paiement des amendes disciplinaires (CRED) via Stripe.

## Stack
- Symfony 7.2 · PHP 8.3 · MySQL 8 · Stripe · PhpSpreadsheet · DomPDF

## Installation locale (dev)

```bash
# 1. Dépendances
composer install
npm install

# 2. Base de données
cp .env .env.local
# Éditer DATABASE_URL, STRIPE_*

php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load   # données de test

# 3. Assets
npm run watch

# 4. Serveur
symfony server:start
```

**Comptes de test :**
| Email | Mot de passe | Rôle |
|-------|-------------|------|
| admin@ligue-martinique.fff.fr | Admin@2026! | Admin |
| basse-pointe@club.test | Club@2026! | Club |
| marin@club.test | Club@2026! | Club |

## Structure

```
src/
├── Controller/
│   ├── Admin/        DashboardController, ImportController, ClubController
│   ├── Club/         DashboardController (paiements Stripe)
│   ├── PublicController     (suspendus inter-clubs)
│   ├── SecurityController   (login/logout)
│   └── StripeWebhookController
├── Entity/           Club, Amende, Paiement, ImportLog
├── Repository/       AmendeRepository, ClubRepository
├── Service/          ExcelImportService, StripeService, PdfReceiptService
├── Command/          CheckSuspensionsCommand, CreateAdminCommand
├── Form/             ClubType
├── Security/         ClubAuthenticator
├── EventSubscriber/  ClubActiveSubscriber
└── Twig/             StripeExtension
```

## Commandes utiles

```bash
# Vérifier les suspensions (à lancer en cron quotidien 8h00)
php bin/console app:check-suspensions

# Simulation sans envoi email
php bin/console app:check-suspensions --dry-run

# Créer un admin
php bin/console app:create-admin --email=admin@exemple.fr --password=MonMotDePasse!
```

## Déploiement OVH

Voir `deploy/GUIDE-DEPLOIEMENT-OVH.md`

```bash
# 1. Serveur (une seule fois)
sudo bash deploy/01-install-server.sh

# 2. Code (à chaque mise à jour)
bash deploy/02-deploy-app.sh

# 3. HTTPS (une seule fois, après DNS)
sudo bash deploy/03-activate-https.sh votre-domaine.fr
```
