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,30 @@
|
||||
import 'package:p_tits_pas/models/user.dart';
|
||||
|
||||
class AssistanteMaternelleModel {
|
||||
final AppUser user;
|
||||
final String? approvalNumber;
|
||||
final String? residenceCity;
|
||||
final int? maxChildren;
|
||||
final int? placesAvailable;
|
||||
|
||||
AssistanteMaternelleModel({
|
||||
required this.user,
|
||||
this.approvalNumber,
|
||||
this.residenceCity,
|
||||
this.maxChildren,
|
||||
this.placesAvailable,
|
||||
});
|
||||
|
||||
factory AssistanteMaternelleModel.fromJson(Map<String, dynamic> json) {
|
||||
final userJson = json['user'] ?? json;
|
||||
final user = AppUser.fromJson(userJson);
|
||||
|
||||
return AssistanteMaternelleModel(
|
||||
user: user,
|
||||
approvalNumber: json['numero_agrement'] as String?,
|
||||
residenceCity: json['ville_residence'] as String?,
|
||||
maxChildren: json['nb_max_enfants'] as int?,
|
||||
placesAvailable: json['place_disponible'] as int?,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user