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

@JsonSerializable()
class HomeListEntity {
  List<HomeListBanners> banners = [];
  @JSONField(name: "latest_transactions")
  List<HomeListLatestTransactions> latestTransactions = [];
  @JSONField(name: "property_news")
  List<HomeListPropertyNews> propertyNews = [];
  @JSONField(name: "strata_management_guides")
  List<HomeListPropertyNews> strataManagementGuides = [];

  HomeListEntity();

  factory HomeListEntity.fromJson(Map<String, dynamic> json) => $HomeListEntityFromJson(json);

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

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

@JsonSerializable()
class HomeListBanners {
  String? id;
  String? name;
  String? image;

  HomeListBanners();

  factory HomeListBanners.fromJson(Map<String, dynamic> json) => $HomeListBannersFromJson(json);

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

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

@JsonSerializable()
class HomeListLatestTransactions {
  String? id;
  int type = 0;
  String? title;
  String? price;
  @JSONField(name: "created_at")
  String? createdAt;

  HomeListLatestTransactions();

  factory HomeListLatestTransactions.fromJson(Map<String, dynamic> json) => $HomeListLatestTransactionsFromJson(json);

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

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

@JsonSerializable()
class HomeListPropertyNews {
  String? id;
  String? title;
  @JSONField(name: "cover_image")
  String? coverImage;
  @JSONField(name: "created_at")
  String? createdAt;

  HomeListPropertyNews();

  factory HomeListPropertyNews.fromJson(Map<String, dynamic> json) => $HomeListPropertyNewsFromJson(json);

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

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