diff --git a/docs/23_LISTE-TICKETS.md b/docs/23_LISTE-TICKETS.md index 35569d6..0350cd3 100644 --- a/docs/23_LISTE-TICKETS.md +++ b/docs/23_LISTE-TICKETS.md @@ -33,6 +33,31 @@ Correspondance entre les numéros d’issues Gitea et les tickets de ce document --- +## 🔗 Liste des tickets Gitea + +Correspondance entre les numéros d’issues Gitea et les tickets de ce document. + +| Gitea # | Titre court | Priorité | Statut | Section doc | +|--------|--------------|----------|--------|-------------| +| 1 | BDD - Champs manquants CDC | P0 | Ouvert | § Ticket #1 | +| 2 | BDD - Table présentation dossier parent | P0 | Ouvert | § Ticket #2 | +| 3 | BDD - Tokens création MDP | P0 | ✅ Fermé | § Ticket #3 | +| 4 | BDD - Champ genre enfants | P0 | ✅ Fermé | § Ticket #4 | +| 5 | BDD - Supprimer champs obsolètes | P0 | Ouvert | § Ticket #5 | +| 6 | BDD - Table configuration système | P0 | Ouvert | § Ticket #6 | +| 68 | BDD - Documents légaux & acceptations | P0 | ✅ Fermé | § Ticket #7 | +| 73 | Frontend - Inscription Parent Étape 1 | P3 | ✅ Fermé (PR) | § Ticket #36 | +| 78 | Frontend - Infrastructure formulaires multi-modes | P3 | ✅ Fermé | § Ticket #78 | +| 79 | Frontend - Renommer Nanny en AM | P3 | ✅ Fermé | § Ticket #79 | +| 81 | Frontend - Corrections refactoring widgets | P3 | ✅ Fermé | § Ticket #81 | +| 83 | Frontend - RegisterChoiceScreen mobile | P3 | ✅ Fermé | § Ticket #83 | + +*Les autres tickets (sans numéro Gitea dans ce tableau) sont décrits dans les sections par priorité ci‑dessous ; les numéros de section (#1 à #83) sont les références internes du document.* + +**Point API (tickets frontend)** – 27/01/2026 : 20 issues avec le label `frontend` dans Gitea (12 ouvertes, 8 fermées). Numéros concernés : 35–42, 43–51, 54, 82, 83. Les #73, #78, #79, #81 sont fermés mais sans label dans l’API. Détail : `docs/POINT_TICKETS_FRONT_API.txt`. + +--- + ## 📊 Vue d'ensemble ### Répartition par priorité diff --git a/frontend/lib/config/app_router.dart b/frontend/lib/config/app_router.dart index 7bd6358..d5e2ad6 100644 --- a/frontend/lib/config/app_router.dart +++ b/frontend/lib/config/app_router.dart @@ -19,6 +19,8 @@ import '../screens/auth/am_register_step2_screen.dart'; import '../screens/auth/am_register_step3_screen.dart'; import '../screens/auth/am_register_step4_screen.dart'; import '../screens/home/home_screen.dart'; +import '../screens/administrateurs/admin_dashboardScreen.dart'; +import '../screens/home/parent_screen/ParentDashboardScreen.dart'; import '../screens/unknown_screen.dart'; // --- Provider Instances --- @@ -47,6 +49,18 @@ class AppRouter { path: '/home', builder: (BuildContext context, GoRouterState state) => const HomeScreen(), ), + GoRoute( + path: '/admin-dashboard', + builder: (BuildContext context, GoRouterState state) => const AdminDashboardScreen(), + ), + GoRoute( + path: '/parent-dashboard', + builder: (BuildContext context, GoRouterState state) => const ParentDashboardScreen(), + ), + GoRoute( + path: '/am-dashboard', + builder: (BuildContext context, GoRouterState state) => const HomeScreen(), + ), // --- Parent Registration Flow --- ShellRoute( diff --git a/frontend/lib/models/user.dart b/frontend/lib/models/user.dart index 8091919..29712ac 100644 --- a/frontend/lib/models/user.dart +++ b/frontend/lib/models/user.dart @@ -20,8 +20,12 @@ class AppUser { id: json['id'] as String, email: json['email'] as String, role: json['role'] as String, - createdAt: DateTime.parse(json['createdAt'] as String), - updatedAt: DateTime.parse(json['updatedAt'] as String), + createdAt: json['createdAt'] != null + ? DateTime.parse(json['createdAt'] as String) + : DateTime.now(), + updatedAt: json['updatedAt'] != null + ? DateTime.parse(json['updatedAt'] as String) + : DateTime.now(), changementMdpObligatoire: json['changement_mdp_obligatoire'] as bool? ?? false, ); } diff --git a/frontend/lib/screens/auth/login_screen.dart b/frontend/lib/screens/auth/login_screen.dart index 6d6cfd2..b441062 100644 --- a/frontend/lib/screens/auth/login_screen.dart +++ b/frontend/lib/screens/auth/login_screen.dart @@ -116,21 +116,23 @@ class _LoginPageState extends State with WidgetsBindingObserver { } } - /// Redirige l'utilisateur selon son rôle + /// Redirige l'utilisateur selon son rôle (GoRouter : context.go). void _redirectUserByRole(String role) { + setState(() => _isLoading = false); switch (role.toLowerCase()) { case 'super_admin': + case 'administrateur': case 'gestionnaire': - Navigator.pushReplacementNamed(context, '/admin-dashboard'); + context.go('/admin-dashboard'); break; case 'parent': - Navigator.pushReplacementNamed(context, '/parent-dashboard'); + context.go('/parent-dashboard'); break; case 'assistante_maternelle': - Navigator.pushReplacementNamed(context, '/am-dashboard'); + context.go('/am-dashboard'); break; default: - Navigator.pushReplacementNamed(context, '/home'); + context.go('/home'); } } diff --git a/frontend/lib/services/auth_service.dart b/frontend/lib/services/auth_service.dart index 0acaefb..7a44678 100644 --- a/frontend/lib/services/auth_service.dart +++ b/frontend/lib/services/auth_service.dart @@ -23,13 +23,15 @@ class AuthService { if (response.statusCode == 200 || response.statusCode == 201) { final data = jsonDecode(response.body); - - // Stocker les tokens - await TokenService.saveToken(data['accessToken']); - await TokenService.saveRefreshToken(data['refreshToken']); - - // Récupérer le profil utilisateur pour avoir toutes les infos - final user = await _fetchUserProfile(data['accessToken']); + // API renvoie access_token / refresh_token (snake_case) + final accessToken = data['access_token'] as String? ?? data['accessToken'] as String?; + final refreshToken = data['refresh_token'] as String? ?? data['refreshToken'] as String?; + if (accessToken == null) throw Exception('Token absent dans la réponse serveur'); + + await TokenService.saveToken(accessToken); + await TokenService.saveRefreshToken(refreshToken ?? ''); + + final user = await _fetchUserProfile(accessToken); // Stocker l'utilisateur en cache await _saveCurrentUser(user); @@ -80,8 +82,9 @@ class AuthService { Uri.parse('${ApiConfig.baseUrl}${ApiConfig.changePasswordRequired}'), headers: ApiConfig.authHeaders(token), body: jsonEncode({ - 'currentPassword': currentPassword, - 'newPassword': newPassword, + 'mot_de_passe_actuel': currentPassword, + 'nouveau_mot_de_passe': newPassword, + 'confirmation_mot_de_passe': newPassword, }), );