forked from eatvio/eatvio_app
21 lines
772 B
Dart
21 lines
772 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'promo_validate_response.freezed.dart';
|
|
part 'promo_validate_response.g.dart';
|
|
|
|
@freezed
|
|
abstract class PromoValidateResponse with _$PromoValidateResponse {
|
|
const factory PromoValidateResponse({
|
|
required bool valid,
|
|
String? error,
|
|
@JsonKey(name: 'promo_code') String? promoCode,
|
|
@JsonKey(name: 'discount_percent') int? discountPercent,
|
|
@JsonKey(name: 'discount_amount_rub') double? discountAmountRub,
|
|
@JsonKey(name: 'original_amount_rub') double? originalAmountRub,
|
|
@JsonKey(name: 'final_amount_rub') double? finalAmountRub,
|
|
}) = _PromoValidateResponse;
|
|
|
|
factory PromoValidateResponse.fromJson(Map<String, dynamic> json) =>
|
|
_$PromoValidateResponseFromJson(json);
|
|
}
|