feat: Ajout de la gestion de la quantité pour les options d'événement
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user