import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/rewards_active_detail_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/rewards_active_detail_entity.g.dart'; @JsonSerializable() class RewardsActiveDetailEntity { late RewardsActiveDetailData data; RewardsActiveDetailEntity(); factory RewardsActiveDetailEntity.fromJson(Map json) => $RewardsActiveDetailEntityFromJson(json); Map toJson() => $RewardsActiveDetailEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsActiveDetailData { late int id = 0; @JSONField(name: "redemption_code") late String redemptionCode = ''; @JSONField(name: "used_at") late String usedAt = ''; @JSONField(name: "created_at") late String createdAt = ''; @JSONField(name: "expired_at") late String expiredAt = ''; late int quantity = 0; late RewardsActiveDetailDataAccount account; late RewardsActiveDetailDataReward reward; RewardsActiveDetailData(); factory RewardsActiveDetailData.fromJson(Map json) => $RewardsActiveDetailDataFromJson(json); Map toJson() => $RewardsActiveDetailDataToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsActiveDetailDataAccount { late int id = 0; late String name = ''; late String phone = ''; RewardsActiveDetailDataAccount(); factory RewardsActiveDetailDataAccount.fromJson(Map json) => $RewardsActiveDetailDataAccountFromJson(json); Map toJson() => $RewardsActiveDetailDataAccountToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class RewardsActiveDetailDataReward { late int id = 0; late String title = ''; late List resources = []; @JSONField(name: "original_point") late int originalPoint = 0; late int point = 0; @JSONField(name: "redeemed_start") late String redeemedStart = ''; @JSONField(name: "redeemed_end") late String redeemedEnd = ''; RewardsActiveDetailDataReward(); factory RewardsActiveDetailDataReward.fromJson(Map json) => $RewardsActiveDetailDataRewardFromJson(json); Map toJson() => $RewardsActiveDetailDataRewardToJson(this); @override String toString() { return jsonEncode(this); } }