class Tariff { final String id; final String name; final double price; final String currency; final Map features; final bool isActive; final DateTime createdAt; Tariff({ required this.id, required this.name, required this.price, this.currency = 'RUB', required this.features, this.isActive = true, required this.createdAt, }); factory Tariff.fromJson(Map json) => Tariff( id: json['id'] as String, name: json['name'] as String, price: (json['price'] as num).toDouble(), currency: json['currency'] as String? ?? 'RUB', features: json['features'] as Map? ?? {}, isActive: json['is_active'] as bool? ?? true, createdAt: DateTime.parse(json['created_at'] as String), ); Map toJson() => { 'id': id, 'name': name, 'price': price, 'currency': currency, 'features': features, 'is_active': isActive, 'created_at': createdAt.toIso8601String(), }; }