///todo deleted
// import 'package:test_sa/models/lookup.dart';
// import 'package:test_sa/models/service_request/search_work_order.dart';
//
// import '../fault_description.dart';
//
// class SubWorkOrderDetails {
//   Lookup equipmentStatus;
//   Lookup reason;
//   FaultDescription faultDescription;
//   List<SparePartsWorkOrders> sparePartsWorkOrders;
//   List<SuppEngineerWorkOrders> suppEngineerWorkOrders;
//   SupplierModel supplier;
//
//   SubWorkOrderDetails({
//     this.equipmentStatus,
//     this.reason,
//     this.faultDescription,
//     this.sparePartsWorkOrders,
//     this.supplier,
//     this.suppEngineerWorkOrders,
//   });
//
//   SubWorkOrderDetails.fromJson(dynamic json) {
//     if (json['equipmentStatus'] != null) equipmentStatus = Lookup.fromJson(json['equipmentStatus']);
//     if (json['reason'] != null) reason = Lookup.fromJson(json['reason']);
//     if (json['faultDescription'] != null) faultDescription = FaultDescription.fromJson(json['faultDescription']);
//     if (json['supplier'] != null) supplier = SupplierModel.fromJson(json['supplier']);
//     if (json['sparePartsWorkOrders'] != null) {
//       sparePartsWorkOrders = [];
//       json['sparePartsWorkOrders'].forEach((v) {
//         sparePartsWorkOrders.add(SparePartsWorkOrders.fromJson(v));
//       });
//     }
//     if (json['suppEngineerWorkOrders'] != null) {
//       suppEngineerWorkOrders = [];
//       json['suppEngineerWorkOrders'].forEach((v) {
//         suppEngineerWorkOrders.add(SuppEngineerWorkOrders.fromJson(v));
//       });
//     }
//   }
//
//   SubWorkOrderDetails copyWith({
//     Lookup equipmentStatus,
//     Lookup reason,
//     FaultDescription faultDescription,
//     List<SparePartsWorkOrders> sparePartsWorkOrders,
//     SupplierModel supplier,
//     SuppEngineerWorkOrders suppEngineerWorkOrders,
//   }) =>
//       SubWorkOrderDetails(
//         equipmentStatus: equipmentStatus ?? this.equipmentStatus,
//         reason: reason ?? this.reason,
//         faultDescription: faultDescription ?? this.faultDescription,
//         sparePartsWorkOrders: sparePartsWorkOrders ?? this.sparePartsWorkOrders,
//         supplier: supplier ?? this.supplier,
//         suppEngineerWorkOrders: suppEngineerWorkOrders ?? this.suppEngineerWorkOrders,
//       );
//
//   Map<String, dynamic> toJson() {
//     final map = <String, dynamic>{};
//     map['equipmentStatus'] = equipmentStatus?.toJson();
//     map['reason'] = reason?.toJson();
//     map['faultDescription'] = faultDescription?.toJson();
//     if (sparePartsWorkOrders?.isNotEmpty ?? false) {
//       map['sparePartsWorkOrders'] = sparePartsWorkOrders?.map((e) => e.toJson())?.toList();
//     }
//     if (suppEngineerWorkOrders?.isNotEmpty ?? false) {
//       map['suppEngineerWorkOrders'] = suppEngineerWorkOrders?.map((e) => e.toJson())?.toList();
//     }
//     map['supplier'] = supplier?.toJson();
//     return map;
//   }
// }
