35 lines
948 B
Dart
35 lines
948 B
Dart
class EmployeeModel {
|
|
final int id;
|
|
final int employeeId;
|
|
final String name;
|
|
final String designation;
|
|
final String checkIn;
|
|
final String checkOut;
|
|
final int activity;
|
|
int action;
|
|
|
|
EmployeeModel({
|
|
required this.id,
|
|
required this.employeeId,
|
|
required this.name,
|
|
required this.designation,
|
|
required this.checkIn,
|
|
required this.checkOut,
|
|
required this.action,
|
|
required this.activity,
|
|
});
|
|
|
|
factory EmployeeModel.fromJson(Map<String, dynamic> json) {
|
|
return EmployeeModel(
|
|
id: json['id'] ?? 0,
|
|
employeeId: json['employeeId'] ?? 0,
|
|
name: '${json['firstName']} ${json['lastName']}',
|
|
designation: json['jobRoleName'] ?? '',
|
|
checkIn: json['checkIn'] ?? '-', // Make sure your API returns this field
|
|
checkOut: json['checkOut'] ?? '-',
|
|
action: json['action'] ?? 0, // Make sure your API returns this field
|
|
activity: json['activity'] ?? 0,
|
|
);
|
|
}
|
|
}
|