class SubscriptionPeriod {
  final int id;
  final int subscriptionId;
  final int days;
  final String title;
  final double price;
  final String pricePrint;

  SubscriptionPeriod({
    required this.id,
    required this.subscriptionId,
    required this.days,
    required this.title,
    required this.price,
    required this.pricePrint,
  });

  factory SubscriptionPeriod.fromJson(Map<String, dynamic> json) {
    return SubscriptionPeriod(
      id: json['id'] ?? 0,
      subscriptionId: json['subscriptionId'] ?? 0,
      days: json['days'] ?? 0,
      title: json['title'] ?? '',
      price: (json['price'] ?? 0).toDouble(),
      pricePrint: json['pricePrint'] ?? '',
    );
  }

  @override
  String toString() {
    return 'SubscriptionPeriod{id: $id, title: $title, days: $days, price: $price}';
  }
}