added service project job details screen

This commit is contained in:
Vaibhav Surve 2025-11-17 11:08:50 +05:30
parent ffd18a9e40
commit 7ee65115be
2 changed files with 3 additions and 28 deletions

View File

@ -4,6 +4,7 @@ class ApiEndpoints {
// static const String baseUrl = "https://devapi.marcoaiot.com/api";
// static const String baseUrl = "https://mapi.marcoaiot.com/api";
static const String getMasterCurrencies = "/Master/currencies/list";
static const String getMasterExpensesCategories =
"/Master/expenses-categories";

View File

@ -310,8 +310,7 @@ class ApiService {
/// Edit a Service Project Job
static Future<bool> editServiceProjectJobApi({
required String jobId,
required List<Map<String, dynamic>>
operations,
required List<Map<String, dynamic>> operations,
}) async {
final endpoint = "${ApiEndpoints.editServiceProjectJob}/$jobId";
@ -505,35 +504,20 @@ class ApiService {
}
/// Get details of a single service project
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId");
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId");
try {
final response = await _getRequest(endpoint);
try {
final response = await _getRequest(endpoint);
if (response == null) {
logSafe("Service Project Detail request failed: null response",
level: LogLevel.error);
return null;
}
if (response == null) {
logSafe("Service Project Detail request failed: null response",
level: LogLevel.error);
return null;
}
final jsonResponse = _parseResponseForAllData(
response,
label: "Service Project Detail",
);
final jsonResponse = _parseResponseForAllData(
response,
label: "Service Project Detail",
@ -547,19 +531,9 @@ class ApiService {
level: LogLevel.error);
logSafe("StackTrace: $stack", level: LogLevel.debug);
}
if (jsonResponse != null) {
return ServiceProjectDetailModel.fromJson(jsonResponse);
}
} catch (e, stack) {
logSafe("Exception during getServiceProjectDetailApi: $e",
level: LogLevel.error);
logSafe("StackTrace: $stack", level: LogLevel.debug);
}
return null;
}
return null;
}
/// Get Service Project List
static Future<ServiceProjectListModel?> getServiceProjectsListApi({