feat(#157): alerte enfants sans responsable + rattachement foyer.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-17 19:02:21 +02:00
co-authored by Cursor
parent 7a3d997ff9
commit 2ececa711b
7 changed files with 123 additions and 9 deletions
+12
View File
@@ -0,0 +1,12 @@
import 'package:p_tits_pas/models/enfant_admin_model.dart';
/// Enfant sans lien parent (orphelins daffiliation) — ticket #157.
bool enfantHasNoResponsable(EnfantAdminModel enfant) {
return !enfant.parentLinks.any((l) => l.parentId.trim().isNotEmpty);
}
/// Message vigilance liste Enfants (même usage que [amPlacesVigilanceMessage]).
String? enfantSansResponsableVigilanceMessage(EnfantAdminModel enfant) {
if (!enfantHasNoResponsable(enfant)) return null;
return 'Aucun responsable rattaché — à rattacher à un foyer';
}