Worklog, anti geo spoofing and UI Polish
This commit is contained in:
@@ -181,6 +181,8 @@ final attendanceLogsProvider = StreamProvider<List<AttendanceLog>>((ref) {
|
||||
'p_duty_id': params['p_duty_id'],
|
||||
'p_lat': params['p_lat'],
|
||||
'p_lng': params['p_lng'],
|
||||
'p_accuracy': params['p_accuracy'],
|
||||
'p_is_mocked': params['p_is_mocked'],
|
||||
},
|
||||
) as String?;
|
||||
syncedLocalIds.add(localId);
|
||||
@@ -273,6 +275,8 @@ final attendanceLogsProvider = StreamProvider<List<AttendanceLog>>((ref) {
|
||||
'p_lat': fields['check_out_lat'],
|
||||
'p_lng': fields['check_out_lng'],
|
||||
'p_justification': fields['check_out_justification'],
|
||||
'p_accuracy': fields['check_out_accuracy'],
|
||||
'p_is_mocked': fields['check_out_is_mocked'],
|
||||
},
|
||||
);
|
||||
syncedIds.add(attendanceId);
|
||||
@@ -390,12 +394,20 @@ class AttendanceController {
|
||||
required String dutyScheduleId,
|
||||
required double lat,
|
||||
required double lng,
|
||||
double accuracy = 0,
|
||||
bool isMocked = false,
|
||||
String shiftType = 'normal',
|
||||
}) async {
|
||||
try {
|
||||
final data = await _client.rpc(
|
||||
'attendance_check_in',
|
||||
params: {'p_duty_id': dutyScheduleId, 'p_lat': lat, 'p_lng': lng},
|
||||
params: {
|
||||
'p_duty_id': dutyScheduleId,
|
||||
'p_lat': lat,
|
||||
'p_lng': lng,
|
||||
'p_accuracy': accuracy,
|
||||
'p_is_mocked': isMocked,
|
||||
},
|
||||
);
|
||||
return data as String?;
|
||||
} catch (e) {
|
||||
@@ -418,7 +430,14 @@ class AttendanceController {
|
||||
|
||||
_queuePendingCheckIn(
|
||||
log,
|
||||
{'p_duty_id': dutyScheduleId, 'p_lat': lat, 'p_lng': lng, 'localId': id},
|
||||
{
|
||||
'p_duty_id': dutyScheduleId,
|
||||
'p_lat': lat,
|
||||
'p_lng': lng,
|
||||
'p_accuracy': accuracy,
|
||||
'p_is_mocked': isMocked,
|
||||
'localId': id,
|
||||
},
|
||||
);
|
||||
debugPrint('[AttendanceController] checkIn queued offline: $id');
|
||||
return id;
|
||||
@@ -431,6 +450,8 @@ class AttendanceController {
|
||||
required double lat,
|
||||
required double lng,
|
||||
String? justification,
|
||||
double accuracy = 0,
|
||||
bool isMocked = false,
|
||||
}) async {
|
||||
try {
|
||||
await _client.rpc(
|
||||
@@ -440,6 +461,8 @@ class AttendanceController {
|
||||
'p_lat': lat,
|
||||
'p_lng': lng,
|
||||
'p_justification': justification,
|
||||
'p_accuracy': accuracy,
|
||||
'p_is_mocked': isMocked,
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -451,6 +474,8 @@ class AttendanceController {
|
||||
'check_out_lat': lat,
|
||||
'check_out_lng': lng,
|
||||
'check_out_justification': justification,
|
||||
'check_out_accuracy': accuracy,
|
||||
'check_out_is_mocked': isMocked,
|
||||
});
|
||||
debugPrint(
|
||||
'[AttendanceController] checkOut queued offline: $attendanceId',
|
||||
@@ -463,10 +488,18 @@ class AttendanceController {
|
||||
required double lat,
|
||||
required double lng,
|
||||
String? justification,
|
||||
double accuracy = 0,
|
||||
bool isMocked = false,
|
||||
}) async {
|
||||
final data = await _client.rpc(
|
||||
'overtime_check_in',
|
||||
params: {'p_lat': lat, 'p_lng': lng, 'p_justification': justification},
|
||||
params: {
|
||||
'p_lat': lat,
|
||||
'p_lng': lng,
|
||||
'p_justification': justification,
|
||||
'p_accuracy': accuracy,
|
||||
'p_is_mocked': isMocked,
|
||||
},
|
||||
);
|
||||
return data as String?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user