rewards_active_detail_entity.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_active_detail_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_active_detail_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsActiveDetailEntity {
  7. late RewardsActiveDetailData data;
  8. RewardsActiveDetailEntity();
  9. factory RewardsActiveDetailEntity.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailEntityFromJson(json);
  10. Map<String, dynamic> toJson() => $RewardsActiveDetailEntityToJson(this);
  11. @override
  12. String toString() {
  13. return jsonEncode(this);
  14. }
  15. }
  16. @JsonSerializable()
  17. class RewardsActiveDetailData {
  18. late int id = 0;
  19. @JSONField(name: "redemption_code")
  20. late String redemptionCode = '';
  21. @JSONField(name: "used_at")
  22. late String usedAt = '';
  23. @JSONField(name: "created_at")
  24. late String createdAt = '';
  25. @JSONField(name: "expired_at")
  26. late String expiredAt = '';
  27. late int quantity = 0;
  28. late RewardsActiveDetailDataAccount account;
  29. late RewardsActiveDetailDataReward reward;
  30. RewardsActiveDetailData();
  31. factory RewardsActiveDetailData.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataFromJson(json);
  32. Map<String, dynamic> toJson() => $RewardsActiveDetailDataToJson(this);
  33. @override
  34. String toString() {
  35. return jsonEncode(this);
  36. }
  37. }
  38. @JsonSerializable()
  39. class RewardsActiveDetailDataAccount {
  40. late int id = 0;
  41. late String name = '';
  42. late String phone = '';
  43. RewardsActiveDetailDataAccount();
  44. factory RewardsActiveDetailDataAccount.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataAccountFromJson(json);
  45. Map<String, dynamic> toJson() => $RewardsActiveDetailDataAccountToJson(this);
  46. @override
  47. String toString() {
  48. return jsonEncode(this);
  49. }
  50. }
  51. @JsonSerializable()
  52. class RewardsActiveDetailDataReward {
  53. late int id = 0;
  54. late String title = '';
  55. late List<String> resources = [];
  56. @JSONField(name: "original_point")
  57. late int originalPoint = 0;
  58. late int point = 0;
  59. @JSONField(name: "redeemed_start")
  60. late String redeemedStart = '';
  61. @JSONField(name: "redeemed_end")
  62. late String redeemedEnd = '';
  63. RewardsActiveDetailDataReward();
  64. factory RewardsActiveDetailDataReward.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataRewardFromJson(json);
  65. Map<String, dynamic> toJson() => $RewardsActiveDetailDataRewardToJson(this);
  66. @override
  67. String toString() {
  68. return jsonEncode(this);
  69. }
  70. }