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

@JsonSerializable()
class RewardsActiveDetailEntity {
	late RewardsActiveDetailData data;

	RewardsActiveDetailEntity();

	factory RewardsActiveDetailEntity.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailEntityFromJson(json);

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

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

@JsonSerializable()
class RewardsActiveDetailData {
	late int id = 0;
	@JSONField(name: "redemption_code")
	late String redemptionCode = '';
	@JSONField(name: "used_at")
	late String usedAt = '';
	@JSONField(name: "created_at")
	late String createdAt = '';
	@JSONField(name: "expired_at")
	late String expiredAt = '';
	late int quantity = 0;
	late RewardsActiveDetailDataAccount account;
	late RewardsActiveDetailDataReward reward;

	RewardsActiveDetailData();

	factory RewardsActiveDetailData.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataFromJson(json);

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

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

@JsonSerializable()
class RewardsActiveDetailDataAccount {
	late int id = 0;
	late String name = '';
	late String phone = '';

	RewardsActiveDetailDataAccount();

	factory RewardsActiveDetailDataAccount.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataAccountFromJson(json);

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

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

@JsonSerializable()
class RewardsActiveDetailDataReward {
	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 = '';

	RewardsActiveDetailDataReward();

	factory RewardsActiveDetailDataReward.fromJson(Map<String, dynamic> json) => $RewardsActiveDetailDataRewardFromJson(json);

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

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