37 lines
960 B
Dart
37 lines
960 B
Dart
class RegularizationLogModel {
|
|
final int id;
|
|
final int employeeId;
|
|
final String name;
|
|
final String role;
|
|
final DateTime? checkIn;
|
|
final DateTime? checkOut;
|
|
final int activity;
|
|
|
|
RegularizationLogModel({
|
|
required this.id,
|
|
required this.employeeId,
|
|
required this.name,
|
|
required this.role,
|
|
this.checkIn,
|
|
this.checkOut,
|
|
required this.activity,
|
|
});
|
|
|
|
|
|
factory RegularizationLogModel.fromJson(Map<String, dynamic> json) {
|
|
return RegularizationLogModel(
|
|
id: json['id'] ?? 0,
|
|
employeeId: json['employeeId'] ?? 0,
|
|
name: "${json['firstName'] ?? ''} ${json['lastName'] ?? ''}".trim(),
|
|
role: json['jobRoleName'] ?? '',
|
|
checkIn: json['checkInTime'] != null
|
|
? DateTime.tryParse(json['checkInTime'])
|
|
: null,
|
|
checkOut: json['checkOutTime'] != null
|
|
? DateTime.tryParse(json['checkOutTime'])
|
|
: null,
|
|
activity: json['activity'] ?? 0,
|
|
);
|
|
}
|
|
}
|