forked from eatvio/eatvio_app
feat(promo_codes): added promo codes handling to app
This commit is contained in:
22
lib/features/payment/models/promo_code_model.dart
Normal file
22
lib/features/payment/models/promo_code_model.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user