import 'package:domain/generated/json/base/json_field.dart';
import 'package:domain/generated/json/rewards_home_tes_entity.g.dart';
import 'dart:convert';
export 'package:domain/generated/json/rewards_home_tes_entity.g.dart';

@JsonSerializable()
class RewardsHomeTesEntity {
  late double id;
  late String name = '';
  late List<RewardsHomeTesRewards> rewards = [];

  RewardsHomeTesEntity();

  factory RewardsHomeTesEntity.fromJson(Map<String, dynamic> json) =>
      $RewardsHomeTesEntityFromJson(json);

  Map<String, dynamic> toJson() => $RewardsHomeTesEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class RewardsHomeTesRewards {
  late double id;
  late String name = '';
  late List<String> resources = [];
  @JSONField(name: "original_point")
  late double originalPoint;
  late double point;

  RewardsHomeTesRewards();

  factory RewardsHomeTesRewards.fromJson(Map<String, dynamic> json) =>
      $RewardsHomeTesRewardsFromJson(json);

  Map<String, dynamic> toJson() => $RewardsHomeTesRewardsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
