# Instructions de Commit et Push - Modules Crew Members & Attelages ## 📩 Fichiers Ă  commiter (Backend API) ### Fichiers essentiels (Ă  commiter) ```bash cd D:\dev\parcapp\api # Migrations git add database/migrations/2025_12_30_230602_create_crew_members_table.php git add database/migrations/2025_12_30_234226_create_vehicle_trailer_couplings_table.php # Models git add app/Models/CrewMember.php git add app/Models/Coupling.php # Controllers git add app/Http/Controllers/CrewMemberController.php git add app/Http/Controllers/CouplingController.php # FormRequests git add app/Http/Requests/CrewMemberStoreRequest.php git add app/Http/Requests/CrewMemberUpdateRequest.php git add app/Http/Requests/CouplingStoreRequest.php git add app/Http/Requests/CouplingUpdateRequest.php # Resources git add app/Http/Resources/CrewMemberResource.php git add app/Http/Resources/CouplingResource.php # Routes git add routes/api.php ``` ### Fichiers optionnels (documentation - peut ĂȘtre ignorĂ©) Les fichiers `.md` de documentation peuvent ĂȘtre ajoutĂ©s ou ignorĂ©s selon votre prĂ©fĂ©rence : - `COUPLINGS_*.md` - `CREW_MEMBERS_*.md` - `DEPLOYMENT_CHECKLIST.md` - `TEST_LOCAL_*.md` - `test-*.ps1`, `test-*.sh` --- ## 📝 Message de commit recommandĂ© ```bash git commit -m "feat: Ajout modules Crew Members et Attelages (Couplings) - Module Crew Members: CRUD complet + upload photo - Migration: create_crew_members_table - Endpoints: GET/POST/PATCH/DELETE /api/crew-members - Upload: POST /api/upload/crew-member-photo - Module Attelages: CRUD complet avec relations N:M - Migration: create_vehicle_trailer_couplings_table (2 tables) - Endpoints: GET/POST/PATCH /api/couplings - Route corrigĂ©e: GET /api/couplings/vehicle/{vehicleId} (Ă©vite collision) - Transactions atomiques avec lockForUpdate() (protection race conditions) - Format API: camelCase, dates ISO 8601, URLs absolues via MediaUrl - Compatible MySQL/MariaDB shared hosting" ``` --- ## 🚀 Push vers GitHub ```bash git push origin main ``` --- ## 📁 Fichiers Frontend Ă  commiter (si repo sĂ©parĂ©) Si le frontend est dans un repo Git sĂ©parĂ© : ```bash cd D:\dev\parcapp\frontend git add src/lib/api/couplings.ts git add src/hooks/useCouplings.ts git commit -m "fix: Adaptation frontend pour route couplings corrigĂ©e - fetchCouplingByVehicle: URL corrigĂ©e /api/couplings/vehicle/{vehicleId} - useCouplingByVehicle: queryKey mise Ă  jour" git push origin main ``` --- ## 🔄 DĂ©ploiement Production (aprĂšs push) ### Sur le serveur Bluehost ```bash # 1. Pull depuis GitHub git pull origin main # 2. Migration (--force obligatoire en production) php artisan migrate --force # 3. Clear caches php artisan config:clear php artisan route:clear php artisan cache:clear # 4. VĂ©rifier les routes php artisan route:list | grep -E "(crew-members|couplings)" ``` ### VĂ©rifications 1. **Tables créées** : - `crew_members` - `vehicle_trailer_couplings` - `coupling_apprentis` 2. **Routes enregistrĂ©es** : - `/api/crew-members` (5 routes) - `/api/couplings` (5 routes) - `/api/upload/crew-member-photo` 3. **Tests API** : - CrĂ©er un membre d'Ă©quipage - CrĂ©er un attelage - Voir l'attelage actif d'un vĂ©hicule - DĂ©tacher un attelage --- **Document gĂ©nĂ©rĂ© le** : 2025-12-30