feat(#140): dashboard admin ch.6 — fiche parent, enfants, affiliation
Back: PATCH /parents/:id/fiche, attach/detach enfant, GET /enfants enrichi. Front: modale parent éditable, onglet Enfants, fiche enfant, UserService. Couvre doc 28 §6.1–6.2 ; tickets liés #115 #116 #130 #131 #137 #138. Hors scope: fiche AM (#131), création admin (#129). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/// Résumé enfant affiché dans la fiche parent (dashboard admin).
|
||||
class ParentChildSummary {
|
||||
final String id;
|
||||
final String? firstName;
|
||||
final String? lastName;
|
||||
final String status;
|
||||
|
||||
ParentChildSummary({
|
||||
required this.id,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
String get fullName {
|
||||
final fn = (firstName ?? '').trim();
|
||||
final ln = (lastName ?? '').trim();
|
||||
if (fn.isEmpty && ln.isEmpty) return 'Enfant';
|
||||
if (ln.isEmpty) return fn;
|
||||
return '$fn $ln';
|
||||
}
|
||||
|
||||
factory ParentChildSummary.fromJson(Map<String, dynamic> json) {
|
||||
return ParentChildSummary(
|
||||
id: (json['id'] ?? '').toString(),
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
status: (json['status'] ?? '').toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user