25 lines
543 B
Dart
25 lines
543 B
Dart
import '../../domain/entities/promo_code_result.dart';
|
|
|
|
class PromoCodeResponseDto {
|
|
final bool success;
|
|
final double balance;
|
|
|
|
PromoCodeResponseDto({
|
|
required this.success,
|
|
required this.balance,
|
|
});
|
|
|
|
factory PromoCodeResponseDto.fromJson(Map<String, dynamic> json) {
|
|
return PromoCodeResponseDto(
|
|
success: json['success'] as bool,
|
|
balance: (json['balance'] as num).toDouble(),
|
|
);
|
|
}
|
|
|
|
PromoCodeResult toEntity() {
|
|
return PromoCodeResult(
|
|
success: success,
|
|
balance: balance,
|
|
);
|
|
}
|
|
} |