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

@JsonSerializable()
class RewardsMyEntity {
	late int count = 0;
	late int page = 0;
	late int limit = 0;
	@JSONField(name: "count_page")
	late int countPage = 0;
	late List<RewardsMyList> list = [];

	RewardsMyEntity();

	factory RewardsMyEntity.fromJson(Map<String, dynamic> json) => $RewardsMyEntityFromJson(json);

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

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

@JsonSerializable()
class RewardsMyList {
	late int id = 0;
	@JSONField(name: "redemption_code")
	late int redemptionCode = 0;
	@JSONField(name: "used_at")
	late String usedAt = '';
	late RewardsMyListReward reward;

	RewardsMyList();

	factory RewardsMyList.fromJson(Map<String, dynamic> json) => $RewardsMyListFromJson(json);

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

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

@JsonSerializable()
class RewardsMyListReward {
	late int id = 0;
	late String title = '';
	late List<String> resources = [];
	@JSONField(name: "original_point")
	late int originalPoint = 0;
	late int point = 0;
	@JSONField(name: "redeemed_start")
	late String redeemedStart = '';
	@JSONField(name: "redeemed_end")
	late String redeemedEnd = '';

	RewardsMyListReward();

	factory RewardsMyListReward.fromJson(Map<String, dynamic> json) => $RewardsMyListRewardFromJson(json);

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

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