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

@JsonSerializable()
class RewardsIndexEntity {
  int points = 0;
  RewardsIndexContinuous? continuous;
  RewardsIndexTasks? tasks;
  List<dynamic> latest = [];

  RewardsIndexEntity();

  factory RewardsIndexEntity.fromJson(Map<String, dynamic> json) => $RewardsIndexEntityFromJson(json);

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

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

@JsonSerializable()
class RewardsIndexContinuous {
  int count = 0;
  @JSONField(name: "current_week_checkin")
  List<dynamic> currentWeekCheckin = [];

  RewardsIndexContinuous();

  factory RewardsIndexContinuous.fromJson(Map<String, dynamic> json) => $RewardsIndexContinuousFromJson(json);

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

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

@JsonSerializable()
class RewardsIndexTasks {
  @JSONField(name: "daily_checkin")
  bool dailyCheckin = false;
  @JSONField(name: "news_feed_post")
  bool newsFeedPost = false;
  @JSONField(name: "give_10_likes")
  int give10Likes = 0;

  RewardsIndexTasks();

  factory RewardsIndexTasks.fromJson(Map<String, dynamic> json) => $RewardsIndexTasksFromJson(json);

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

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