staff_detail_entity.g.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/staff_detail_entity.dart';
  3. StaffDetailEntity $StaffDetailEntityFromJson(Map<String, dynamic> json) {
  4. final StaffDetailEntity staffDetailEntity = StaffDetailEntity();
  5. final int? memberId = jsonConvert.convert<int>(json['member_id']);
  6. if (memberId != null) {
  7. staffDetailEntity.memberId = memberId;
  8. }
  9. final String? name = jsonConvert.convert<String>(json['name']);
  10. if (name != null) {
  11. staffDetailEntity.name = name;
  12. }
  13. final String? avatar = jsonConvert.convert<String>(json['avatar']);
  14. if (avatar != null) {
  15. staffDetailEntity.avatar = avatar;
  16. }
  17. final String? sex = jsonConvert.convert<String>(json['sex']);
  18. if (sex != null) {
  19. staffDetailEntity.sex = sex;
  20. }
  21. final String? dob = jsonConvert.convert<String>(json['dob']);
  22. if (dob != null) {
  23. staffDetailEntity.dob = dob;
  24. }
  25. final String? nric = jsonConvert.convert<String>(json['nric']);
  26. if (nric != null) {
  27. staffDetailEntity.nric = nric;
  28. }
  29. final String? mobile = jsonConvert.convert<String>(json['mobile']);
  30. if (mobile != null) {
  31. staffDetailEntity.mobile = mobile;
  32. }
  33. final String? email = jsonConvert.convert<String>(json['email']);
  34. if (email != null) {
  35. staffDetailEntity.email = email;
  36. }
  37. final String? address = jsonConvert.convert<String>(json['address']);
  38. if (address != null) {
  39. staffDetailEntity.address = address;
  40. }
  41. final String? natl = jsonConvert.convert<String>(json['natl']);
  42. if (natl != null) {
  43. staffDetailEntity.natl = natl;
  44. }
  45. final String? lang = jsonConvert.convert<String>(json['lang']);
  46. if (lang != null) {
  47. staffDetailEntity.lang = lang;
  48. }
  49. final String? emerName = jsonConvert.convert<String>(json['emer_name']);
  50. if (emerName != null) {
  51. staffDetailEntity.emerName = emerName;
  52. }
  53. final String? emerPhone = jsonConvert.convert<String>(json['emer_phone']);
  54. if (emerPhone != null) {
  55. staffDetailEntity.emerPhone = emerPhone;
  56. }
  57. final int? remNum = jsonConvert.convert<int>(json['rem_num']);
  58. if (remNum != null) {
  59. staffDetailEntity.remNum = remNum;
  60. }
  61. final double? remRate = jsonConvert.convert<double>(json['rem_rate']);
  62. if (remRate != null) {
  63. staffDetailEntity.remRate = remRate;
  64. }
  65. return staffDetailEntity;
  66. }
  67. Map<String, dynamic> $StaffDetailEntityToJson(StaffDetailEntity entity) {
  68. final Map<String, dynamic> data = <String, dynamic>{};
  69. data['member_id'] = entity.memberId;
  70. data['name'] = entity.name;
  71. data['avatar'] = entity.avatar;
  72. data['sex'] = entity.sex;
  73. data['dob'] = entity.dob;
  74. data['nric'] = entity.nric;
  75. data['mobile'] = entity.mobile;
  76. data['email'] = entity.email;
  77. data['address'] = entity.address;
  78. data['natl'] = entity.natl;
  79. data['lang'] = entity.lang;
  80. data['emer_name'] = entity.emerName;
  81. data['emer_phone'] = entity.emerPhone;
  82. data['rem_num'] = entity.remNum;
  83. data['rem_rate'] = entity.remRate;
  84. return data;
  85. }
  86. extension StaffDetailEntityExtension on StaffDetailEntity {
  87. StaffDetailEntity copyWith({
  88. int? memberId,
  89. String? name,
  90. String? avatar,
  91. String? sex,
  92. String? dob,
  93. String? nric,
  94. String? mobile,
  95. String? email,
  96. String? address,
  97. String? natl,
  98. String? lang,
  99. String? emerName,
  100. String? emerPhone,
  101. int? remNum,
  102. double? remRate,
  103. }) {
  104. return StaffDetailEntity()
  105. ..memberId = memberId ?? this.memberId
  106. ..name = name ?? this.name
  107. ..avatar = avatar ?? this.avatar
  108. ..sex = sex ?? this.sex
  109. ..dob = dob ?? this.dob
  110. ..nric = nric ?? this.nric
  111. ..mobile = mobile ?? this.mobile
  112. ..email = email ?? this.email
  113. ..address = address ?? this.address
  114. ..natl = natl ?? this.natl
  115. ..lang = lang ?? this.lang
  116. ..emerName = emerName ?? this.emerName
  117. ..emerPhone = emerPhone ?? this.emerPhone
  118. ..remNum = remNum ?? this.remNum
  119. ..remRate = remRate ?? this.remRate;
  120. }
  121. }