/// Une récompense du catalogue : ce qu'un client peut obtenir en échange de /// ses points (ex : « Café offert » = 10 pts). class Recompense { final String id; final String nom; /// Coût en points pour obtenir la récompense. final double coutPoints; /// Récompense proposée (true) ou masquée sans être supprimée (false). final bool actif; const Recompense({ required this.id, required this.nom, required this.coutPoints, this.actif = true, }); Recompense copyWith({ String? id, String? nom, double? coutPoints, bool? actif, }) { return Recompense( id: id ?? this.id, nom: nom ?? this.nom, coutPoints: coutPoints ?? this.coutPoints, actif: actif ?? this.actif, ); } factory Recompense.fromMap(Map map) { return Recompense( id: map['id'].toString(), nom: (map['nom'] as String?) ?? '', coutPoints: (map['cout_points'] as num?)?.toDouble() ?? 0, actif: (map['actif'] as bool?) ?? true, ); } }