feat(front): alignement avec la spec backend soins enfant
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,7 @@ enum CarteStatut {
|
||||
switch (raw) {
|
||||
case 'refusee':
|
||||
return CarteStatut.refusee;
|
||||
case 'fermee':
|
||||
case 'traitee':
|
||||
return CarteStatut.traitee;
|
||||
case 'ouverte':
|
||||
@@ -113,23 +114,7 @@ class CarteBulle {
|
||||
/// Helper pour extraire les informations de soin
|
||||
String? get resumerSoin {
|
||||
if (!isSoinEnfant) return null;
|
||||
|
||||
final st = payload['sous_type']?.toString();
|
||||
final h = payload['heure_releve']?.toString();
|
||||
final hStr = h != null && h.isNotEmpty ? ' à $h' : '';
|
||||
|
||||
if (st == 'fievre') {
|
||||
final t = payload['temperature_c']?.toString() ?? '?';
|
||||
return 'Température : $t°C$hStr';
|
||||
} else if (st == 'bobo') {
|
||||
final nature = payload['bobo_nature']?.toString() ?? 'Bobo';
|
||||
final desc = payload['description']?.toString() ?? '';
|
||||
return desc.isNotEmpty ? '$nature$hStr ($desc)' : '$nature$hStr';
|
||||
} else if (st == 'medicament') {
|
||||
final nom = payload['medicament_nom']?.toString() ?? 'Médicament';
|
||||
return '$nom donné$hStr';
|
||||
}
|
||||
return null;
|
||||
return payload['motif']?.toString();
|
||||
}
|
||||
|
||||
/// Motif de refus : réponse API, sinon motif payload (co-parent / reload).
|
||||
|
||||
@@ -49,18 +49,14 @@ class CarteTypeUi {
|
||||
label: 'Arrêt maladie',
|
||||
motifHint: 'Précisions (optionnel)',
|
||||
),
|
||||
// Point d’extension #soins — visible dès que le back l’émet.
|
||||
'soin_enfant': CarteTypeUi(
|
||||
typeCode: 'soin_enfant',
|
||||
label: 'Soin / bobo',
|
||||
motifHint: 'Décrivez le soin ou le bobo',
|
||||
motifRequired: true,
|
||||
periodeMode: CartePeriodeMode.singleDay,
|
||||
sousTypes: [
|
||||
CarteSousTypeUi(code: 'temperature', label: 'Température'),
|
||||
CarteSousTypeUi(code: 'fievre', label: 'Fièvre'),
|
||||
CarteSousTypeUi(code: 'bobo', label: 'Bobo'),
|
||||
CarteSousTypeUi(code: 'medicament', label: 'Médicament'),
|
||||
CarteSousTypeUi(code: 'autre', label: 'Autre'),
|
||||
],
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user