service_repair_detail_entity.dart 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/service_repair_detail_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/service_repair_detail_entity.g.dart';
  5. @JsonSerializable()
  6. class ServiceRepairDetailEntity {
  7. late int id = 0;
  8. late String name = '';
  9. late String description = '';
  10. late ServiceRepairDetailMerchant merchant;
  11. late ServiceRepairDetailCategory category;
  12. ServiceRepairDetailEntity();
  13. factory ServiceRepairDetailEntity.fromJson(Map<String, dynamic> json) =>
  14. $ServiceRepairDetailEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $ServiceRepairDetailEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class ServiceRepairDetailMerchant {
  23. late int id = 0;
  24. late String name = '';
  25. ServiceRepairDetailMerchant();
  26. factory ServiceRepairDetailMerchant.fromJson(Map<String, dynamic> json) =>
  27. $ServiceRepairDetailMerchantFromJson(json);
  28. Map<String, dynamic> toJson() => $ServiceRepairDetailMerchantToJson(this);
  29. @override
  30. String toString() {
  31. return jsonEncode(this);
  32. }
  33. }
  34. @JsonSerializable()
  35. class ServiceRepairDetailCategory {
  36. late int id = 0;
  37. late String name = '';
  38. late String type = '';
  39. ServiceRepairDetailCategory();
  40. factory ServiceRepairDetailCategory.fromJson(Map<String, dynamic> json) =>
  41. $ServiceRepairDetailCategoryFromJson(json);
  42. Map<String, dynamic> toJson() => $ServiceRepairDetailCategoryToJson(this);
  43. @override
  44. String toString() {
  45. return jsonEncode(this);
  46. }
  47. }