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

@JsonSerializable()
class RewardsHomeEntity {
	late List<RewardsHomeData> data = [];
	late String message = '';
	late int code = 0;

	RewardsHomeEntity();

	factory RewardsHomeEntity.fromJson(Map<String, dynamic> json) => $RewardsHomeEntityFromJson(json);

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

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

@JsonSerializable()
class RewardsHomeData {
	late int id = 0;
	late String name = '';
	late List<RewardsHomeDataRewards> rewards = [];

	RewardsHomeData();

	factory RewardsHomeData.fromJson(Map<String, dynamic> json) => $RewardsHomeDataFromJson(json);

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

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

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

	RewardsHomeDataRewards();

	factory RewardsHomeDataRewards.fromJson(Map<String, dynamic> json) => $RewardsHomeDataRewardsFromJson(json);

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

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