createAttendanceLog method

Future<void> createAttendanceLog(
  1. List<AttendanceLogModel> logs,
  2. String type,
  3. bool createOpLog
)

Implementation

Future<void> createAttendanceLog(
    List<AttendanceLogModel> logs, String type, bool createOpLog) async {
  final lastLog = logs.where((l) => l.type == type).lastOrNull;
  await attendanceLogLocalRepository?.create(
    lastLog!,
    createOpLog: createOpLog &&
        (logs.where((l) => l.type == 'ENTRY').lastOrNull?.time !=
            logs.where((l) => l.type == 'EXIT').lastOrNull?.time),
  );
}