rewards_buy_entity.dart 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_buy_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_buy_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsBuyEntity {
  7. late int id = 0;
  8. @JSONField(name: "created_at")
  9. late String createdAt = '';
  10. late RewardsBuyReward reward;
  11. RewardsBuyEntity();
  12. factory RewardsBuyEntity.fromJson(Map<String, dynamic> json) =>
  13. $RewardsBuyEntityFromJson(json);
  14. Map<String, dynamic> toJson() => $RewardsBuyEntityToJson(this);
  15. @override
  16. String toString() {
  17. return jsonEncode(this);
  18. }
  19. }
  20. @JsonSerializable()
  21. class RewardsBuyReward {
  22. late int id = 0;
  23. late String title = '';
  24. late List<String> resources = [];
  25. @JSONField(name: "original_point")
  26. late int originalPoint = 0;
  27. late int point = 0;
  28. late String description = '';
  29. late bool reservation = false;
  30. late String start = '';
  31. late String end = '';
  32. @JSONField(name: "redeemed_start")
  33. late String redeemedStart = '';
  34. @JSONField(name: "redeemed_end")
  35. late String redeemedEnd = '';
  36. late String package = '';
  37. late String notice = '';
  38. @JSONField(name: "created_at")
  39. late String createdAt = '';
  40. late List<RewardsBuyRewardRedeemable> redeemable = [];
  41. RewardsBuyReward();
  42. factory RewardsBuyReward.fromJson(Map<String, dynamic> json) =>
  43. $RewardsBuyRewardFromJson(json);
  44. Map<String, dynamic> toJson() => $RewardsBuyRewardToJson(this);
  45. @override
  46. String toString() {
  47. return jsonEncode(this);
  48. }
  49. }
  50. @JsonSerializable()
  51. class RewardsBuyRewardRedeemable {
  52. late String day = '';
  53. late String time = '';
  54. RewardsBuyRewardRedeemable();
  55. factory RewardsBuyRewardRedeemable.fromJson(Map<String, dynamic> json) => $RewardsBuyRewardRedeemableFromJson(json);
  56. Map<String, dynamic> toJson() => $RewardsBuyRewardRedeemableToJson(this);
  57. @override
  58. String toString() {
  59. return jsonEncode(this);
  60. }
  61. }