feat(dashboard-admin): connect admin dashboard to real API data (Ticket #92)
- Frontend:
- Create UserService to handle user-related API calls (gestionnaires, parents, AMs, admins)
- Update AdminDashboardScreen to use dynamic widgets
- Implement dynamic management widgets:
- GestionnaireManagementWidget
- ParentManagementWidget
- AssistanteMaternelleManagementWidget
- AdminManagementWidget
- Add data models: ParentModel, AssistanteMaternelleModel
- Update AppUser model
- Update ApiConfig
- Backend:
- Update controllers (Parents, AMs, Gestionnaires, Users) to allow ADMINISTRATEUR role to list users
- Note: Gestionnaires endpoint is currently bypassed in frontend (using /users filter) due to module import issue (documented in docs/92_NOTE-BACKEND-GESTIONNAIRES.md)
- Docs:
- Add note about backend fix for Gestionnaires module
- Update .cursorrules to forbid worktrees
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:p_tits_pas/models/user.dart';
|
||||
|
||||
class ParentModel {
|
||||
final AppUser user;
|
||||
final int childrenCount;
|
||||
|
||||
ParentModel({required this.user, this.childrenCount = 0});
|
||||
|
||||
factory ParentModel.fromJson(Map<String, dynamic> json) {
|
||||
final userJson = json['user'] ?? json;
|
||||
final user = AppUser.fromJson(userJson);
|
||||
final children = json['parentChildren'] as List?;
|
||||
return ParentModel(
|
||||
user: user,
|
||||
childrenCount: children?.length ?? 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user