rewards_home_tes_entity.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_home_tes_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_home_tes_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsHomeTesEntity {
  7. late double id;
  8. late String name = '';
  9. late List<RewardsHomeTesRewards> rewards = [];
  10. RewardsHomeTesEntity();
  11. factory RewardsHomeTesEntity.fromJson(Map<String, dynamic> json) =>
  12. $RewardsHomeTesEntityFromJson(json);
  13. Map<String, dynamic> toJson() => $RewardsHomeTesEntityToJson(this);
  14. @override
  15. String toString() {
  16. return jsonEncode(this);
  17. }
  18. }
  19. @JsonSerializable()
  20. class RewardsHomeTesRewards {
  21. late double id;
  22. late String name = '';
  23. late List<String> resources = [];
  24. @JSONField(name: "original_point")
  25. late double originalPoint;
  26. late double point;
  27. RewardsHomeTesRewards();
  28. factory RewardsHomeTesRewards.fromJson(Map<String, dynamic> json) =>
  29. $RewardsHomeTesRewardsFromJson(json);
  30. Map<String, dynamic> toJson() => $RewardsHomeTesRewardsToJson(this);
  31. @override
  32. String toString() {
  33. return jsonEncode(this);
  34. }
  35. }