You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-moe/lib/models/hierarchy_lists.dart

72 lines
2.5 KiB
Dart

class SupervisorHierarchyLists {
SupervisorHierarchyLists({
this.subordinateHierarchyList,
this.supervisorHierarchyList,
});
List<HierarchyList>? subordinateHierarchyList;
List<HierarchyList>? supervisorHierarchyList;
factory SupervisorHierarchyLists.fromJson(Map<String, dynamic> json) => SupervisorHierarchyLists(
subordinateHierarchyList: json["SubordinateHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SubordinateHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
supervisorHierarchyList: json["SupervisorHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SupervisorHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"SubordinateHierarchyList": subordinateHierarchyList == null ? [] : List<dynamic>.from(subordinateHierarchyList!.map((x) => x.toJson())),
"SupervisorHierarchyList": supervisorHierarchyList == null ? [] : List<dynamic>.from(supervisorHierarchyList!.map((x) => x.toJson())),
};
}
class HierarchyList {
HierarchyList({
this.employeeEmailAddress,
this.employeeImage,
this.employeeMobileNumber,
this.employeeName,
this.employeeNumber,
this.employeeWorkNumber,
this.lvl,
this.numOfSubordinates,
this.organizationName,
this.positionName,
});
String? employeeEmailAddress;
dynamic employeeImage;
String? employeeMobileNumber;
String? employeeName;
String? employeeNumber;
String? employeeWorkNumber;
int? lvl;
int? numOfSubordinates;
String? organizationName;
String? positionName;
factory HierarchyList.fromJson(Map<String, dynamic> json) => HierarchyList(
employeeEmailAddress: json["EMPLOYEE_EMAIL_ADDRESS"],
employeeImage: json["EMPLOYEE_IMAGE"],
employeeMobileNumber: json["EMPLOYEE_MOBILE_NUMBER"],
employeeName: json["EMPLOYEE_NAME"],
employeeNumber: json["EMPLOYEE_NUMBER"],
employeeWorkNumber: json["EMPLOYEE_WORK_NUMBER"],
lvl: json["LVL"],
numOfSubordinates: json["NUM_OF_SUBORDINATES"],
organizationName: json["ORGANIZATION_NAME"],
positionName: json["POSITION_NAME"],
);
Map<String, dynamic> toJson() => {
"EMPLOYEE_EMAIL_ADDRESS": employeeEmailAddress,
"EMPLOYEE_IMAGE": employeeImage,
"EMPLOYEE_MOBILE_NUMBER": employeeMobileNumber,
"EMPLOYEE_NAME": employeeName,
"EMPLOYEE_NUMBER": employeeNumber,
"EMPLOYEE_WORK_NUMBER": employeeWorkNumber,
"LVL": lvl,
"NUM_OF_SUBORDINATES": numOfSubordinates,
"ORGANIZATION_NAME": organizationName,
"POSITION_NAME": positionName,
};
}