
class RepairFaultEntity {

  String faultCategory;
  List<FaultTypes> faultTypes;

	RepairFaultEntity.fromJsonMap(Map<String, dynamic> map): 
		faultCategory = map["faultCategory"],
		faultTypes = List<FaultTypes>.from(map["faultTypes"].map((it) => FaultTypes.fromJsonMap(it)));

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['faultCategory'] = faultCategory;
		data['faultTypes'] = faultTypes != null ? 
			this.faultTypes.map((v) => v.toJson()).toList()
			: null;
		return data;
	}
}


class LiftFaults {

	String id;
	String code;
	int liftCategory;
	String faultCategory;
	String faultType;
	String faultDesc;

	LiftFaults.fromJsonMap(Map<String, dynamic> map):
				id = map["id"],
				code = map["code"],
				liftCategory = map["liftCategory"],
				faultCategory = map["faultCategory"],
				faultType = map["faultType"],
				faultDesc = map["faultDesc"];

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['id'] = id;
		data['code'] = code;
		data['liftCategory'] = liftCategory;
		data['faultCategory'] = faultCategory;
		data['faultType'] = faultType;
		data['faultDesc'] = faultDesc;
		return data;
	}
}

class FaultTypes {

	String faultType;
	List<LiftFaults> liftFaults;

	FaultTypes.fromJsonMap(Map<String, dynamic> map):
				faultType = map["faultType"],
				liftFaults = List<LiftFaults>.from(map["liftFaults"].map((it) => LiftFaults.fromJsonMap(it)));

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['faultType'] = faultType;
		data['liftFaults'] = liftFaults != null ?
		this.liftFaults.map((v) => v.toJson()).toList()
				: null;
		return data;
	}
}
