attendence login/logout has been implemented
This commit is contained in:
24
lib/data/dto/attendance_response_dto.dart
Normal file
24
lib/data/dto/attendance_response_dto.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class AttendanceResponseDto {
|
||||
final String id;
|
||||
final String employeeId;
|
||||
final DateTime? login;
|
||||
final DateTime? logout;
|
||||
|
||||
AttendanceResponseDto({
|
||||
required this.id,
|
||||
required this.employeeId,
|
||||
this.login,
|
||||
this.logout,
|
||||
});
|
||||
|
||||
factory AttendanceResponseDto.fromJson(Map<String, dynamic> json) {
|
||||
final data = json['data'];
|
||||
|
||||
return AttendanceResponseDto(
|
||||
id: data['id'],
|
||||
employeeId: data['employeeId'],
|
||||
login: data['login'],
|
||||
logout: data['logout'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -57,15 +57,17 @@ class LoginDataDto {
|
||||
return LoginDataDto(
|
||||
token: json['token'],
|
||||
id: json['id'],
|
||||
employeeId: json['employeeId'],
|
||||
employeeId:
|
||||
json['employeeId'] ?? json['EmployeeId'] ?? json['employee_id'],
|
||||
username: json['username'],
|
||||
fullName: json['fullName'],
|
||||
role: json['role'],
|
||||
email: json['email'],
|
||||
phoneNumber: json['phoneNumber'],
|
||||
permissions: json['permissions'] != null
|
||||
? List<String>.from(json['permissions'])
|
||||
: null,
|
||||
permissions:
|
||||
json['permissions'] != null
|
||||
? List<String>.from(json['permissions'])
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user