user_me_entity.dart 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/user_me_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/user_me_entity.g.dart';
  5. @JsonSerializable()
  6. class UserMeEntity {
  7. String? id;
  8. String? name;
  9. String? avatar;
  10. String? phone;
  11. String? email;
  12. @JSONField(name: "follows_count")
  13. String? followsCount;
  14. @JSONField(name: "flowers_count")
  15. String? flowersCount;
  16. @JSONField(name: "posts_count")
  17. String? postsCount;
  18. List<UserMeHouseholds>? households = [];
  19. List<UserMeEstates>? estates = [];
  20. @JSONField(name: "default_unit")
  21. UserMeDefaultUnit? defaultUnit;
  22. UserMeInformation? information;
  23. UserMeEntity();
  24. factory UserMeEntity.fromJson(Map<String, dynamic> json) => $UserMeEntityFromJson(json);
  25. Map<String, dynamic> toJson() => $UserMeEntityToJson(this);
  26. @override
  27. String toString() {
  28. return jsonEncode(this);
  29. }
  30. }
  31. @JsonSerializable()
  32. class UserMeHouseholds {
  33. String? id;
  34. String? name;
  35. String? avatar;
  36. UserMeHouseholds();
  37. factory UserMeHouseholds.fromJson(Map<String, dynamic> json) => $UserMeHouseholdsFromJson(json);
  38. Map<String, dynamic> toJson() => $UserMeHouseholdsToJson(this);
  39. @override
  40. String toString() {
  41. return jsonEncode(this);
  42. }
  43. }
  44. @JsonSerializable()
  45. class UserMeEstates {
  46. String? id;
  47. String? name;
  48. List<UserMeEstatesAccounts>? accounts = [];
  49. UserMeEstates();
  50. factory UserMeEstates.fromJson(Map<String, dynamic> json) => $UserMeEstatesFromJson(json);
  51. Map<String, dynamic> toJson() => $UserMeEstatesToJson(this);
  52. @override
  53. String toString() {
  54. return jsonEncode(this);
  55. }
  56. }
  57. @JsonSerializable()
  58. class UserMeEstatesAccounts {
  59. String? id;
  60. String? name;
  61. String? avatar;
  62. String? type;
  63. @JSONField(name: "default")
  64. int isDefault = 0;
  65. String? status;
  66. UserMeEstatesAccountsUnit? unit;
  67. UserMeEstatesAccounts();
  68. factory UserMeEstatesAccounts.fromJson(Map<String, dynamic> json) => $UserMeEstatesAccountsFromJson(json);
  69. Map<String, dynamic> toJson() => $UserMeEstatesAccountsToJson(this);
  70. @override
  71. String toString() {
  72. return jsonEncode(this);
  73. }
  74. }
  75. @JsonSerializable()
  76. class UserMeEstatesAccountsUnit {
  77. String? id;
  78. String? block;
  79. String? street;
  80. String? unit;
  81. String? address;
  82. UserMeEstatesAccountsUnit();
  83. factory UserMeEstatesAccountsUnit.fromJson(Map<String, dynamic> json) => $UserMeEstatesAccountsUnitFromJson(json);
  84. Map<String, dynamic> toJson() => $UserMeEstatesAccountsUnitToJson(this);
  85. @override
  86. String toString() {
  87. return jsonEncode(this);
  88. }
  89. }
  90. @JsonSerializable()
  91. class UserMeDefaultUnit {
  92. String? id;
  93. @JSONField(name: "estate_id")
  94. String? estateId;
  95. String? block;
  96. String? street;
  97. String? unit;
  98. String? address;
  99. int type = 0;
  100. UserMeDefaultUnit();
  101. factory UserMeDefaultUnit.fromJson(Map<String, dynamic> json) => $UserMeDefaultUnitFromJson(json);
  102. Map<String, dynamic> toJson() => $UserMeDefaultUnitToJson(this);
  103. @override
  104. String toString() {
  105. return jsonEncode(this);
  106. }
  107. }
  108. @JsonSerializable()
  109. class UserMeInformation {
  110. @JSONField(name: "first_name")
  111. String? firstName;
  112. @JSONField(name: "last_name")
  113. String? lastName;
  114. @JSONField(name: "country_code")
  115. String? countryCode;
  116. String? phone;
  117. UserMeInformation();
  118. factory UserMeInformation.fromJson(Map<String, dynamic> json) => $UserMeInformationFromJson(json);
  119. Map<String, dynamic> toJson() => $UserMeInformationToJson(this);
  120. @override
  121. String toString() {
  122. return jsonEncode(this);
  123. }
  124. }