Feature_Report_Action #48

Merged
vaibhav.surve merged 19 commits from Feature_Report_Action into main 2025-06-23 07:32:30 +00:00
Showing only changes of commit f834422c4e - Show all commits

View File

@ -13,6 +13,7 @@ final Logger logger = Logger();
class ApiService {
static const Duration timeout = Duration(seconds: 10);
static const bool enableLogs = true;
static const Duration extendedTimeout = Duration(seconds: 60);
// === Helpers ===
@ -208,8 +209,11 @@ class ApiService {
}
}
final response =
await _postRequest(ApiEndpoints.uploadAttendanceImage, body);
final response = await _postRequest(
ApiEndpoints.uploadAttendanceImage,
body,
customTimeout: extendedTimeout,
);
if (response == null) return false;
final json = jsonDecode(response.body);
@ -259,7 +263,12 @@ class ApiService {
"gender": gender,
"jobRoleId": jobRoleId,
};
final response = await _postRequest(ApiEndpoints.createEmployee, body);
final response = await _postRequest(
ApiEndpoints.reportTask,
body,
customTimeout: extendedTimeout,
);
if (response == null) return false;
final json = jsonDecode(response.body);
return response.statusCode == 200 && json['success'] == true;
@ -309,7 +318,12 @@ class ApiService {
if (images != null && images.isNotEmpty) "images": images,
};
final response = await _postRequest(ApiEndpoints.reportTask, body);
final response = await _postRequest(
ApiEndpoints.commentTask,
body,
customTimeout: extendedTimeout,
);
if (response == null) return false;
final json = jsonDecode(response.body);
if (response.statusCode == 200 && json['success'] == true) {
@ -414,15 +428,17 @@ class ApiService {
DateTime? assignmentDate,
required String categoryId,
}) async {
final body = [{
"parentTaskId": parentTaskId,
"plannedWork": plannedTask,
"comment": comment,
"workAreaID": workAreaId,
"activityID": activityId,
"workCategoryId": categoryId,
'completedWork': 0,
}];
final body = [
{
"parentTaskId": parentTaskId,
"plannedWork": plannedTask,
"comment": comment,
"workAreaID": workAreaId,
"activityID": activityId,
"workCategoryId": categoryId,
'completedWork': 0,
}
];
final response = await _postRequest(ApiEndpoints.assignTask, body);
if (response == null) return false;