class RateModel {
  int cardId;
  double stars;
  String? feedback;

  RateModel({required this.cardId, required this.stars, this.feedback});

  factory RateModel.zero() => RateModel(cardId: 0, stars: 0);

  Map<String, dynamic> toJson() => {
        'card_id': cardId,
        'stars': stars * 2,
        if (feedback != null) 'feedback': feedback,
      };
}
