- 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>
83 lines
2.3 KiB
Dart
83 lines
2.3 KiB
Dart
class AppUser {
|
|
final String id;
|
|
final String email;
|
|
final String role;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final bool changementMdpObligatoire;
|
|
final String? nom;
|
|
final String? prenom;
|
|
final String? statut;
|
|
final String? telephone;
|
|
final String? photoUrl;
|
|
final String? adresse;
|
|
final String? ville;
|
|
final String? codePostal;
|
|
|
|
AppUser({
|
|
required this.id,
|
|
required this.email,
|
|
required this.role,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
this.changementMdpObligatoire = false,
|
|
this.nom,
|
|
this.prenom,
|
|
this.statut,
|
|
this.telephone,
|
|
this.photoUrl,
|
|
this.adresse,
|
|
this.ville,
|
|
this.codePostal,
|
|
});
|
|
|
|
factory AppUser.fromJson(Map<String, dynamic> json) {
|
|
return AppUser(
|
|
id: json['id'] as String,
|
|
email: json['email'] as String,
|
|
role: json['role'] as String,
|
|
createdAt: json['cree_le'] != null
|
|
? DateTime.parse(json['cree_le'] as String)
|
|
: (json['createdAt'] != null
|
|
? DateTime.parse(json['createdAt'] as String)
|
|
: DateTime.now()),
|
|
updatedAt: json['modifie_le'] != null
|
|
? DateTime.parse(json['modifie_le'] as String)
|
|
: (json['updatedAt'] != null
|
|
? DateTime.parse(json['updatedAt'] as String)
|
|
: DateTime.now()),
|
|
changementMdpObligatoire:
|
|
json['changement_mdp_obligatoire'] as bool? ?? false,
|
|
nom: json['nom'] as String?,
|
|
prenom: json['prenom'] as String?,
|
|
statut: json['statut'] as String?,
|
|
telephone: json['telephone'] as String?,
|
|
photoUrl: json['photo_url'] as String?,
|
|
adresse: json['adresse'] as String?,
|
|
ville: json['ville'] as String?,
|
|
codePostal: json['code_postal'] as String?,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'email': email,
|
|
'role': role,
|
|
'createdAt': createdAt.toIso8601String(),
|
|
'updatedAt': updatedAt.toIso8601String(),
|
|
'changement_mdp_obligatoire': changementMdpObligatoire,
|
|
'nom': nom,
|
|
'prenom': prenom,
|
|
'statut': statut,
|
|
'telephone': telephone,
|
|
'photo_url': photoUrl,
|
|
'adresse': adresse,
|
|
'ville': ville,
|
|
'code_postal': codePostal,
|
|
};
|
|
}
|
|
|
|
String get fullName => '${prenom ?? ''} ${nom ?? ''}'.trim();
|
|
}
|