feat: Ajout de la gestion de la quantité pour les options d'événement

This commit is contained in:
ElPoyo
2025-12-16 19:23:48 +01:00
parent 08f046c89c
commit 28d9e008af
6 changed files with 240 additions and 28 deletions

View File

@@ -6,6 +6,7 @@ class EventOption {
final double valMin;
final double valMax;
final List<String> eventTypes; // Changé de List<DocumentReference> à List<String>
final bool isQuantitative; // Indique si l'option peut avoir une quantité
EventOption({
required this.id,
@@ -15,6 +16,7 @@ class EventOption {
required this.valMin,
required this.valMax,
required this.eventTypes,
this.isQuantitative = false,
});
factory EventOption.fromMap(Map<String, dynamic> map, String id) {
@@ -28,6 +30,7 @@ class EventOption {
eventTypes: (map['eventTypes'] as List<dynamic>? ?? [])
.map((e) => e.toString()) // Convertit en String (supporte IDs et références)
.toList(),
isQuantitative: map['isQuantitative'] ?? false,
);
}
@@ -39,6 +42,7 @@ class EventOption {
'valMin': valMin,
'valMax': valMax,
'eventTypes': eventTypes,
'isQuantitative': isQuantitative,
};
}
}