Files
eatvio_app/lib/features/payment/models/promo_code_model.dart

23 lines
840 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'promo_code_model.freezed.dart';
part 'promo_code_model.g.dart';
@freezed
abstract class PromoCodeModel with _$PromoCodeModel {
const factory PromoCodeModel({
required int id,
@JsonKey(name: 'chosen_plan_id') required int chosenPlanId,
@JsonKey(name: 'promo_code') required String promoCode,
@JsonKey(name: 'discount_percent') required int discountPercent,
@JsonKey(name: 'discount_amount_rub') required double discountAmountRub,
required String state,
@JsonKey(name: 'applied_at') String? appliedAt,
@JsonKey(name: 'confirmed_at') String? confirmedAt,
@JsonKey(name: 'cancelled_at') String? cancelledAt,
}) = _PromoCodeModel;
factory PromoCodeModel.fromJson(Map<String, dynamic> json) =>
_$PromoCodeModelFromJson(json);
}